# Euler Lagrange

## Euler-Lagrange Equation

$$\frac{\partial F}{\partial y(x)}-\frac{d}{dx}\left(\frac{\partial F}{\partial y'(x)}\right)=0 \label{eq:eulerlagrange}$$
$$I = \int_{x_a}^{x_b} F \left[ y(x), y'(x), x \right] dx$$

Imagine a wrong curve, shown in the dotted red line.

We can call it $$Y(x) = y(x) + \eta(x)$$

Introduce a parameter $\alpha$: $$Y(x) = y(x) + \alpha \eta(x) \label{eq:wrongpathwithparameter}$$

Now show that $$\frac{dI}{d\alpha} = 0 \; \textrm{for} \; \alpha = 0 \label{eq:samestartendpoints}$$

The integral $I(\alpha)$ becomes, when written out: $$I(\alpha) = \int_{x_a}^{x_b} F(Y, Y', x) dx$$ or $$I(\alpha) = \int_{x_a}^{x_b} F(y+\alpha \eta,\; y'+\alpha \eta',\; x)\; dx$$

Now we evaluate $\frac{\partial F}{\partial \alpha}$

Thus, $dI/d\alpha$: $$\frac{\partial I}{\partial \alpha} = \int_{x_a}^{x_b} \frac{\partial F}{\partial \alpha} dx = \int_{x_a}^{x_b} \left( \eta \frac{\partial F}{\partial y} + \eta' \frac{\partial F}{\partial y'} \right)dx= 0$$

Integration by Parts

$$\int_{x_a}^{x_b} \eta' \frac{\partial F}{\partial y'} dx = \left[ \frac{\partial F}{\partial y'} \eta(x)\right]_{x_a}^{x_b} - \int_{x_a}^{x_b} \frac{d}{dx} \left(\frac{\partial F}{\partial y'} \right)\eta(x) dx \label{eq:byparts}$$
$$\frac{\partial F}{\partial y} - \frac{d}{dx} \frac{\partial F}{\partial y'} = 0$$
##### Fundamental Lemma of Calculus of Variations:

if $$\int \eta(x)g(x) dx = 0$$ then it can be shown that $g(x)$ must be zero.

If $I$ is an extremum: $$I = \int_{x_a}^{x_b} F \left[ y(x), y'(x), x \right] dx$$ then $$\frac{\partial F}{\partial y} - \frac{d}{dx} \frac{\partial F}{\partial y'} = 0$$

How will we use this? $$I = \int \left(\frac{1}{2}m v^2 - U \right) dt = \int \left(T - U \right) dt$$ where $$T = \frac{1}{2}mv^2$$ and (for gravity for example) $$U = mgy$$

### The Lagrangian

$$L = T - U$$

$$\frac{\partial L}{\partial x} - \frac{d}{dt} \frac{\partial L}{\partial \dot{x}} = 0$$ leads to: $$\frac{\partial L}{\partial x} = - \frac{\partial U}{\partial x} = F_x$$ and $$\frac{d}{dt}\frac{\partial L}{\partial \dot{x}} = \frac{d}{dt}m \dot{x} = m\ddot{x}$$ so: $$F_x = m\ddot{x}$$

Do it for all three dimensions and you have $$-\nabla U = m \mathbf{a} \Rightarrow \mathbf{F} = m \mathbf{a}$$