# Euler-Lagrange equation: no fixed endpoints

My aim is to maximize the objective

$J(f) = \int_{0}^{\infty}{ F(f(x),x) p(x) dx}$,

where $p(x)$ is a fixed probability density. However, the endpoints are not fixed since the class of functions I want to maximize over could take any values at $f(0)$ and $f(\infty)$.

Most of the statements of the Euler-Lagrange equation that I have seen require that all functions under consideration are fixed at the endpoints: $f(0) = a$ and $f(\infty) = b$.

I tried to identify the condition for an extremal directly

$J(f + \varepsilon h) - J(f) = \varepsilon\int_{0}^{\infty}{F_{f}(f(x),x)p(x)h(x)dx} + \varepsilon^{2}\int_{0}^{\infty}{R_{f}(x;h) dx}$,

where the remainder term is given by

$R_{f}(x;h) = \int_{0}^{1}{(1-t) dF^{2}(f + th;h)dt}$

and $dF^{2}$ is the second-order Gateaux derivative http://en.wikipedia.org/wiki/G%C3%A2teaux_derivative

Hence,

$\lim_{\varepsilon \rightarrow 0} \frac{1}{\varepsilon} [J(f + \varepsilon h) - J(f)] = \int_{0}^{\infty}{F_{f}(f(x),x)p(x)h(x) dx} + \lim_{\varepsilon \rightarrow 0}\varepsilon\int_{0}^{\infty}{R_{f}(x;h) dx}$

I want to state that a necessary condition for $f(x)$ to be a maximizer of $J(f)$ (among the class of $C^{1}$ functions) is that it solve $F_{f}(f(x),x) = 0$.

But, do I need to state that this is only a necessary condition among the class of functions $f \in \mathcal{F}$ such that

$\int_{0}^{\infty}{R_{f}(x;h) dx} < \infty, \qquad$ with $h \in \mathcal{F}$

-