<s>[INST] Integrate $\int \cos^4 x\,\mathrm dx.$ $$\int \cos^4 x\,\mathrm dx  = \int (1 - \sin^2x)^2\,\mathrm dx.$$
I tried using $\cos^2(x) + \sin^2(x)$ = 1. This was on the integration by parts section of my textbook.
The integral I came out with is given me a hard time. I double checked my work and I feel I am on the right track but I feel stuck. I tried u substitution but there is no $\cos x$ to leverage with. 
 [/INST] In general$\newcommand{\dx}{\,\mathbb d x}$\begin{align*} I_n = \int \cos^n x \dx &= \int (1-\sin^2 x)\cos^{n-2} x \dx \\ &= I_{n-2} - \int \underbrace{\sin x \cos^{n-2}x}_{v^\prime} \underbrace{\sin x}_u \dx \\ &= I_{n-2} + \frac{1}{n-1}\cos^{n-1} x \sin x - \frac{1}{n-1}\int \cos^{n-1} x \cos x \dx \\ &= I_{n-2} + \frac{1}{n-1}\cos^{n-1} x \sin x - \frac{1}{n-1}I_n \\ \frac{n}{n-1} I_n &= I_{n-2} + \frac{1}{n-1}\cos^{n-1} x \sin x \\[12pt] I_n &= \frac{n-1}{n}I_{n-2} + \frac{1}{n}\cos^{n-1} x \sin x \end{align*}
Valid for $n \gt 1$
So \begin{align*}\int \cos^4 x \dx &= \frac34\int\cos^2 x \dx + \frac13\cos^3 x \sin x \\ &= \frac34\left( \frac12\int\dx+\frac12\cos x \sin x \right) + \frac13\cos^3 x \sin x \\ &= \frac38x + \frac38 \cos x \sin x + \frac13 \cos^3 x \sin x +c\end{align*}
</s>