Find the distance from function $x(t)=t$ to a given subspace of $L^2(-\pi,\pi)$

68 Views Asked by At

Let $Z=\operatorname{span}(1,\sin t,\cos t)$, $x(t)=t$. Find $\operatorname{dist}(x,Z)$ in $L_2(-\pi,\pi)$.

This question in from my homework. From a lemma that we learned it says if $Z$ is closed and $x(t)=t \notin Z$ then $\operatorname{dist}(x,Z)= \operatorname{proj}_Lx=c_0 1+c_1 \sin t+c_2 \cos t$ where $c_i=\left<x(t),e_i\right>$.

So, $c_0=\left<t,1\right>=\int_{-\pi}^{\pi} t\cdot 1\,dt=\pi^2$. In the same way $c_1=2\pi$ and $c_2= 0$.

I.e., $\operatorname{dist}(x,Z)= \pi^2+2\pi \sin t$.

But my assistant said $\operatorname{dist}$ is a number not a function if $x$ is specified.

So how am I supposed to find that number?