# 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 question is as in the title: 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$? (Assume suitable smoothness conditions.)

A problem in the textbook for the course I am TEACHING (not taking) reduces to minimizing $w_1^2 + w_2^2 + w_3^2$ subject to $w_1 + w_2 + w_3 = 0, w_1 + 2w_2 + 3w_3 = 1$. Of course there's nothing special about the number $3$ here, and so one can ask for the minimum of $\sum_{i=1}^n w_i^2$ subject to $\sum_{i=1}^n w_i = 0, \sum_{i=1}^n iw_i = 1$. At least when $n = 3, 4, 5$, we get $w_i = c_n(i-(n+1)/2)$, for some constant $c_n$ which depends on $n$. So for fixed $n$, $w_i$ is a linear function of $i$. (This is a bit of an annoying computation, so I won't reproduce it here.)

So it seems like there should be a continuous analogue of this. If we have $$\int_0^1 f(x) \: dx = 0, \int_0^1 x f(x) \: dx = 1$$ and $f(x)$ is linear, then we get $f(x) = 12(x-1/2)$, and $\int_0^1 f(x)^2 \: dx = 12$. Is this the function satisfying these integral conditions with smallest $\int_0^1 f(x)^2 \: dx$? That is, is it the case that $$\int_0^1 f(x)^2 \: dx \ge 12$$ for every $f(x)$ satisfying the two conditions above and whatever smoothness conditions are necessary?

I've tagged this calculus-of-variations because that's what it looks like to me. But I don't know the calculus of variations, which is why I can't just solve the problem myself.

-
In my answer here I proved that if $f \in C^1$, $\int_{0}^{1} f = 0$ and $m \leq f' \leq M$ then $$\frac{m}{12} \leq \int_{0}^{1} x f(x) \leq \frac{M}{12}.$$ I'm not sure if that helps immediately but it seems related and I'd try a few integrations by parts. It's getting late here, so I'm not sure that I could succeed now. – t.b. Jun 20 '11 at 23:33
Well, there is the same mysterious constant of 12. I may give it a shot. – Michael Lugo Jun 20 '11 at 23:36

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$.

-
Indeed, there are nice exercises at the end of chapter 4 of Walter Rudin's Real and Complex Analysis that provide practice with this technique. – Amitesh Datta Jun 21 '11 at 0:24

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.

-
This solution is so beautiful and simple that it's almost disappointing. – t.b. Jun 21 '11 at 0:23
Note that you could alternatively try varying $f$ by an (infinitesimal) amount $\delta f$, giving $0=\delta\int_0^1f^2\,dx=\int_0^1f\delta f\,dx$ for the optimal $f$. In order that the conditions remain satisfied, you must choose $\int u\delta f\,dx=0$ for $u=1$ and $u=x$. This means that $f$ is orthogonal to any $\delta f$ orthogonal to both $1$ and $x$. As the orthogonal complement of the orthogonal complement of a closed subspace gets you back to the original space, this means that $f$ is in the linear span of $1,x$. Making this a bit cleaner and more rigorous gives the argument above. – George Lowther Jun 21 '11 at 0:28

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$.

-
Out of curiosity what was your air in jee? i might be your junior... – kuch nahi Jun 21 '11 at 5:05