# Today's calculation of integral #15

• May 9th 2008, 04:51 PM
Krizalid
Today's calculation of integral #15
Find $\displaystyle \int_{0}^{\pi }{x\cos ^{2}x\,dx}.$

It seems pretty trivial, but find a quick solution.
• May 9th 2008, 04:57 PM
Mathstud28
Quote:

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

It seems pretty trivial, but find a quick solution.

$\displaystyle \int_0^{\pi}\frac{x}{2}+\frac{1}{2}\int_0^{\pi}x\c os(2x)$

Which gives $\displaystyle \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$
• May 9th 2008, 04:58 PM
Krizalid
That's not a quick solution, you omitted details that you should explain at least.
• May 9th 2008, 05:20 PM
Mathstud28
Quote:

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...

$\displaystyle \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

$\displaystyle \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

$\displaystyle \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$(Itwasntme)

That was obviously a stupid joke^...me attempting to be funny
• May 9th 2008, 05:27 PM
Krizalid
Partial integration is involved. Find another solution which does not involve integration by parts.
• May 9th 2008, 05:46 PM
PaulRS
Let: $\displaystyle u = \pi - x$

Then: $\displaystyle 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 : $\displaystyle I = \left( {\tfrac{\pi } {2}} \right) \cdot \int_0^\pi {\cos ^2 \left( x \right) \cdot dx}$

And: $\displaystyle \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: $\displaystyle I = {\tfrac{\pi^2 } {4}}$
• May 9th 2008, 05:58 PM
Krizalid
Pretty similar I did. I defined $\displaystyle x\to x-\frac\pi2.$
• May 9th 2008, 07:46 PM
Jhevon
I got confused with the method shown. here's another:

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

Thus, $\displaystyle \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]$

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

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

$\displaystyle = \frac {\pi^2}4$
• May 10th 2008, 01:51 AM
flyingsquirrel
Hi
Quote:

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

Thus, $\displaystyle \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 $\displaystyle \int_a^b f(x)\,\mathrm{d}x = \int_a^b g(x)\,\mathrm{d}x$ then $\displaystyle \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 :

$\displaystyle \int_0^{2\pi} \sin x\,\mathrm{d}x= \int_0^{2\pi}\cos x\,\mathrm{d}x=0$ but $\displaystyle \int_0^{2\pi} \sin^2x\,\mathrm{d}x=\pi$ and $\displaystyle \int_0^{2\pi} \cos x \cdot \sin x\,\mathrm{d}x=\left[\frac{sin^2x}{2}\right]_0^{2\pi}=0\neq \pi$
• May 10th 2008, 02:59 AM
PaulRS
Quote:

Originally Posted by Jhevon
I got confused with the method shown.

Note that $\displaystyle \cos(u)=-\cos(\pi-u)$, thus, when squaring on both sides, we get $\displaystyle \cos^2(u)=\cos^2(\pi-u)$
• May 10th 2008, 07:15 AM
Krizalid
Here's my solution:

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