How do you go from an ODE to a Lagrangian?

729 Views Asked by At

I know that given a Lagrangian, $L(t,x,v)$ you can write the Euler Lagrange equation

$$L_x-\frac{d}{dt}L_v=0, \tag{1}$$

to minimize the functional $$\int_0^TL(t,x,v)dt.\tag{2}$$

I'm interested in the reverse direction - given an ODE say something like

$$y''+f(t)y'+g(t)y+h(t)=0.\tag{3}$$

how can you find $L$?

2

There are 2 best solutions below

0
On BEST ANSWER

Denote $y'=p$ for convenience. If you assume that your Lagrangian is $C^2$ and $L_{pp}\neq 0$, then the EL equations can be equivalently written as: $$y''-\frac{1}{L_{pp}}(L_y+L_{px}+L_{py}y')=0$$ So given your ODE, if there exists a $C^2$ Lagrangian, you can obtain it by (hypothetically) comparing terms: $$-\frac{1}{L_{pp}}(L_y+L_{px}+L_{py}y')=f(x)y'+g(x)y+h(x)$$ The specifics depend on your ODE and Lagrangian, and I guess that generally this should not be an easy equation to solve (again, assuming a solution exists).

1
On

Concerning OP's linear 2nd-order ODE (3): Multiply eq. (3) with the integrating factor $\exp(\int\! f)$ to bring it on Sturm–Liouville/self-adjoint form: $$ (py^{\prime})^{\prime}+ qy +r ~=~0. $$ This has Lagrangian $$L~=~ \frac{p}{2}(y^{\prime})^2-\frac{q}{2} y^2 -ry.$$