So when looking at the question:

$$\int_{0}^{\pi} \cos^2 x \ \text{d}x$$

I would just subtract $\cos^2(0)$ from $\cos^2(\pi)$, but doing so would get me 1 - 1 = 0. When the answer is $\pi/2$. Where did I go wrong? What am I missing? Thanks so much for all your help! :-)

  • 1
    $\begingroup$ You need to find the antiderivative of $cos^2(x)$ first. How would you compute $\int_0^\pi cos(x)dx$? $\endgroup$ – Adam Saltz Jun 23 '11 at 2:13
  • 7
    $\begingroup$ Did you forget to integrate? $\endgroup$ – André Nicolas Jun 23 '11 at 2:13
  • $\begingroup$ @IAmBrianDawkins, well the antiderivative of cos(x) would just be sin(x) right? So 3sin^3(x) for be the antiderivative? $\endgroup$ – InBetween Jun 23 '11 at 2:33
  • 5
    $\begingroup$ You know how to differentiate. Check whether the derivative of your candidate for the answer really is $\cos^2 x$. Then look at the integration hint provided by yunone. $\endgroup$ – André Nicolas Jun 23 '11 at 2:37
  • $\begingroup$ You can take a look at the link that will be provided to see how to evaluate cosine to any power of integers as such: $\cos^{m}(x),~ \text{where }m \in \mathbb{Z}$. math.stackexchange.com/questions/25730/… $\endgroup$ – night owl Jun 23 '11 at 11:14

We have that

$$I = \int_{0}^{\pi} \cos^2 x \ dx= 2 \int_{0}^{\pi/2} \cos^2 x \ dx = 2 \int_{0}^{\pi/2} \cos^2 (\pi/2 - x) \ dx = 2 \int_{0}^{\pi/2} \sin^2 x \ dx$$

and thus

$$I = \int_{0}^{\pi/2} (\cos^2 x +\sin^2 x)\ dx = \pi/2$$

  • 7
    $\begingroup$ That's got to be one of the coolest integral manipulations I've seen in a long time. $\endgroup$ – Nicolas Villanueva Jun 23 '11 at 12:25
  • 1
    $\begingroup$ @Nico: Thanks :-) This is an old trick I learnt a long time back. I liked it so much, i still remember it! $\endgroup$ – Aryabhata Jun 23 '11 at 15:50

You need to integrate the integrand $\cos^2(x)$ first. The identity $\displaystyle\cos^2(x)=\frac{1+\cos(2x)}{2}$ is of use here.

  • 7
    $\begingroup$ Another way is: $\int_{0}^{\pi} \cos^2 x = 2 \int_{0}^{\pi/2} \cos^2 x = 2 \int_{0}^{\pi/2} \sin^2 x$. Adding the last two gives the answer. $\endgroup$ – Aryabhata Jun 23 '11 at 2:41
  • 1
    $\begingroup$ @Aryabhata: That is really nice, and I think it deserves its own answer. $\endgroup$ – Jonas Meyer Jun 23 '11 at 5:25
  • $\begingroup$ @Jonas: Thanks. Done :-) $\endgroup$ – Aryabhata Jun 23 '11 at 5:35
  • $\begingroup$ @Aryabhata that's a nice trick, though I think for pedagogical purposes I prefer yunone's answer (+1 to both, though) $\endgroup$ – Chris Taylor Jun 23 '11 at 9:53
  • $\begingroup$ @Chris: I agree (and was one of the reason I just commented first here). You might want to check out the answers here: math.stackexchange.com/questions/29980/… $\endgroup$ – Aryabhata Jun 23 '11 at 15:45

From the addition identity:

$$\cos (a+b)=\cos a\cdot \cos b-\sin a\cdot \sin b,$$

we get (setting $a=b$)

$$\cos (2a)=\cos ^{2}a-\sin ^{2}a.$$

Applying the Pythagorean trigonometric identity $\cos^2a+\sin^2a=1$, in the form $$\sin^2a=1-\cos^2a,$$


$$\cos (2a)=\cos ^{2}a-\sin ^{2}a=\cos ^{2}a-1+\cos^2a=2\cos ^{2}a-1,$$

or, equivalently

$$\cos ^{2}a=\dfrac{1+\cos (2a)}{2}.$$

Setting $x=a$ results in

$$\cos ^{2}(x)=\dfrac{1+\cos (2x)}{2}=\dfrac{1}{2}+\dfrac{\cos (2x)}{2}.$$


$$\int_{0}^{\pi} \cos^2 x \ \text{d}x=\int_{0}^{\pi}\dfrac{1}{2}+\dfrac{\cos (2x)}{2} \ \text{d}x=\dfrac{1}{2}\pi+\dfrac{1}{2}\int_{0}^{\pi}\cos (2x)\ \text{d}x=\dfrac{1}{2}\pi+\dfrac{1}{4}\int_{0}^{2\pi }\cos t\;\mathrm{d}t.$$

I leave to you the evaluation of $\displaystyle\int_{0}^{2\pi}\cos t\ \text{d}t$. Remember that you have to find the antiderivative of $\cos t$, or just observe that the period of $\cos t$ is equal to $2\pi$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.