I want to find all $f\in L^2([0,\pi])$ such that $$ \begin{align} \int_0^\pi\lvert f(x)-\sin(x)\rvert^2\,dx &\le \frac{4\pi}{9}\\ \int_0^\pi\lvert f(x)-\cos(x)\rvert^2\,dx &\le \frac{\pi}{9}\\ \end{align} $$
I started by taking the Fourier transform of $\sin(x)$ and $\cos(x)$, and then used Parseval's theorem. This led to $$ \begin{align} \frac{4\pi}{9} \ge \lvert\lvert \,f(x) - \sin(x) \rvert\rvert_{L^2} &= \left|\left|\, \hat{f}(\kappa) - \frac{1+e^{-2\pi i \kappa}}{(1-4\kappa^2)\sqrt{\pi}} \right|\right|_{\ell^2}\\ \frac{\pi}{9} \ge \lvert\lvert \,f(x) - \cos(x) \rvert\rvert_{L^2} &= \left|\left|\, \hat{f}(\kappa) - \frac{2i\kappa(1+e^{-2\pi i \kappa})}{(1-4\kappa^2)\sqrt{\pi}} \right|\right|_{\ell^2} \end{align} $$
Maybe that was going down the wrong path, but that's where I'm at now. I don't see what to do next, or have any other ideas.
Any thoughts? Thanks.
First, note that \begin{align} \|\sin-\cos\|^2&=\|\sin(x)\|^2+2\langle\sin,\cos\rangle+\|\cos\|^2 \\ & =\|\sin\|^2+\|\cos\|^2 \\ & = \|1\|^2=\pi. \end{align} You want $$ \|f-\sin\|+\|f-\cos\| \le \frac{2}{3}\sqrt{\pi}+\frac{1}{3}\sqrt{\pi}=\sqrt{\pi} $$ If you have the above, then $$ \sqrt{\pi}=\|\sin-\cos\| \le \|\sin-f\|+\|f-\cos\| \le \sqrt{\pi}. $$ The only way that happens is if $f$ lines on the segment connecting $\sin$ and $\cos$. That means there is a real scalar $\alpha$ such that $0 \le \alpha \le 1$ and $$ f = \alpha\sin +(1-\alpha)\cos. $$ The $\alpha$ is unique because \begin{align} \|f-\sin\|=\frac{2}{3}\sqrt{\pi},&\;\;\; \|f-\cos\|=\frac{1}{3}\sqrt{\pi} \\ \|(\alpha-1)\sin+(1-\alpha)\cos\|=\frac{2}{3}\sqrt{\pi}, &\;\;\; \|\alpha(\sin-\cos)\|=\frac{1}{3}\sqrt{\pi} \\ (1-\alpha)\|\sin-\cos\|=\frac{2}{3}\sqrt{\pi}, &\;\;\; \alpha\|\sin-\cos\|=\frac{1}{3}\sqrt{\pi} \\ (1-\alpha)=\frac{2}{3},&\;\;\; \alpha=\frac{1}{3}. \end{align} So that works out to give the solution $$ f = \frac{1}{3}\{\sin+2\cos\} $$