<s>[INST] Indefinite integral of $\sin^8(x)$ Suppose we have the following function:
$$\sin^8(x)$$
We have to find its anti-derivative
To find the indefinite integral of $\sin^4(x)$, I converted everything to $\cos(2x)$ and $\cos(4x)$ and then  integrated. However this method wont be suitable to find the indefinite integral $\sin^8(x)$ since we have to expand a lot. Is there any other way I can evaluate it easily, and more efficiently?
 [/INST] By expanding
\begin{align}
\sin^8x 
  &=\left(\frac{e^{ix}-e^{-ix}}{2i}\right)=\\
  &=\frac{1}{128}\left(
      \frac{e^{8ix}-e^{-8ix}}{2}
     -8\frac{e^{6ix}-e^{-6ix}}{2}
    +28\frac{e^{4ix}-e^{-4ix}}{2}
    -56\frac{e^{2ix}-e^{-2ix}}{2}+35\right)=\\
  &=\frac{1}{128}\left[\cos8x-8\cos6x+28\cos4x-56\cos2x+35\right]
\end{align}
or by using the identity
$$
(\sin x)^{2m}=\frac{2}{4^m}\left[\sum_{k=0}^{m-1}\binom{2m}{k}(-1)^{m-k}\cos[2(m-k)x]+\frac{1}{2}\binom{2m}{m}\right]
$$
that for $m=4$ provides
\begin{align}
\sin^8x 
  &=\frac{2}{4^4}\left[\sum_{k=0}^3\binom{8}{k}(-1)^k\cos[2(4-k)x]+\frac{1}{2}\binom{8}{4}\right]=\\
  &=\frac{1}{128}\left[\cos8x-8\cos6x+28\cos4x-56\cos2x+35\right]
\end{align}
we have
\begin{align}
\int\sin^8xdx 
  &=\frac{1}{128}\left[\frac{1}{8}\sin8x-\frac{4}{3}\sin6x+7\sin4x-28\sin2x+35x\right]+C\\
\end{align}
</s>