I look at it this way. How much are you emphasizing this work in your SOP? If you are using it as a strong and clear example of your abilities and experience then it would look really odd if you didn't get a letter from that professor. The letter needs to fit what you say about the experience, your presentation of your research should be in line with what your recommender will probably say. So, given that it sounds like he really wasn't all that impressed, and according to him the solution should not have been so hard. Even saying that he'd ignore the issues with that project and write a good letter, what will he write about? What are you going to write about in your SOP? You won't know exactly what he writes, but you should to be able to imagine what will be written if you just realistically think about it. I just don't see what "good things" he's going to write about. And you don't want to overstate something and come off as sounding egotistical or dumb in your SOP. And you definitely don't want to just talk about how big of a pain in butt it was. On the other hand, you say you can get a good letter from a TA. The problem is, how good is any letter when it comes from a TA? Professor's, Department Chair, Research Scientists okay, but TA is pushing it if you ask me. Still, that is a topic of much debate, but I'd consider it a last resort. Never the less, looking at it strictly from this position I'd approach the matter this way. If you are emphasizing this research, using it as a sort of keystone, then you need the professors letter. If you're not, then go with the TA and don't look back. A lot of people have their 3rd become basically a fluff letter, and fluff is better than a potentially negative one because can you honestly say you trust this guy to not mention how things went down or rather how he sees things went down? What I would do is sit back down with this professor and be frank. Don't ask him directly what he'll write, but address the issue that if the project didn't really make progress with you but with someone else, and that his impression of your work doesn't appear to be spectacular, what "good" can really he write about? Unless you're completely convinced by the end that the letter will be good, rethink your emphasis on the work, and go ask the TA. I just don't trust him myself. He didn't understand why you couldn't get the work done, openly told you it took another student no time to get it working, had suspicions of your own word about your illness, etc. He sounds like he's either lying to you, or will write a letter that is so vague and loose, which it shouldn't be considering the time you were technically working under him, that when people read it they'll tell right away that this guy isn't really recommending you. Personally, if I were him and I felt the way about the situation that you say he does I certainly wouldn't tell the student I would write a good letter, in fact I'd probably refuse to write one in first place.