I need to minimize the following integral by varying parameter $\lambda$:
$$\int_0^\infty(f(x)-g(x,\lambda))^2dx$$
The functions $f(x)$ and $g(x,\lambda)$ are known and they satisfy $f(0)=g(0,\lambda)$ and $f(\infty)=g(\infty,\lambda)=0$. And the integral is convergent.
What is the corresponding Euler-Lagrange equation?
The "Euler-Lagrange" equation reads
$$ \int\limits_0^{\infty}(f-g)\dfrac{dg}{d\lambda}dx = 0. $$
Knowing $f$ and $g$ you can (hopefully) compute this integral and then solve for $\lambda$.
Notice that if $\exists \lambda_0$ such that $f(x)=g(x,\lambda_0)$ then $\lambda_0$ leads necessarily to a true minimum of your integral, whereas the equation above may be a local one.