best approximation of $f$ in $L^2([0,2\pi])$ as a linear combination of $\sin(kx)$ (with $k∈\{1,2,3,\ldots,10\}$ Let $f$ be a $2\pi$ periodic function. Assume that $f$ is quadratic integrable in the interval $[0,2\pi]$. Consider $f$ as a vector in the Hilbert space $L^2([0,2\pi])$. Give, based on the Fourier coefficients of $f$, the best approximation of $f$ in $L^2([0,2\pi])$ as a linear combination of $\sin(kx)$ (with $k∈\{1,2,3,\ldots,10\}$
Answer:
I think {$\frac{sin(kx)}{\pi}|k=1..10$} is an orthonormal set. So the best approximation is the orthogonal projection on $K= span${$\frac{sin(kx)}{\pi}|k=1..10$} What is the next step? Taking the imaginary part of de fourier coefficients, or is that not the meaning?
 A: The best approximation minimizes the following over all possible $\{ a_k \}_{k=1}^{10}$:
$$
               d(a_1,a_2,\cdots,a_{10})=\left\|f - \sum_{k=1}^{10}a_k \sin(kx)\right\|^2.
$$
The best approximation is the same as the orthogonal projection, meaning that $\{ a_k\}_{k=1}^{10}$ are chosen so that
$$
    \left(f-\sum_{k=1}^{10}a_k \sin(kx),\sin(nx)\right)=0,\;\;\; n=1,2,\cdots,10.
$$
You end up with a system of 10 equations in 10 unknowns, and the system has a unique solution because the set of functions $\{ \sin(kx) \}_{k=1}^{10}$ is linearly independent.
This generalizes what you learned in Calculus connecting closest distance and orthogonal projection. Orthogonal projection gives the Fourier coefficents because $(\sin(kx),\sin(nx))=0$ for $n \ne k$; that is,
$$
      (f,\sin(nx))-a_n(\sin(nx),\sin(nx))=0.
$$
Therefore,
\begin{align}
  a_n & = \frac{(f,\sin(nx))}{(\sin(nx),\sin(nx))} \\
      & =\frac{\int_{0}^{2\pi}f(x)\sin(nx)dx}{\int_{0}^{2\pi}\sin^2(nx)dx} \\
      & =\frac{1}{\pi}\int_{0}^{2\pi}f(x)\sin(nx)dx.       
\end{align}
