Answer
$$ x-\frac{1}{4}\sin 2x +\frac{1}{8}\sin4x-\frac{1}{3}\cos 3x +\cos x+C$$
Work Step by Step
We integrate as follows:
\begin{align*}
\int(\sin x+\cos 2 x)^{2} d x&=\int(\sin^2 x+\cos^2 2 x+2\sin x\cos 2x) d x\\
&= \int\left(\frac{1}{2}-\frac{1}{2}\cos2 x+\frac{1}{2} +\frac{1}{2}\cos4 x+\sin 3x-\sin x\right) d x\\
&= x-\frac{1}{4}\sin 2x +\frac{1}{8}\sin4x-\frac{1}{3}\cos 3x +\cos x+C
\end{align*}