# How to integrate $\cos^2x$? [duplicate]

It seems like I am stuck on such a simple problem:

How to I find the antiderivative of $\cos^2x$? I have tried partial integration, it doesn't seem to work (for me). Some help on how to integrate it would be nice.

• Use $\cos2x=2\cos^2x-1$. – almagest Jun 15 '16 at 13:16
• Similar older question: math.stackexchange.com/questions/1628840/… – Martin Sleziak Jun 17 '16 at 4:19
• And one explaining how to do ALL integrals $\int\cos^mx\sin^nx\,dx$. – Jyrki Lahtonen Jun 17 '16 at 4:52
• I don't know the exact policy on when to mark a question as duplicate, but I wouldn't refer someone with this particular question to Evaluating $\int P(\sin x, \cos x) \text{d}x$. Having to go through the general Weierstrass substitution or reduction formulas is far too complicated for a basic integral like this; the standard approach for this one isn't even mentioned in that general answer. I agree that the link Martin Sleziak provides is indeed very similar although the OP here also tried integration by parts and got a specific answer for it. – StackTD Jun 20 '16 at 12:13
• Perhaps it is worth mentioning that this specific question was mentioned as an example in this discussion on meta about duplicates. – Martin Sleziak Mar 22 '17 at 19:12

You use the identity (e.g. solving from $\cos(2x) = 2\cos^2x-1$): $$\cos^2 x = \frac{1+ \cos(2x)}{2}$$
Addendum: the previous hint will give you the easiest solution, but you mentioned an attempt with integration by parts - that would work too: $$\begin{array}{rl} \displaystyle \color{blue}{\int \cos^2x \, \mbox{d}x} & \displaystyle = \int \cos x \, \mbox{d} \sin x \\[6pt] & \displaystyle = \cos x \sin x - \int \sin x \, \mbox{d} \cos x \\[6pt] & \displaystyle = \cos x \sin x + \int \sin^2 x \, \mbox{d}x \\[6pt] & \displaystyle = \cos x \sin x + \int 1-\cos^2 x \, \mbox{d}x \\[6pt] & \displaystyle = \cos x \sin x + x - \color{blue}{\int \cos^2x \, \mbox{d}x} \\[6pt] \Rightarrow \displaystyle 2 \int \cos^2x \, \mbox{d}x & \displaystyle = \cos x \sin x + x + C \end{array}$$ Then you divide by 2.
$$\int (\cos x)^2\, dx=\int \frac{1+\cos(2x)}{2}\, dx$$
$$=\frac{1}{2}\left(\int \, dx+\frac{1}{2}\int \cos(2x)\, d(2x)\right)$$
$$=\frac{1}{2}\left(x+\frac{1}{2}\sin(2x)\right)+C=\frac{x}{2}+\frac{\sin(2x)}{4}+C$$