# Math Help - Today's calculation of integral #15

1. ## Today's calculation of integral #15

Find $\int_{0}^{\pi }{x\cos ^{2}x\,dx}.$

It seems pretty trivial, but find a quick solution.

2. Originally Posted by Krizalid
Find $\int_{0}^{\pi }{x\cos ^{2}x\,dx}.$

It seems pretty trivial, but find a quick solution.
$\int_0^{\pi}\frac{x}{2}+\frac{1}{2}\int_0^{\pi}x\c os(2x)$

Which gives $\bigg[\frac{x^2}{4}+\frac{1}{2}\bigg(\frac{1}{2}x\sin(2x )+\frac{1}{4}\cos(2x)\bigg)\bigg]\bigg|_0^{\pi}=\frac{1}{4}{\pi}^2$

3. That's not a quick solution, you omitted details that you should explain at least.

4. Originally Posted by Krizalid
That's not a quick solution, you omitted details that you should explain at least.
Ok I owe it at least that much...

$\cos(x)^2=\frac{1+\cos(2x)}{2}\therefore{x\cos(x)^ 2=x\bigg(\frac{1+\cos(2x)}{2}\bigg)}=\frac{x}{2}+\ frac{x\cos(2x)}{2}$

Now using integration by parts on the second and standard techniques on the first we obtain the antiderivative

O...and just because I know you love it

$\frac{x}{2}+\frac{x\cos(2x)}{2}=\frac{x}{2}+\sum_{ n=0}^{\infty}\frac{(-1)^{n}2^{2n}x^{2n+1}}{(2n)!}$

Integrating we get

$\int{x\cos(x)^2}dx=\frac{x^2}{4}+\sum_{n=0}^{\inft y}\frac{(-1)^{n}2^{2n}x^{2n+2}}{(2n+2)(2n)!}+C$

That was obviously a stupid joke^...me attempting to be funny

5. Partial integration is involved. Find another solution which does not involve integration by parts.

6. Let: $
u = \pi - x
$

Then: $
I = \int_0^\pi {x \cdot \cos ^2 \left( x \right) \cdot dx} = \int_0^\pi {\left( {\pi - u} \right) \cdot \cos ^2 \left( u \right)du}

$

Summing the expressions above : $
I = \left( {\tfrac{\pi }
{2}} \right) \cdot \int_0^\pi {\cos ^2 \left( x \right) \cdot dx}

$

And: $
\int_0^\pi {\cos ^2 \left( x \right) \cdot dx} = \int_0^\pi {\tfrac{{1 + \cos \left( {2x} \right)}}
{2} \cdot dx} = \tfrac{\pi }
{2}
$

Thus: $
I = {\tfrac{\pi^2 }
{4}}

$

7. Pretty similar I did. I defined $x\to x-\frac\pi2.$

8. I got confused with the method shown. here's another:

note that $\int_0^\pi \cos^2 x ~dx = \int_0^\pi \sin^2 x ~dx$

Thus, $\int_0^\pi x \cos^2 x ~dx = \frac 12 \left[ \int_0^\pi x \sin^2 x ~dx + \int_0^\pi x \cos^2 x~dx \right]$

$= \frac 12 \left[ \int_0^\pi x ~dx\right]$

$= \frac 12 \cdot \frac {x^2}2 \bigg|_0^\pi$

$= \frac {\pi^2}4$

9. Hi
Originally Posted by Jhevon
note that $\int_0^\pi \cos^2 x ~dx = \int_0^\pi \sin^2 x ~dx$

Thus, $\int_0^\pi x \cos^2 x ~dx = \frac 12 \left[ \int_0^\pi x \sin^2 x ~dx + \int_0^\pi x \cos^2 x~dx \right]$
What conditions have to be respected so that one can say "if $\int_a^b f(x)\,\mathrm{d}x = \int_a^b g(x)\,\mathrm{d}x$ then $\int_a^b f(x)\cdot h(x)\,\mathrm{d}x=\int_a^b g(x)\cdot h(x)\,\mathrm{d}x$" ?

I ask this question because there are some cases in which it does not work. For example :

$\int_0^{2\pi} \sin x\,\mathrm{d}x= \int_0^{2\pi}\cos x\,\mathrm{d}x=0$ but $\int_0^{2\pi} \sin^2x\,\mathrm{d}x=\pi$ and $\int_0^{2\pi} \cos x \cdot \sin x\,\mathrm{d}x=\left[\frac{sin^2x}{2}\right]_0^{2\pi}=0\neq \pi$

10. Originally Posted by Jhevon
I got confused with the method shown.
Note that $\cos(u)=-\cos(\pi-u)$, thus, when squaring on both sides, we get $\cos^2(u)=\cos^2(\pi-u)$

11. Here's my solution:

Let $\lambda =\int_{0}^{\pi }{x\cos ^{2}x\,dx}.$ Substitute $x\to x-\frac{\pi }{2}\implies \lambda =\pi \int_{0}^{\pi /2}{\sin ^{2}x\,dx}.$ In general $\int_{0}^{\pi /2}{f(\sin x)\,dx}=\int_{0}^{\pi /2}{f(\cos x)\,dx},$ hence $\lambda =\frac{\pi ^{2}}{4}.$