$$\begin{array}{ll} \text{maximize} & \displaystyle\int_{0}^{1} x \, f(x) \, \mathrm dx\\ \text{subject to} & \displaystyle\int_{0}^{1} f(x) \, \mathrm dx = 1\\ & \displaystyle\int_{0}^{1} x^2 f(x) \, \mathrm dx = 1\\ & f(x) \geq 0 \quad \forall x \in [0,1]\end{array}$$
A few years ago I studied calculus of variations but for some reason I keep chasing my tail on this problem. If my recollection is even close to the mark we start with $$L=\int_{0}^{1} \left( f(x) \cdot x \right) dx + \lambda_1 \cdot \left( \int_{0}^{1} \left( f(x) \right) dx - 1\right) + \lambda_2 \cdot \left( \int_{0}^{1} \left( f(x) \cdot x^2 \right) dx - 1\right)$$
And then Euler Lagrange drops $f$ completely and gives
$$x+\lambda_1 +\lambda_2 x^2=0$$
If the slack constraints are functional
$$L=\int_{0}^{1} \left( f(x) \cdot x \right) + \lambda_1(x) \cdot \left( \left( f(x) \right) - 1\right) + \lambda_2(x) \cdot \left( \left( f(x) \cdot x^2 \right) - 1\right) dx$$
gives
$$x+\lambda_1(x) +\lambda_2(x) x^2=0$$
But I'm not sure if from here how we enforce the $\lambda$ partials, which if they're just taken directly seem to contradict each other...
Conceptually there should be a solution. I'd appreciate some tips on this refresher.
Edit:
Only solution to constraints is discontinuous. Poorly posed. What about... The version where the expected value of X is to be minimized such that X>0 and the second Central moment (variance) is 1? The PDF of that I think hits the same roadblocks I hit above but is a nontrivial computation. Goal to find the PDF $f(x)$ on $x>0$.