Determine the minimum of $\frac{\int_0^1{x^2\left( f'\left( x \right) \right) ^2 dx}}{\int_0^1{x^2\left( f\left( x \right) \right) ^2dx}}$ For all non-zero continuously differentiable function $f:[0,1]\to\mathbb R,f(1)=0$, determine the minimum of
$$\dfrac{\displaystyle \int_0^1{x^2\left( f'\left( x \right) \right) ^2\mathrm dx}}{\displaystyle \int_0^1{x^2\left( f\left( x \right) \right) ^2\mathrm dx}}$$
I totally have no idea how to start. Can anyone help?
 A: Let $g = xf$, notice
$$\begin{align}|g'|^2 &= (xf' + f)^2 = (xf')^2 + 2xff' + f^2 =
(xf')^2 + x(f^2)' + x'f^2\\
&= (xf')^2 + (xf^2)'\end{align}$$
Intergate both sides over $[0,1]$, we obtain
$$\require{cancel}
\int_0^1 |g'|^2 dx = \int_0^1 (xf')^2 dx + \color{red}{\cancelto{0}{\color{gray}{\left[xf^2\right]_0^1}}} = \int_0^1 (xf')^2dx$$
because $f(1) = 0 \implies \left[xf^2\right]_0^1 = 0$. As a result,
$$\mathcal{I(f)} \stackrel{def}{=} \frac{\int_0^1 (xf')^2 dx}{\int_0^1 (xf)^2 dx} = \frac{\int_0^1 |g'|^2 dx}{\int_0^1 g^2 dx}$$
Notice $f \in C^1 \implies g = xf \in C^1$ and $g(0) = g(1) = 0$.
By Wirtinger's inequality, we have
$$\int_0^1 |g'|^2 dx \ge \pi^2\int_0^1 |g|^2 dx$$
This implies $\mathcal{I}(f)$ is bounded from below by $\pi^2$.
It is easy to see this lower bound is attained by
$$g(x) = \sin(\pi x)\quad\iff\quad f(x) = \frac{\sin\pi x}{x}$$
The minimum we seek equals to $\pi^2$.
A: A Calculus of Variations approach:
Since multiplying $f$ by a constant does not change the minimum or the boundary condition, the denominator can be scaled to any constant, to give a constrained minimization problem $$\textrm{Minimize }\int_0^1x^2f'(x)^2\,dx\textrm{ subject to }f(1)=0, \int_0^1x^2f(x)^2\,dx=c$$
Let the Lagrangian function be $L=x^2(f')^2-\lambda x^2f^2$. Then the Euler-Lagrange equation $\frac{d}{dx}\frac{\partial L}{\partial f'}=\frac{\partial L}{\partial f}$ becomes $$f''+\frac{2}{x}f'+\lambda f=0$$ This has the solution $f(x)=A\frac{\sin\sqrt{\lambda}x}{x}$ (the second solution is divergent at $x=0$).
Substituting $f(1)=0$, gives $\sqrt{\lambda}=\pi$, hence the minimum is $$\frac{\int_0^1x^2f'(x)^2\,dx}{\int_0^1x^2f(x)^2\,dx}=\frac{\pi^2/2}{1/2}=\pi^2$$

Edit: Strictly speaking $\sqrt{\lambda}=n\pi$ but the cost function is then $n^2\pi^2$, so the minimum occurs for $n=1$. Also, substituting $f=g/x$ simplifies the differential equation.
