# Thread: Techniques of integration (3)

1. ## Techniques of integration (3)

Let $n \geq 0$ be an integer. Evaluate $I_n=\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx.$

2. Using itegration by parts I could probably kick this thing off...

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx = \frac{1}{n}cos^n(x)sin(nx) + \int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx$

Not really sure how to do,

$\int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx$

probably needs some trig identities to tidy it up.

3. Originally Posted by pickslides
Using itegration by parts I could probably kick this thing off...

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx =$ $\color{red}\frac{1}{n}cos^n(x)sin(nx)$ $+ \int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx.$

Not really sure how to do $\int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx.$

probably needs some trig identities to tidy it up.
that's a good start. we have $I_0=\frac{\pi}{2}.$ for $n \geq 1,$ as you (almost) showed, we have: $I_n=\int_0^{\frac{\pi}{2}} \sin(nx) \sin(x) \cos^{n-1}x \ dx.$ now what?

4. Hello,

Okay, I think I got the correct idea

From $\cos(a-b)=\cos(a)\cos(b)+\sin(a)\sin(b)$, it follows that :
$\sin(nx)\sin(x)=\cos[(n-1)x]-\cos(nx)\cos(x)$

The integral is thus :

$I_n=\int_0^{\frac\pi2} \cos[(n-1)x]\cos^{n-1}(x)-\cos(nx)\cos(x)\cos^{n-1}(x) ~dx$

$I_n=\int_0^{\frac\pi2} \cos[(n-1)x]\cos^{n-1}(x) ~dx-\int_0^{\frac\pi2} \cos(nx)\cos^n(x) ~dx$

Which is :
$I_n=I_{n-1}-I_n$

$I_n=\frac 12 \cdot I_{n-1}$

$\Rightarrow \boxed{I_n=\frac{\pi}{2^{n+1}}}$

That's a really nice one

5. Bravo Moo! that's exactly the idea ... although you made a strange mistake at the end of your solution, which i'm sure you'll easily find and fix it!

6. Originally Posted by NonCommAlg
Brave Moo! that's exactly the idea ... although you made a strange mistake at the end of your solution, which i'm sure you'll easily find and fix it!
Yes indeed

1+1=n+1 : that's a very well-known result !!

7. Consider
$cos^n(x) = \frac{1}{2^n} \sum_{k=1}^{n} \binom{n}{k} [cos(n-2k)x + i sin(n-2k)x]
$

Since $cos^n(x)$ is real , the terms of sine function will be cancelled finally ,

but we experience that $\int_0^{\frac\pi2} cos(n-2k)x ~cosnx ~dx = 0$ if n-2k is not equal to n so the integral becomes :

$\frac{\pi}{2^{n+1}}$

8. Originally Posted by simplependulum

$\cos^n(x) = \frac{1}{2^n} \sum_{k=1}^{n} \binom{n}{k} [\cos(n-2k)x + i \sin(n-2k)x]
$

this is not an identity!

9. Originally Posted by NonCommAlg
Let $n \geq 0$ be an integer. Evaluate $I_n=\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx.$
It can be done using complex variables...

First note that

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\int_0^{2\pi} (\cos x)^n \cos (nx) \ dx$

Parameterize the unit circle in the comples plane with

$z=e^{i\theta} \implies \frac{dz}{iz}=d\theta$

So the integral becomes

$\oint \left(\frac{z+z^{-1}}{2}\right)^n\left( \frac{z^n+z^{-n}}{2}\right)\frac{dz}{iz}$

expanding with the binomial theorem we get

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{n-i}z^{-i}\right]\left[z^{n-1}+z^{-n-1} \right]dz$

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{2n-2i-1}+ \sum_{i=0}^{n}\binom{n}{i}z^{i-1}\right]$

each finite sume is its own larent series so the residues are coeffients on the $\frac{1}{z}$ terms so we get

$\frac{1}{i\cdot 2^{n+1}}\left[2\pi i (1)+2\pi i (1) \right]=\frac{4\pi}{2^{n+1}}$

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{4\pi}{2^{n+1}}$

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{\pi}{2^{n+1}}$

10. Originally Posted by TheEmptySet
It can be done using complex variables...

First note that

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\int_0^{2\pi} (\cos x)^n \cos (nx) \ dx$

Parameterize the unit circle in the comples plane with

$z=e^{i\theta} \implies \frac{dz}{iz}=d\theta$

So the integral becomes

$\oint \left(\frac{z+z^{-1}}{2}\right)^n\left( \frac{z^n+z^{-n}}{2}\right)\frac{dz}{iz}$

expanding with the binomial theorem we get

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{n-i}z^{-i}\right]\left[z^{n-1}+z^{-n-1} \right]dz$

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{2n-2i-1}+ \sum_{i=0}^{n}\binom{n}{i}z^{i-1}\right]$
i think the power of $z$ in the second sum should be $-2i-1.$

each finite sume is its own larent series so the residues are coeffients on the $\frac{1}{z}$ terms so we get

$\frac{1}{i\cdot 2^{n+1}}\left[2\pi i (1)+2\pi i (1) \right]=\frac{4\pi}{2^{n+1}}$

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{4\pi}{2^{n+1}}$

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{\pi}{2^{n+1}}$
looks good to me!