# How do I prove $\int_0^\pi\frac{(\sin nx)^2}{(\sin x)^2}dx = n\pi$?

I need to show that the following integral:

$$\int_0^\pi\frac{(\sin nx)^2}{(\sin x)^2}dx$$ = $n\pi$, for all natural numbers $n$. What is the method to evaluate the above?

I initially thought of the Leibniz rule, but that wouldn't work as the result only holds for positive integers, meaning the integral would not be a continuous function in $n$. Is there some other way to prove it?

• You could try induction. – Daniel Fischer Nov 10 '16 at 14:29
• try some examples at first – Dr. Sonnhard Graubner Nov 10 '16 at 14:37
• contour integration will work – tired Nov 10 '16 at 14:44
• – tired Nov 10 '16 at 15:00

If $I_n=\int_0^\pi\dfrac{\sin^2nx}{\sin^2x}dx$

$I_0=0,I_1=\pi$

$$I_{m+1}-I_m=\int_0^\pi\dfrac{\sin^2(m+1)x-\sin^2mx}{\sin^2x}dx=\int_0^\pi\dfrac{\sin(2m+1)x}{\sin x}dx=J_m\text{(say)}$$

Now $$J_{r+1}-J_r=\int_0^\pi\dfrac{\sin(2r+3)x-\sin(2r+1)x}{\sin x}dx=2\int_0^\pi\cos2(r+1)\ dx$$

For $r+1\ne0,$ $$J_{r+1}-J_r=\cdots=0$$

For $r\ge0,$ $$\implies J_r=J_0$$

$$J_0=I_1-I_0=\pi$$

For $m\ge0,$ $$I_{m+1}-I_m=J_0=\pi$$ Can you take it from here?

• nice one (+1)  – tired Nov 10 '16 at 14:49
• Nice proof. Thanks for that! – Newton Nov 10 '16 at 14:53

Here's another way. Recall that $\sin(x) =\frac{e^{i x}-e^{-i x}}{2i}$. Therefore $$I = \int_0^{\pi} \frac{\sin^2(nx)}{\sin^2(x)}\mathrm{d}x = \int_0^{\pi} \frac{\left(\frac{e^{inx}-e^{-inx}}{2i}\right)^2}{\left(\frac{e^{ix}-e^{-ix}}{2i}\right)^2} \mathrm{d}x = \int_0^{\pi} \frac{e^{-i2nx}(e^{i2nx}-1)^2}{e^{-i2x}(e^{i2x}-1)^2} \mathrm{d}x = \int_0^{\pi} e^{-i2 (n-1)x}\frac{(e^{i2nx}-1)^2}{(e^{i2x}-1)^2} \mathrm{d}x$$ For the next step, recall that $(t^n-1)/(t-1) = 1+t+\ldots+t^{n-1}$. Using $t=e^{i2x}$ we get: $$I = \int_0^{\pi} e^{-i2(n-1)x}(1+e^{i2x}+\ldots+e^{i2(n-1)x})^2\mathrm{d}x$$ Then we multiply out to see that $(1+t+\ldots+t^{n-1})^2 = 1+2t+3t^2+\ldots nt^{n-1}+(n-1)t^{n+1}+\ldots+t^{2n-1}$ to see that the integral is $$I = \int_0^{\pi} e^{-i2(n-1)x}(1+\ldots+ne^{i2(n-1)x}+\ldots +e^{i2(2n-2)x})\mathrm{d}x$$ Finally we note that if $n\neq 0$ then $$\int_0^\pi e^{i2nx}\mathrm{d}x = \left.\frac{1}{i2n}e^{i2nx}\right|_0^{\pi} = \frac{(-1)^{2n}-1}{i2n}=0$$ whereas for $n=0$ we get $$\int_0^\pi e^{i2nx}\mathrm{d}x = \int_0^\pi 1\mathrm{d}x = \pi$$ Plugging into our expression from the integral we get $$I = n\pi.$$

• Cool! I never thought complex numbers could be used to integrate real valued functions though. – Newton Nov 10 '16 at 16:48
• You can; I usually use this method for integrating $P(x)\sin kx$ or $P(x)\cos kx$ where $P$ is a polynomial. – Sean Roberson Nov 10 '16 at 18:14
• @Kalyan IMO, complex numbers can really change the way you think about real integrals. Wait till you get to contour integrals for real integrals. – Simply Beautiful Art Nov 10 '16 at 19:30

HINT.-A third quite different way (no greater details for short).

$$I_n=\int_0^\pi\frac{(\sin nx)^2}{(\sin x)^2}dx=\int_0^\pi(\sin nx)^2)d(-\cot x)=n\pi$$ $$I_n=\left[(\sin nx)^2)(-\cot x)\right]_0^{\pi}+\int_0^\pi\frac{\sin 2nx(n\cos x)}{\sin x} =n\pi$$ The first term in RHS is equal to $0$ hence we can prove as equivalent statement that for all $n$ $$J_n=\int_0^\pi\frac{\sin 2nx\cos x}{\sin x} =\pi$$

It is verified that that $$J_1=\int_0^\pi\frac{\sin 2x\cos x}{\sin x} =\left[(x+\sin x\cos x\right]_0^{\pi}=\pi$$ so for finish we prove that $$J_{n+1}-J_n=0\qquad(*)$$ (the equality $(*)$ implies immediately that $J_2=J_3=\cdots J_n=\pi$)

We have the trigonometric identities

$$\begin{cases}\sin(2n+1)x\cos x=\frac 12\left[\sin(2n+2)x+\sin 2nx\right]\\\sin(2n)x\cos x=\frac 12[\sin(2n+1)x+\sin (2n-1)x]\end{cases}$$ It follows $$I_{n+1}-I_n=\frac 12\int_0^{\pi}\frac{(\sin(2n+2)x+\sin 2nx)-(\sin(2n+1)x+\sin (2n-1)x)}{\sin x}dx$$

We have here elementary integrals allow us to verify that $(*)$ is true.


The last two integrals vanish out.

Then, $$\bbx{\bbox[#ffd,10px]{\ds{\left.\int_{0}^{\pi}{\sin^{2}\pars{nx} \over \sin^{2}\pars{x}}\,\dd x\,\right\vert_{\ n\ \in\ \mathbb{Z}}}} = \verts{n}\pi}$$