題組內容

2.  Fourier series says that any periodic function can be expressed as a linear combination of infinite harmonic cosine and sine functions.

(b) From the spectral theorem, find a vector \(g(x)\) in a subspace spanned by only \(\{1, \cos(x), \cos(2x), \sin(x), \sin(2x)\}\) so that \(g(x)\) has the shortest distance to the function \(f(x) = x\) in the interval \([-\pi, \pi]\).
Note: In this problem, you may need: \(\int x \sin ax dx = -\frac{x}{a} \cos ax + \frac{1}{a^2} \sin ax\) and \(\int x \cos ax dx = \frac{x}{a} \sin ax + \frac{1}{a^2} \cos ax\)