Fombitz has done your second problem correctly.
Your first problem is stated as this:
Cos^2x+3cosx+2/2+cosx dx
Since there are no parentheses, I cannot tell
what is a numerator and what is a denominator.
I am guessing that your problem is as follows:
If you will use the thank-you note form below to
tell me whether this is what you mean, or that
it is different, then I will get back to you by
email.
Edwin