<s>[INST] Integral of $\big((1+\cos(x))\sin(x)\big)^2$ What is 
$$\int \big((1+\cos(x))\sin(x)\big)^2dx$$
?
 [/INST] use $$\begin{align}(1 + \cos t)^2\sin^2 t &= \sin^2 t + 2\sin^2 t \cos t + \sin^2 t \cos^2 t\\
&=\frac 12 - \frac 12 \cos 2t + 2\sin^2 t \cos t + \frac 18 - \frac 18 \cos 4t \\
&=\frac 58 - \frac 12 \cos 2t +  2\sin^2 t \cos t - \frac 18 \cos 4t \end{align}$$
now we can integrate $$\int (1 + \cos t)^2\sin^2 t\, dt =  \frac 58 t - \frac 14 \sin 2t + \frac 23 \sin^3 t  - \frac 1{32} \sin 4t + C $$
</s>