Find the minimum of an integral Let M be the set of the Borel integrable functions $f:[0,\pi]\to \mathbb{R}$ such that 
$$\int_0^\pi f(x) \sin(x) dx= \int_0^\pi f(x) \cos(x) dx=1.$$ Find $$\min_{f\in M} \int_0^\pi f^2(x) dx.$$ Thank you.
 A: Call $\|\ \|$ the norm on $H=L^2(0,\pi)$, $\langle\ ,\ \rangle$ the associated scalar product, and $T\subset H$ the space of functions $h$ such that $\langle h,\sin\rangle=\langle h,\cos\rangle=0$.
Let $f$ in $M$, $h$ in $T$ and $t$ real. Then, $f+th$ is in $M$ and $$
\|f+th\|^2=\|f\|^2+2t\langle f,h\rangle+\|h\|^2,
$$ 
hence $f$ in $M$ minimizes $\|f\|^2$ if and only if $\langle f,h\rangle=0$ for every $h$ in $T$. Thus $f$ is a linear combination of $\sin$ and $\cos$, say $f=\lambda\sin+\mu\cos$. 
The constraint that $f$ is in $M$ indicates that $\lambda=\mu=\frac2\pi$ hence the minimum is 
$$
\frac4{\pi^2}\|\sin+\cos\|^2=\frac4{\pi}.
$$
A: Use Cauchy–Schwarz inequality:
1) $\left (\int_{0}^{\pi }f(x)sin(x)dx  \right )^2\leq \left (  \int_{0}^{\pi }f^{2}(x)dx\right )\left (  \int_{0}^{\pi }sin^{2}(x)dx\right )$
\begin{align}\int_{0}^{\pi }f^{2}(x)dx \geq \frac{1}{\int_{0}^{\pi }sin^{2}(x)dx}\end{align}
2)$\left (\int_{0}^{\pi }f(x)cos(x)dx  \right )^2\leq \left (  \int_{0}^{\pi }f^{2}(x)dx\right )\left (  \int_{0}^{\pi }cos^{2}(x)dx\right )$
\begin{align}\int_{0}^{\pi }f^{2}(x)dx \geq \frac{1}{\int_{0}^{\pi }cos^{2}(x)dx}\end{align}
Therefore:
\begin{align}\int_{0}^{\pi }f^{2}(x)dx \geq max\left ( \frac{1}{\int_{0}^{\pi }sin^{2}(x)dx},\frac{1}{\int_{0}^{\pi }cos^{2}(x)dx} \right ) \end{align}
or:
\begin{align}\int_{0}^{\pi }f^{2}(x)dx \geq max\left ( \frac{4}{2\pi-sin(2\pi)},\frac{4}{2\pi+sin(2\pi)} \right )= \frac{2}{\pi}\end{align}
