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?
I copied and pasted this answer, since I actually wrote this answer to a different question which you can find here: Another way to solve $\int \frac{\sin^4(x)}{1+\cos^2(x)}\ dx$ without the substitution $y=\tan\left(\frac{x}{2}\right)$? ).
Define ${S_n = \int\sin^{2n}(x)dx}$. Then
$${S_{n}=\int \sin^2(x)\sin^{2n-2}(x)dx=S_{n-1}-\int \cos^2(x)\sin^{2n-2}(x)dx}$$
On the rightmost integral, using integration by parts yields
$${\int\cos^2(x) \sin^{2n-2}(x)dx=\frac{\cos(x)\sin^{2n-1}(x)}{2n-1}+\frac{1}{2n-1}\int \sin^{2n}(x)dx}$$
So overall
$${\Rightarrow S_n = S_{n-1}-\frac{\cos(x)\sin^{2n-1}(x)}{2n-1} - \frac{1}{2n-1}S_n}$$
And so
$${\left(\frac{2n}{2n-1}\right)S_n = S_{n-1} - \frac{\cos(x)\sin^{2n-1}(x)}{2n-1}}$$
$${\Rightarrow S_n = \frac{(2n-1)S_{n-1}}{2n} - \frac{\cos(x)\sin^{2n-1}(x)}{2n}}$$
Now you have a recursion relation that will help you compute the integral for higher even powers of ${\sin(x)}$:
$${S_{n} = \frac{(2n-1)S_{n-1}}{2n} - \frac{\cos(x)\sin^{2n-1}(x)}{2n}}$$