## Playing with lagrangian mechanics

The principle of least action states that the path $x(t)$ followed in time $t$ by a physical system subject to conservative forces is such to minimize (or, more generally, make stationary) the action $S=\int_{t_a}^{t_b} \mathcal L (x, \dot x, t) dt$, where the lagrangian $\mathcal L$ is the difference between kinetic and potential energy: $\mathcal L = K - U$, and the path goes through assigned points at the limits of integration: $x(t_a)=x_a, x(t_b)=x_b$.

In the late 18th century, Euler and Lagrange showed how it is possible to obtain the equations of motion, in the form of the so called Euler-Lagrange equations, from the principle of least action, and therefore the path $x(t)$ which obeys these equations.

It turns out that there is also a different way to obtain the path $x(t)$ directly from the principle of least action, without the step of the Euler-Lagrange equations.

I will illustrate this new method with a toy example: a material point of mass $M$ moving in one dimension along $x$ under the effect of gravity in direction $-x$. This means $K=\dfrac{1}{2} M \dot x ^2$ and $U=Mgx$, where $g$ is the acceleration of gravity. Without loss of generality, translate the origin to have $t_a=0$ and $x(t_a) = x_a = 0$.

Let me express $x(t)$ within $[0,t_b]$ as a power series (see my previous post) of $t$: $x(t)=\sum_{i=0}^\infty c_i t^i$. Then

$\dot x=\sum_{i=0}^\infty i c_i t^{i-1}$

$\dot x^2 = (\sum_{i=0}^\infty i c_i t^{i-1})(\sum_{j=0}^\infty j c_j t^{j-1}) = \sum_{p=0}^\infty t^p \sum_{q=1}^{p+1} q (p+2-q) c_q c_{p+2-q}$

The lagrangian can be written as

$\mathcal L = M \sum_{p=0}^\infty t^p \dfrac{1}{2} \sum_{q=1}^{p+1} q (p+2-q) c_q c_{p+2-q} - M g c_p = \sum_{p=0}^\infty l_p t^p$

with

$l_p = \dfrac{1}{2} M \sum_{q=1}^{p+1} q (p+2-q) c_q c_{p+2-q} - M g c_p$

Please note that, even if the potential $U$ was not linear in $x$ but had a more complicated form, nevertheless it would have been easy to express it in terms of the coefficients $c_p$ of $x(t)$ and of the coefficients of $U(x)$.

The action is

$S=\int_0^{t_b} \sum_{p=0}^\infty l_p t^p dt = \sum_{p=0}^\infty l_p \dfrac{t^{p+1}}{p+1}$

and, through the $l_p$s, it is a function of the coefficients $c_p, p=1..\infty$.

The condition at the lower limit of integration, $x(0)=0$, forces $c_0=0$, while the condition at the higher limit of integration, $x(t_b)=x_b$, becomes the equation $\sum_{q=1}^\infty c_q t_b^q = x_b$.

I have at this point a function $S$ of which I want to find a stationary point with respect to the infinitely many variables $c_k \vert k=1..\infty$, subject to the constraint $v = \sum_{q=1}^\infty c_q t_b^q - x_b = 0$. Apart from lagrangian mechanics, there exists another result due to Lagrange, the method of Lagrange multipliers, which could do this work, even if it is normally applied to optimization problems of finite dimensionality; let me try it in this context.

The lagrangian of the optimization problem is $\Lambda = S + \lambda v$, where $\lambda$ is the Lagrange multiplier, and the system of equations giving the optimal values of the $c_k$s is

$v = 0$

$\nabla \Lambda = 0$

that is

$v=0$

$\dfrac{\partial S}{\partial c_k} + \lambda \dfrac{\partial v}{\partial c_k} = 0 \vert k=1..\infty$

Now some work on the partial derivatives is necessary:

$\dfrac{\partial v}{\partial c_k}=t_b^k$

$\dfrac{\partial S}{\partial c_k}=\sum_{p=0}^\infty \dfrac{t_b^{p+1}}{p+1} \dfrac{\partial l_p}{\partial c_k}$

