Solution (source code)

= Solution

Put $h=x-\pi/4$. The <trigonometric identities> give $\cos x\sin x=\tfrac12\sin2x=\tfrac12\cos2h$. Expanding <cosine> at zero gives
$$
\boxed{f(x)=\frac12-\left(x-\frac\pi4\right)^2
+O\left((x-\pi/4)^4\right)}.
$$
The linear and cubic terms vanish, so these are the first two nonzero <Taylor series> terms.