Calculation of $\int^{\pi/2}_{0}\cos^{n}(x)\cos (nx)\,dx$, where $n\in \mathbb{N}$

1.3k Views Asked by At

Compute the definite integral

$$ \int^{\pi/2}_{0}\cos^{n}(x)\cos (nx)\,dx $$

where $n\in \mathbb{N}$.

My Attempt:

Using $\cos (x) = \frac{e^{ix}+e^{-ix}}{2}$, we get

$$ \begin{align} \int^{\pi/2}_{0}\cos^{n}(x)\cos (nx)\,dx&=\int_{0}^{\pi/2} \left(\frac{e^{ix}+e^{-ix}}{2}\right)^n\left(\frac{e^{inx}+e^{-inx}}{2}\right)\,dx\\ &= \frac{1}{2^n}\mathrm{Re}\left\{\int_{0}^{\pi/2} \left(e^{ix}+e^{-ix}\right)^n\cdot e^{inx}\,dx\right\}\\ &=\frac{1}{2^n}\mathrm{Re}\left\{\int_{0}^{\pi/2}\left(e^{2ix}+1\right)^n\,dx\right\} \end{align} $$

Letting $z=e^{4ix}$ gives us

$$ \begin{align} e^{4ix}dx &= \frac{1}{4i}dz\\ dx &= \frac{dz}{4iz} \end{align} $$

So the integral becomes

$$\frac{1}{4\cdot 2^n}\mathrm{Re}\left\{\int_{C}\left(\sqrt{z}+1\right)\cdot \frac{dz}{iz}\right\}$$

How can I complete the solution from here?

2

There are 2 best solutions below

0
On BEST ANSWER

Your start is not bad, but you can get it simpler by using the evenness of $\cos$,

$$\int_0^{\pi/2} \cos^n x \cos (nx)\,dx = \frac12 \int_{-\pi/2}^{\pi/2} \cos^n x\cos (nx)\,dx.$$

Since the sine is an odd function, we can replace $\cos (nx)$ with $e^{inx}$:

$$\begin{align} \int_0^{\pi/2} \cos^n x \cos (nx)\,dx &= \frac12\int_{-\pi/2}^{\pi/2}\cos^n x \, e^{inx}\,dx\\ &= \frac{1}{2^{n+1}} \int_{-\pi/2}^{\pi/2} \left(e^{ix}+e^{-ix}\right)^n e^{inx}\,dx\\ &= \frac{1}{2^{n+1}} \int_{-\pi/2}^{\pi/2} \left(e^{2ix}+1\right)^n\,dx. \end{align}$$

Next we substitute $\varphi = 2x$ and get

$$ \int_0^{\pi/2} \cos^n x \cos (nx)\,dx = \frac{1}{2^{n+2}} \int_{-\pi}^\pi \left(e^{i\varphi}+1\right)^n\,d\varphi. $$

Now setting $z = e^{i\varphi}$ gets us a nice contour integral over the unit circle,

$$\begin{align} \int_0^{\pi/2} \cos^n x \cos (nx)\,dx &= \frac{1}{2^{n+2}} \int_{\lvert z\rvert = 1} (z+1)^n\,\frac{dz}{iz}\\ &= \frac{\pi}{2^{n+1}} \end{align}$$

by the Cauchy integral formula.

0
On

Hint:

Put $$I_n=\int_{0}^{\frac{\pi}{2}}\cos^nx\cos (nx)dx=\int_{0}^{\frac{\pi}{2}}\cos^{n-1}x\cos[(n-1)x]dx-\int_{0}^{\frac{\pi}{2}}\cos^{n-1}x\sin(nx)\sin xdx=I_{n-1}+\int_{0}^{\frac{\pi}{2}}\sin(nx)d(\frac{\cos^nx}{n})=I_{n-1}-I_{n} $$

$$\to I_n=\frac{1}{2}I_{n-1}=\cdots=\frac{1}{2^{n}}I_0=\frac{\pi}{2^{n+1}}$$