# Lagrangian mechanics of continuous systems

I'm thinking about generalizations of Lagrangian mechanics to systems with infinitely many degrees of freedom, but what I've got uses some extremely sketchy math that still appears to give a correct result. I only consider conservative systems that do not explicitly depend on time.

Of course, if our system is described by finitely many coordinates $q_i$ and a Lagrangian $L = L(\mathbf{q}, \dot{\mathbf{q}})$, then the motion obeys Lagrange's equation
$$\frac{\partial L}{\partial q_i} - \frac{d}{dt} \frac{\partial L}{\partial \dot q_i} = 0,$$
or equivalently,
$$\frac{\partial L}{\partial \mathbf{q}} - \frac{d}{dt} \frac{\partial L}{\partial \dot{\mathbf{q}}} = 0,$$
where $\partial L / \partial \mathbf{q}$ is a directional derivative
$$\frac{\partial L}{\partial \mathbf{q}}(\mathbf{v}) = \left. \frac{d}{d\tau} L(\mathbf{q} + \tau \vect{v}, \dot{\mathbf{q}}) \right\rvert_{\tau = 0},$$
and similarly for $\partial L / \partial \dot{\mathbf{q}}$.

Now say our system is described by some continuous parameter $s$, so we again have $L = L(q, \dot q)$, but this time $q$ is a function of both $s$ and $t$. I make the bold claim that Lagrange's equation still holds in this sense:
$$\frac{\partial L}{\partial q} - \frac{d}{dt} \frac{\partial L}{\partial \dot q} = 0,$$
where the derivatives of the Lagrangian are some functional directional derivative:
$$\frac{\partial L}{\partial q}(f) = \left. \frac{d}{d\tau} L(q + \tau f, \dot q) \right\rvert_{\tau = 0},$$
where $f$ is some function of $s$.

As an example, suppose we have a continuous spring, with an unextended length of 0, confined to the $y$ axis. Its position is described by a function $y(s, t)$, where $s$ ranges from $0$ to $\ell$; the parameter $s$ perhaps represents length along the coil from one end. Its mass and spring constant per unit length are $\mu$ and $\kappa$. I write $y'$ to mean $\partial y / \partial s$. The potential energy and kinetic energy are
$$V = \int_0^\ell \mu g y(s) + \frac12 \kappa \left( \frac{\partial y(s)}{\partial s} \right)^2 \,ds, \quad T = \int_0^\ell \frac12 \mu \dot y(s)^2 \,ds,$$
so the Lagrangian is
$$L = \int_0^\ell \frac12 \mu \dot y(s)^2 - \mu gy(s) - \frac12 \kappa y'(s)^2 \,ds.$$
The directional derivatives with respect to $y$ and $y'$ of the Lagrangian satisfy
$$\frac{\partial L}{\partial y}(f) = \left. \frac{d}{d\tau} \int_0^\ell \frac12 \mu \dot y(s)^2 - \mu g (y(s) + \tau f(s)) - \frac12 \kappa (y'(s) + \tau f'(s))^2 \,ds \right\rvert_{\tau = 0} = -\int_0^\ell \mu g f(s) + \kappa y'(s) f'(s) \,ds$$
$$\frac{\partial L}{\partial \dot y}(f) = \left. \frac{d}{d\tau} \int_0^\ell \frac12 \mu (\dot y(s) + \tau f(s))^2 - \mu gy(s) - \frac12 \kappa y'(s)^2 \right\rvert_{\tau = 0} = \int_0^\ell \mu \dot y(s) f(s) \,ds$$
Thus, Lagrange's equation gives
$$\int_0^\ell \mu g f(s) + \kappa y'(s) f'(s) + \frac{d}{dt} \mu \dot y(s) f(s) \,ds = 0.$$
Integration by parts on the second term and simplifying gives
$$\kappa (y'(\ell) f(\ell) - y'(0) f(0)) - \int_0^\ell \left[ \mu g - \kappa y''(s) + \mu \ddot y(s) \right] f(s) \,ds = 0.$$
I claim that somehow the term on the left disappears. Since this equation must be true for any function $f$, the expression in brackets must be zero; we then get the equation of motion
$$\ddot y(s) = \frac{\kappa}{\mu} y''(s) - g.$$
It seems like a physically reasonable equation; solutions oscillate over time, and if we say fix $y(\ell) = 0$, then in an equilibrium solution $y(s) = (\mu g/2\kappa) (s^2 - \ell^2)$ the tension $\kappa y'(s)$ at any point is equal to the weight $\mu gs$ of the spring below that point.

Has anyone seen anything that looks somewhat like this? I looked around and couldn't really find anything that looked like this.