# Integral of $\int_0^{ \pi/2} \cos^2 x \, dx$

This seems really simple but I can't get it $$\int_0^{ \pi/2} \cos^2 x \,dx$$

$u = \cos^ 2 x$, $du = -2 \cos x \sin x$

$dv = dx$, $v = x$

$$x \cos x + 2 \int x \cos x \sin x$$

$t = \sin x$, $dt = \cos x dx$

$$2\int x \cos x t \, dt/ \cos x$$

$$2\int xt \, dt$$

$$2\int xt \, dt$$

This is where I am stuck and I do not know what to do. I guess I can do the integration by parts again but it doesnt seem to help. I do not know if it is legal to work with two variables like that.

-
You can use symmetry on the interval $[0, \pi/2]$: $\cos^2(\pi/2 - x) = \sin^2(x) = 1 - \cos^2(x)$. – WimC Jun 1 '12 at 17:43
That doesn't look very symmetric to me. – user138246 Jun 1 '12 at 17:45
$x \mapsto \pi/2 - x$ reverses the interval. A picture should make clear what's happening. – WimC Jun 1 '12 at 17:46
I see someone did mention symmetry. I posted that as an answer, with details below. – Michael Hardy Jun 1 '12 at 17:49
@Jordan : Look at the graph of $y=\cos^2 x$ on the interval $0\le x\le \pi/2$. The graph of $y=\sin^2 x$ looks exactly the same except with left and right switched around. As $x$ goes from $0$ to $\pi/2$, the function $\cos^2 x$ behaves exactly the way the function $\sin^2 x$ behaves as $x$ goes in the opposite direction---from $\pi/2$ to $0$. – Michael Hardy Jun 1 '12 at 17:52

This is one of those tricks to file away in your head (and no, you don't want 2 variables floating around in an integral like that). Utilize $$\cos^2 x = \frac{1}{2} + \frac{\cos (2x)}{2},$$ which is the standard half (or double?) angle formula from trig. After this initial substitution, you should be able to integrate.

-
This formula comes from the fact that $\cos(a+b) = \cos(a)\cos(b) - \sin(a)\sin(b)$, like this: $\cos(2x) = \cos(x + x) = \cos(x)\cos(x) - \sin(x)\sin(x) = \cos^2(x) - \sin^2(x)$. So, from the fact that $\sin^2(x) = 1 - \cos^2(x)$, we have that: $\cos(2x) = \cos^2(x) - (1 - \cos^2(x)) = 2\cos^2(x) - 1$. Then: $\cos(2x) = 2\cos^2(x) - 1$. – anonymous Jun 1 '12 at 18:33
@JohnEngbers I still can not get the correct answer even from that point. I am getting $1/2(-cos2x/4 + x)$ – user138246 Jun 2 '12 at 19:09
@Jordan you should be integrating $1/2(\cos (2x) + 1)$ which will give you $1/2 (\sin (2x)/2 + x)$. Evaluating at $\pi/2$ and subtracting the value at $0$ gives $1/2 (0 + \pi/2) - 1/2 (0 + 0) = \pi/4$. – John Engbers Jun 3 '12 at 0:59

You really don't need an antiderivative for this one if you use a simpler way to do it. Notice that $$\int_0^{\pi/2} \cos^2 x\,dx$$ must be the same as $$\int_0^{\pi/2} \sin^2 x\,dx$$ because both graphs have the same size and shape; one of them is a mirror-image of the other, with the "mirror" at $x=\pi/4$.

Then notice that $$\int_0^{\pi/2} \cos^2 x\,dx + \int_0^{\pi/2} \sin^2 x\,dx = \int_0^{\pi/2} \left(\cos^2 x + \sin^2 x\right)\,dx = \int_0^{\pi/2} 1\,dx = \frac\pi 2.$$

Therefore either integral separately is $\pi/4$.

-
I do no follow the last part, why are the two integrals equal to one? Is the only way I could do this problem is having memorized the graphs of all the trig squared fucntions? That seems incredibly absurd. – user138246 Jun 1 '12 at 17:58
@Jordan $\cos^2 x + \sin^2 x = 1$ is a well known identity . . .and you should know at least the $\sin$ and $\cos$ curves since you passed trig. – Joe Jun 1 '12 at 18:22
@MichaelHardy I do not follow what is happening, did you make a mistake? Shouldn't the bounds be 0 to $\pi / 4$| – user138246 Jun 2 '12 at 19:10
@Jordan : No. If it's $0$ to $\pi/4$, then you don't have that symmetry. The integrals of $\sin^2$ and $\cos^2 x$ over the integral from $0$ to $\pi/4$ are not equal to each other. – Michael Hardy Jun 2 '12 at 19:27
@MichaelHardy I do not understand why sin was introduced into this problem, well I get why but I do not understand why that is "legal" . – user138246 Jun 2 '12 at 19:32

Try the reduction formula I showed in the answer to your question.

-