find integral $\int_0^{\pi/2}~{\frac{\sin(~40~x)}{\sin(~5~x)}}\mathrm{d}x$ Find integral : $$\int_0^{\frac{\pi}{2}}~{\frac{\sin(~40~x)}{\sin(~5~x)}~dx}$$
My attempt -writing $$\sin~40x= \sin~40x - \sin~30x + \sin~30x - \sin~20x + \sin~20x - \sin~10x +\sin~10x$$
and apply formula $\sin~C - sin~D$
and write $\sin~10x = 2~\sin~5x\cos~5x$ … by this $\sin~5x$ will be eliminated and will be left with only cos terms. Any other approach for this problem.
 A: Hint: Note that
$$\frac {\sin 40x-\sin 10x}{\sin 5x}=2(\cos 15x+\cos 25x +\cos 35x)$$
A: Expand the numerator, then divide each term by $\sin(5x)$ (or $\sin(y)$ after substituting $y=5x$):
$$\begin{align}
I&=\int_0^{\frac\pi2}\frac{\sin(40x)}{\sin(5x)}\,\mathrm dx\\[1ex]
&= \frac15\int_0^{\frac{5\pi}2}\frac{\sin(8y)}{\sin(y)}\,\mathrm dy\\[1ex]
&=\frac15\int_0^{\frac{5\pi}2}\frac{f(y)}{\sin(y)}\,\mathrm dy
\end{align}$$
where
$$\begin{align}f(y)&=\operatorname{Im}(e^{8iy})\\&=8\cos^7(y)\sin(y)-56\cos^5(y)\sin^3(y)+56\cos^3(y)\sin^5(y)-8\cos(y)\sin^7(y)\end{align}$$
$$\implies I = \frac15\int_0^{\frac{5\pi}2}\bigg(8\cos^7(y)-56\cos^5(y)\sin^2(y)+56\cos^3(y)\sin^4(y)-8\cos(y)\sin^6(y)\bigg)\,\mathrm dy$$
A: You can generalize to any integer:
$\displaystyle\frac{\sin(nx)}{\sin(x)}=\frac{e^{inx}-e^{-inx}}{e^{ix}-e^{-ix}}=e^{-i(n-1)x}\left(\frac{1-e^{i2nx}}{1-e^{i2x}}\right)=e^{-i(n-1)x}\sum\limits_{k=0}^{n-1}e^{i2kx}=\sum\limits_{k=0}^{n-1}e^{i(2k+1-n)x}$
From there you have two possibilities, notice the indexes $(2k+1-n)$ take values

*

*$\begin{cases}-(n-1),-(n-3),\cdots,-1,1,\cdots,(n-3),(n-1)&n\text{ even}\\-(n-1),-(n-3),\cdots,-2,0,2,\cdots,(n-3),(n-1)&n\text{ odd}\end{cases}$
Therefore you can regroup terms two by two $\, e^{imx}+e^{-imx}=2\cos(mx)$ and end up with a sum of $\cos(mx)$ where $m$ varies with a step $2$.
These cosinus are easy to integrate and will give you a rational value for the integral.
Notice that for $n$ odd, you have also a constant term that will make a $\dfrac{\pi}2$ value appear.

*

*The second possibility is to integrate the exponential directly

Then $\displaystyle I_n=\sum\limits_{k=0}^{n-1}\dfrac{e^{\frac{i\pi}2(2k+1-n)}-1}{(2k+1-n)i}$
Notice also that $\displaystyle \int_0^{5\pi/2}\frac{\sin(8x)}{\sin(x)}dx=\int_0^{\pi/2}\frac{\sin(8x)}{\sin(x)}dx\ $ since the integral on $[0,2\pi]$ is zero.
So overall our integral is just $\dfrac 15I_8$
A: Hint:
Set $5x=y$
Using $\sin2A=\sin A\cos A,$
$$\sin8y=\cdots=8\sin y\cos y\cos2y\cos4y$$
If $\sin y\ne0,$
$$\dfrac{\sin8y}{\sin y}=8\cos y\cos2y\cos4y$$
$$=4\cos y(2\cos2y\cos4y)$$
$$=4\cos y(\cos2y+\cos6y)$$
$$=2(\cos y+\cos3y+\cos5y+\cos7y)$$
Generalization:
Using $\sum \cos$ when angles are in arithmetic progression,
$$2\sin B\sum_{r=0}^{n-1}\cos(2r+1)A=\sin2nA$$  Here $n=4$
