<s>[INST] Integration by De Moivre Theorem For example , integrate $\sin ^4(x) dx$. 
I solved this question by reduction formula which is fairly easy. But my senior said that it would be easier if you expand the $\sin ^4(x) $by using De Moivre Theorem then integrate it. I've no idea of how De Moivre's Theorem would apply. Can anyone show me ? Thanks 
 [/INST] In order to evaluate the integral we have by De Moivre
$$(\cos x+i\sin x)^4=\cos4x+i\sin4x$$
Expanding the left hand side results in
$$\cos^4x+4i\cos^3x\sin x-6\cos^2x\sin^2x-4i\cos x\sin^3x+\sin 4x=\cos4x+i\sin4x$$
Equating the real component on both sides of the equation, we have
$$\cos^4x-6\cos^2x\sin^2x+\sin^4x=\cos4x$$
Rearranging this (and using some trig identities, including the double angle formula for $\cos$) results in
$$\begin{align}\sin^4x&=\cos4x+6\cos^2x\sin^2x-\cos^4x\\\sin^4x&=\cos4x-6(1-\sin^2x)\sin^2x-(1-\sin^2x)^2\\8\sin^4x &=\cos4x-4\color{blue}{(1-2\sin^2x)}+3\\\sin^4x &=\frac{1}{8}\cos4x-\frac{1}{2}\color{blue}{\cos2x}+\frac{3}{8}\end{align}$$
Thus the integral simplifies to
$$\int\sin^4x\ dx =\int\frac{1}{8}\cos4x-\frac{1}{2}\cos2x+\frac{3}{8}\ dx\\=\frac{1}{32}\sin4x-\frac{1}{4}\sin2x+\frac{3}{8}x+c$$
</s>