Suppose $I=[a,b]$ is an interval of the line. Show that an ONS $\{\phi_n\}$ is complete in $L^2(I)$ iff $\sum_{n=1}^\infty(\int_{[a,x]}\phi_n)^2=x-a$ for all $x\in I$.
My Work:
If we suppose $\{\phi_n\}$ is complete, then by a theorem, $\|f\|^2=\sum_{n=1}^\infty |\langle f,\phi_n\rangle|^2$ for all $f\in L^2(I)$. $\chi_{[a,x]}\in L^2(I)$. Hence, $\|\chi_{[a,x]}\|^2=\sum_{n=1}^\infty |\langle \chi_{[a,x]},\phi_n\rangle|^2\Rightarrow x-a=\sum_{n=1}^\infty |\int_{[a,x]}\phi_n|^2$. Since $\phi_n$ is real valued we have the result.
Now I am stuck in proving the other direction. No idea how to continue. Can somebody please help me?