That first one isn't as simple as putting the extra cosx out the front :S
Check here: http://www.wolframalpha.com/input/?i=integrate+%28cosx%29%5E2%2F%281%2B2sinx%29
It's quite complicated...
It's because you are integrating with respect to x, and cosx is something with an x, so you still have...