What's the minimum of $\int_0^1 f(x)^2 \: dx$, subject to $\int_0^1 f(x) \: dx = 0, \int_0^1 x f(x) \: dx = 1$?

The integrals above can be interpreted using the $L^2$ inner product $$ \langle f,g\rangle \;=\; \int_0^1 f(x)\,g(x)\,dx. $$ Specifically, we are given that $\langle 1,f\rangle = 0$ and $\langle x,f\rangle =1 $, and we are asked to find the minimum possible value of $\langle f,f\rangle$.

Since components of $f$ orthogonal to both $1$ and $x$ will only increase the norm of $f$, the minimizing function must lie in the subspace spanned by $1$ and $x$. A simple calculation shows that the minimum is obtained when $f(x) = 12x - 6$, in which case $\langle f,f\rangle = 12$.


Yes, it is true.

Consider the Hilbert space $L^2([0,1])$ of square integrable functions $f\colon[0,1]\to\mathbb{R}$ with inner product $\langle f,g\rangle = \int_0^1 f(x)g(x)\,dx$. Letting $V$ be two dimensional subspace generated by $u(x)=1$ and $v(x)=x$, then the function $g(x)=12(x-1/2)$ is in $V$ and satisfies $\langle g,u\rangle=0$ and $\langle g,v\rangle=1$. So, your question is equivalent to choosing $f$ to minimize $\langle f,f\rangle$ subject to $\langle f,h\rangle=\langle g,h\rangle$ for all $h\in V$. This condition is just saying that $g$ is the orthogonal projection of $f$ onto $V$.

So, any $f\in L^2$ satisfying the condition can be written as $$ f = g + h $$ where $h$ is in the orthogonal complement of $V$ and, therefore, $$ \langle f,f\rangle = \langle g,g\rangle+\langle h,h\rangle\ge \langle g,g\rangle=12 $$ with equality if and only if $f=g$ almost everywhere.


Seeing the very nice solutions using linear algebra that have been posted, I am again reminded that the calculus of variations is a bigger and less elegant hammer than is necessary for most nails. For what it's worth, here is how you could solve this problem with the calculus of variations. José Figueroa-O'Farrill has some nice notes which cover this: http://www.maths.ed.ac.uk/~jmf/Teaching/Lectures/CoV.pdf

As we have two constraints, we introduce two Lagrange multipliers $\lambda$ and $\mu$, and attempt to extremize the functional $$S[f] = \int_0^1 \big( f(x)^2 + \lambda f(x) + \mu x f(x) \big) dx.$$ Let us denote the integrand by $$L\big(x,f(x),f'(x)\big) = f(x)^2 + \lambda f(x) + \mu x f(x).$$

The function $f$ which is a stationary point of the functional $S[f]$ satisfies the corresponding Euler-Lagrange equation, $$\frac{\partial L}{\partial f} = \frac{d}{dx} \frac{\partial L}{\partial f'}$$ which in this case reduces to $$2f(x) + \lambda + \mu x = 0.$$ So we see that the extremal $f(x)$ is indeed linear, and the values of $\lambda$ and $\mu$ can be obtained from the constraints $\int_0^1 f(x) dx = 0$ and $\int_0^1 xf(x) dx = 1$.