I'm trying to solve a calculus of variations-type problem, which requires finding the extrema of: $$\int_0^\infty (1+xy')^2e^y dx, $$ subject to the constraint that $\int_0^\infty e^ydx = 1$. Intuitively, $e^y$ is the probability density function of some random variable defined on the positive real line, and ideally we should have $y(\infty)\to-\infty$ and $y(0)=C\in[-\infty,\infty]$ as boundary values. Let us define $f=(1+\lambda +2xy'+x^2y'^2)e^y$, I attempt to solve the Euler-Lagrange equation: $$ \frac{d}{dx}\frac{\partial f}{\partial y'}-\frac{\partial f}{\partial y} = 0.$$ After some algebra, I arrive at the ODE: $$ e^y(1-\lambda+4xy'+x^2y'^2+2x^2y'')=0$$ The solution of the ODE is (from Mathematica): $$ y=c_2-(1+\sqrt{\lambda})\log(x)+2\log(x^\sqrt{\lambda}+c_1). $$ However, this function simply cannot satisfy the constraint $\int_0^\infty e^ydx = 1$, since this integral is divergent for the solution, even when we allow $\sqrt{\lambda}<0$. I am puzzled by this finding. Does this mean that the problem does not have any extrema? Or is this an ill-posed calculus of variations problem and my solution above is completely meaningless?
Some further thoughts: The maximization problem can be further simplified as follows. Expand the square in the target function and use the constraint: $$\int_0^\infty(1+2xy'+x^2y'^2)e^ydx=1+\int_0^\infty(2xy'+x^2y'^2)e^ydx$$ Now consider the first term in the parenthesis, substituting $f=e^y$ gives: $$\int_0^\infty2xy'e^ydx=\int_0^\infty 2xf'dx=[2xf]_0^\infty-\int_0^\infty 2fdx=-2,$$ For the time being let us just assume that $\lim_{x\to0} xf \to 0$ and $\lim_{x\to\infty} xf \to 0$ as well, so that the above calculation is valid. So the target function can be reduced to the (somewhat) simpler: $$\int_0^\infty (xy')^2e^y dx.$$ Solving this obviously gives the same Euler-Lagrange equation. I am now convinced that this problem is unbounded. But then what does the solution of the Euler-Lagrange equation tell us?