Solution (source code)

= Solution

Taking the <inner product> with $f_m$ and using <Fourier orthogonality> isolates $a_m$. Since $x\sin(mx)$ is <even>, <integration by parts> gives
$$
\pi a_m=2\int_0^\pi x\sin(mx)\,dx=-\frac{2\pi(-1)^m}{m}.
$$
Consequently the <Fourier sine series> is
$$
\boxed{x=2\sum_{n=1}^\infty\frac{(-1)^{n+1}}n\sin(nx),\qquad-\pi<x<\pi.}
$$
The <series> converges to $x$ at each interior point and in the <L2 norm>. Its periodic extension has jumps at $\pm\pi$, where the <Fourier series> instead converges to the midpoint value zero. The overshoot near those jumps is the <Gibbs phenomenon>.

\Image[/past-exam-of-the-mathematical-methods-i-course-of-the-university-of-oxford/2014-resit-fourier-sawtooth.png]
{title=Fourier sine partial sums recover the odd linear function inside the interval, with endpoint jump overshoot}