$\dfrac{\partial l_p}{\partial c_k}=M k (p+2-k) c_{p+2-k} - M g \delta_{k p}$ for $k \leq p+1$, with $\delta_{k p}$ the Kronecker delta, and

$\dfrac{\partial l_p}{\partial c_k}=0 \vert k > p+1$; so I can adjust the lower limit of summation in the expression of the derivative of $S$:

$\dfrac{\partial S}{\partial c_k}=\sum_{p=k-1}^\infty \dfrac{t_b^{p+1}}{p+1} \dfrac{\partial l_p}{\partial c_k}$

Summarizing, the system of infinitely many linear equations in the infinitely many unknowns $\lambda, c_1, ..$ can be written as

$eq_0: \sum_{q=1}^\infty t_b^q c_q = x_b$

$eq_k, k \geq 1: \lambda t_b^k + M \sum_{p=k-1}^{\infty} t_b^{p+1} \dfrac{k(p+2-k)}{p+1} c_{p+2-k} =M g \dfrac{t_b^{k+1}}{k+1} \vert k=1..\infty$

or, in full,

$eq_0: x_b= t_b c_1 + t_b^2 c_2 + t_b^3 c_3 + ..$

$eq_1: \dfrac{1}{2} M g t_b^2=\lambda t_b + M t_b c_1 + M t_b^2 c_2 + M t_b^3 c_3 + ..$

$eq_2: \dfrac{1}{3} M g t_b^3=\lambda t_b^2 + M t_b^2 c_1 + \dfrac{4}{3} M t_b^3 c_2 + \dfrac{3}{2} M t_b^4 c_3 + ..$

$eq_3: \dfrac{1}{4} M g t_b^4=\lambda t_b^3 + M t_b^3 c_1 + \dfrac{3}{2} M t_b^4 c_2 + \dfrac{9}{5} M t_b^5 c_3 + ..$

$..$

Subtracting $M$ times $eq_0$ from $eq_1$ one obtains

$\lambda = \dfrac{1}{2} M g t_b - M \dfrac{x_b}{t_b}$

Replacing this value of $\lambda$ in the rest of the system, $eq_0$ and $eq_1$ become identical and, with some manipulation, one is left with

$eq'_1: x_b= t_b c_1 + t_b^2 c_2 + t_b^3 c_3 + ..$

$eq'_2: x_b - \dfrac{1}{6} g t_b^2 = t_b c_1 + \dfrac{4}{3} t_b^2 c_2 + \dfrac{3}{2} t_b^3 c_3 + ..$

$eq'_3: x_b - \dfrac{1}{4} g t_b^2 = t_b c_1 + \dfrac{3}{2} t_b^2 c_2 + \dfrac{9}{5} t_b^3 c_3 + ..$

$eq'_4: x_b - \dfrac{3}{10} g t_b^2 = t_b c_1 + \dfrac{8}{5} t_b^2 c_2 + 2 t_b^3 c_3 + ..$

$..$

or, in general,

$eq'_k: x_b - \dfrac{k-1}{2(k+1)} g t_b^2 = \sum_{p=1}^\infty \dfrac{kp}{k+p-1} t_b^p c_p \vert k \geq 1$

In the conventional way I find the solution of the problem for $x(0)=0$ and $x(t_b)=x_b$ as

$x(t)=-\dfrac{1}{2} g t^2 + (\dfrac{x_b}{t_b} + \dfrac{1}{2} g t_b) t$

and it is immediate to verify that $c_0=0$, $c_1=\dfrac{x_b}{t_b} + \dfrac{1}{2} g t_b$, $c_2=-\dfrac{1}{2} g$, $c_k=0 \vert k \geq 3$ satisfies the infinite system $eq'_k, k \geq 1$

In a real case, one would try assuming that $c_p$s become negligible for $p >$ some $P$, and would solve the partial system $eq'_k$ with $1 \leq k \leq P$ for $c_p$ with $1 \leq p \leq P$; then one would check the closures of some $eq'_k$ with $k>P$.