This is a good question that I'm sure many people face when starting out. You need to decide on your pricing model first: are you billing by the hour, or by the project?
There are advantages and disadvantages to both, but it essentially comes down to your skills, and what the client is willing to pay. I have seen many animation or graphic projects (I call these "creative" projects) where they attempt the hourly rate, but the client never agrees to pay those ones! These are where you have a project billing.
Then there are other IT related jobs I have done that were by the project, but should have been by the hour. I learned my lesson quickly on this particular incident...
If you don't know something, you need to figure it out before you start the project. This should be done in the discovery phase of your proposal. Do not invest too much un-paid time into research for one single project; if you do research it should have value in many future projects, otherwise you're wasting your time. When I research stuff, I am always asking myself, "How can I implement this for other clients?". If I can't, then it usually gets billed in, either with the project or my hourly rate (agreed upon in advance). Remember, during the discovery phase, you need to be the expert by asking all the probing questions, so that there are minimal revisions later on. For creative projects, there will always be revisions, and that needs to be accounted for in your quote.
For my IT jobs, I quote how many hours it should take in a perfect situation (i.e. all the cables work, the program disks are all available, all the usernames have been given to me, etc). I then estimate any possible issues I may have, and add the cost in. I then pad it with 25-50% markup for anything outside the scope I may have missed when evaluating the client's needs. I give them this price, and mention that it may be lower, it may be higher; if it's higher, then there are serious issues that need to be addressed before I bill more then this amount. This also shows the client you understand they work for their money too, and you don't want to screw them.
The best thing to remember though, is that your research needs to be compensated. If you can use it with other clients, great! Don't bill the full amount to the first client to ask you to do something, but include parts of it in future projects. If you are researching for just one client, and don't feel it can be used elsewhere, then you must absolutely bill the client for it! Having said that, 99% of the time, you can use the skills you learned researching for other projects; there is always the exception that proves the rule though.