<s>[INST] Interesting way to evaluate $ \int \cos^3 x\ dx$ I have read these days a nice way for integrating $\cos^3x$:
First differentiate:
$$f=\cos^3(x)$$$$f'=-3\cos^2(x)\sin(x)$$$$f''=6\cos(x)\sin^2(x)-3\cos^3(x)$$$$f''=6\cos(x)(1-\cos^2(x))-3f$$$$f''=6\cos(x)-6\cos^3(x)-3f$$$$f''=6\cos(x)-9f$$
Then integrate:
$$f'= 6\sin(x) -9\int f(x)dx$$
Therefore,
$$\int f(x)dx=\frac 23 \sin(x) - \frac {f'} 9$$
Do you know any other way to calculate easily this integral?
 [/INST] \begin{eqnarray*}
\int \cos^3(x) dx &=& \int (1-\sin^2(x)) \cos(x) dx = \int \cos(x) dx - \int \sin^2(x) \cos(x) dx \\
\int \cos(x) dx &=& \sin(x) + C_1
\end{eqnarray*}
Now, we need to integrate $\sin^2(x) \cos(x)$. We do this with the substitution $u = \sin(x)$.
\begin{eqnarray*}
\int \sin^2(x) \cos(x) dx &=& \int u^2 du = \frac{u^3}{3} + C_1 \\
\int \sin^2(x) \cos(x) dx &=& \frac{\sin^3(x)}{3} + C_1 \\
\int \cos^3(x) dx &=& \sin(x) - \frac{\sin^3(x)}{3} + C \\
\end{eqnarray*}
</s>