<s>[INST] How does one evaluate $\int \frac{\sin(x)}{\sin(5x)} \ dx$ 
*

*The below problem is taken from Joseph Edwards book Integral Calculus for beginners. 


How does one show:
$$5 \int \frac{\sin(x)}{\sin(5x)} \ dx= \sin\left(\frac{2\pi}{5}\right) \cdot \log\left\{\frac{\sin\left(x-\frac{2\pi}{5}\right)}{\sin\left(x+\frac{2\pi}{5}\right)}\right\} -\sin\left(\frac{\pi}{5}\right) \cdot \log\left\{\frac{\sin\left(x-\frac{\pi}{5}\right)}{\sin\left(x+\frac{\pi}{5}\right)}\right\} $$


*

*Splitting $\sin{(5x)}$ as $\sin{(4x+x)}$ doesn't seem to be of much help since then we have a big term in the denominator after expansion.

 [/INST] First of all, we use De Moivres’ Theorem to express $\sin 5x $ in terms of $\cos x$ and $\sin x$.
$$
\begin{aligned}
&\cos 5 x+i \sin 5 x\\=&(\cos x+i \sin x)^{5} \\
=& \cos^{5} x+5 i \cos ^{4} x \sin x-10 \cos^{3} x \sin ^{2} x-10 i \cos ^{2} x \sin ^{3} x+5 \cos  x \sin ^{4} x+i \sin ^{5} x
\end{aligned}
$$
Comparing the imaginary parts on both sides yields
$$
\sin 5 x=5 \cos ^4 \sin x-10 \cos ^{2} x \sin ^{3} x+\sin ^{5} x
$$
$$
\begin{aligned}
\because \int\frac{\sin x}{\sin 5 x} d x &=\int \frac{1}{5 \cos ^{4} x-10 \cos ^{2} x \sin ^{2} x+\sin ^{4} x} d x \\
&=\int \frac{\sec ^{4} x d x}{5-10 \tan ^{2} x+\tan ^{4} x} \\
&=\int \frac{1+t^{2}}{t^{4}-10 t^{2}+5}dt, \quad  \textrm{  where }t=\tan x.
\end{aligned}
$$
Playing a small trick on the integrand yields
$$
\begin{aligned}
\int \frac{\sin x}{\sin 5 x}dx&=\int \frac{1+\frac{1}{t^{2}}}{t^{2}+\frac{5}{t^{2}}-10} d t\\
&= \int \frac{\frac{\sqrt{5}+1}{2}\left(1+\frac{\sqrt{5}}{t^{2}}\right)+\frac{\sqrt{5}-1}{2}\left(1-\frac{\sqrt{5}}{t^{2}}\right)}{t^{2}+\frac{5}{t}-10} d t\\
&=\frac{\sqrt{5}+1}{2} \int \frac{d\left(t-\frac{\sqrt{5}}{t}\right)}{\left(t-\frac{\sqrt{5}}{t}\right)^{2}-(10-2 \sqrt{5})}+\frac{\sqrt{5}-1}{2} \int \frac{d\left(t+\frac{\sqrt{5}}{t}\right)}{\left(t+\frac{\sqrt{5}}{t}\right)^{2}-(10+2 \sqrt{5})}\\&=\frac{\sqrt{5}+1}{2 \sqrt{10-2 \sqrt{5}}} \tan ^{-1}\left(\frac{t-\frac{\sqrt{5}}{t}}{\sqrt{10-2 \sqrt{5}}}\right)+\frac{\sqrt{5}-1}{4 \sqrt{10+2 \sqrt{5}}} \ln \left|\frac{t+\frac{\sqrt{5}}{t}-\sqrt{10+2 \sqrt{5}}}{t+\frac{\sqrt{5}}{t}+\sqrt{10+2 \sqrt{5}}}\right|+C\\&=\frac{\sqrt{5}+1}{2 \sqrt{10-2 \sqrt{5}}} \tan ^{-1}\left(\frac{\tan^2 {x}-\sqrt{5} }{\tan {x}\sqrt{10-2 \sqrt{5}}}\right)\\&+\frac{\sqrt{5}-1}{4 \sqrt{10+2 \sqrt{5}}} \ln \left| \frac{\tan ^{2} x-\sqrt{10+2 \sqrt{5}} \tan x+ \sqrt{5}}{\tan ^{2} x+\sqrt{10+2 \sqrt{5}} \tan x+\sqrt{5}}\right|+C
\end{aligned}
$$
</s>