Maximizing expected value with constrained 2nd moment $$\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$.
 A: The problem is impossible as stated with $f \geq 0$. The constraints $\int_0^1 f(x)\, dx = \int_0^1 x^2 f(x)\, dx = 1$ may be combined as $\int_0^1 (1-x^2) f(x) = 0$. As $1-x^2$ is nonnegative on $[0, 1]$ and positive except at $1$, this constraint is impossible except if $f$ is the Dirac distribution $\delta(x-1)$.
If the restriction $f \geq 0$ is relaxed, there is no maximum. Let $F$ be an antiderivative of $f$ such that $F(0) = 0$, $F(1) = 1$. In this case, integrating by parts gives the maximized quantity as \begin{align*} \int_0^1 x f(x)\, dx &= \left. x F(x)\right|_0^1 - \int_0^1 F(x)\, dx \\ &= 1 - \int_0^1 F(x)\, dx\end{align*} so we have to minimize $\int_0^1 F(x)\, dx$ with the constraints $F(0) = 0$, $F(1) = 1$, and \begin{align*} 1 &= \int_0^1 x^2 f(x)\, dx \\ &= \left.x^2 F(x)\right|_0^1 - 2 \int_0^1 x F(x)\, dx \\
&= 1 - 2 \int_0^1 x F(x)\, dx \\
0 &= \int_0^1 x F(x)\, dx \end{align*}
but we can always decrease $\int_0^1 F(x)$ and preserve $\int_0^1 x F(x)$ by decreasing the values of $F$ near $x=0$ and increasing them a lesser amount near $x = 1$ (construction of an explicit example is left as an exercise to the reader).
