Solution (source code)

= Solution

Evaluate the recurrence boundary terms at zero and $\pi/2$. For $n>1$, both $\cos x\sin^{n-1}x$ and $\sin x\cos^{n-1}x$ vanish at both endpoints. Therefore the <Wallis integrals> obey
$$
\boxed{\int_0^{\pi/2}\sin^nx\,dx=\frac{n-1}{n}\int_0^{\pi/2}\sin^{n-2}x\,dx},
$$
$$
\boxed{\int_0^{\pi/2}\cos^nx\,dx=\frac{n-1}{n}\int_0^{\pi/2}\cos^{n-2}x\,dx}.
$$
The starting value for both is $\int_0^{\pi/2}1\,dx=\pi/2$. Thus
$$
\boxed{\int_0^{\pi/2}\sin^2x\,dx=\int_0^{\pi/2}\cos^2x\,dx=\frac\pi4},
$$
$$
\boxed{\int_0^{\pi/2}\sin^4x\,dx=\int_0^{\pi/2}\cos^4x\,dx=\frac{3\pi}{16}}.
$$