Solution (source code)

= Solution

The function is <even> and continuous, with period $2\pi$. On $0<x<\pi$ it is $\sin2x$, so it rises from zero to one at $\pi/4$, crosses zero at $\pi/2$, reaches minus one at $3\pi/4$, and returns to zero at $\pi$. Reflect this curve about the vertical axis and repeat periodically. The joins at integer multiples of $\pi$ have corners, but no jumps.

\Image[/past-exam-of-the-mathematics-course-of-the-year-1-of-the-natural-sciences-course-of-the-university-of-cambridge/2006/paper-1-even-sine-extension.png]
{title=Even periodic extension of a sine mode and its Fourier approximation}
{description=Original plot over two periods. The dashed approximation uses the first twelve nonzero cosine coefficients; the exact function is continuous with corners at integer multiples of $\pi$.}