Answer
$$\int \sin^2 xdx =\frac{x}{2}-\frac{1}{4}\sin2x +C$$
$$\int \cos^2 xdx = \frac{x}{2}+\frac{1}{4}\sin 2 x+C$$
Work Step by Step
Let
\begin{align*}
u&=\sin x\ \ \ \ \ \ \ \ \ \ \ \ dv=\sin x dx\\
du&= \cos x\ \ \ \ \ \ v=-\cos x
\end{align*}
Then
\begin{align*}
\int \sin^2 xdx&= -\cos x\sin x+\int \cos^2 xdx \\
&=-\frac{1}{2}\sin2x +\int (1-\sin^2 x)dx\\
2\int \sin^2 xdx&=-\frac{1}{2}\sin2x +x\\
\int \sin^2 xdx&=\frac{x}{2}-\frac{1}{4}\sin2x +C
\end{align*}
Let \begin{align*}
u&=\cos x\ \ \ \ \ \ \ \ \ \ \ \ dv=\cos x dx\\
du&= -\sin x\ \ \ \ \ \ v=\sin x
\end{align*}
Then\begin{align*}
\int \cos^2 xdx&= \cos x\sin x+\int \sin^2 xdx \\
&=\frac{1}{2}\sin 2 x+\int (1-\cos^2 x)dx\\
2\int \cos^2 xdx&= \frac{1}{2}\sin 2 x+x\\
\int \cos^2 xdx&= \frac{x}{2}+\frac{1}{4}\sin 2 x+C
\end{align*}