<s>[INST] How can I find $ \int{(1 + \cos x)^3\mathrm dx} $? My question is ; How can I solve the following integral question?
$$\int{(1 + \cos x)^3\mathrm dx}$$
Thanks in advance,
 [/INST] Expand $(1+\cos(x))^3$. And rewrite $\cos^n(x)$ in terms of $\cos(nx)$ and other similar terms.
$(1+\cos(x))^3 = 1 + 3 \cos(x) + 3 \cos^2(x) + \cos^3(x) = \frac{\cos(3x)+6 \cos(2x)+15 \cos(x)+10}{4}$.
Now, integrate term by term to get the desired answer.
$\int \cos(nx) = \frac{\sin(nx)}{n}$.
Hence, $\int (1+\cos(x))^3 = \frac{\frac{\sin(3x)}{3}+6\frac{\sin(2x)}{2}+15 \sin(x) + 10x}{4} + c = \frac{\sin(3x)}{12} + \frac{3\sin(2x)}{4} + \frac{15 \sin(x)}{4} + \frac{5x}{2} + c$.
</s>