For questions involving the Lagrangian formulation of a dynamical system. Namely, the application of an action principle to a suitably chosen Lagrangian or Lagrangian Density in order to obtain the equations of motion of the system.
When to Use This Tag
lagrangian-formulism is a strict subset of classical-mechanics and should be used when the equations of motion of a system are derived using the variational principle, and this derivation is the core of the question. Use either newtonian-mechanics or any of the other subtags of classical-mechanics if you already arrived at the equations of motion. For the application of the Lagrangian to Quantum Field Theory or General Relativity, use quantum-field-theory or general-relativity correspondingly.
Introduction
Lagrangian mechanics is a method of analyzing classical mechanical systems. The primary mathematical tool used is represented by the Euler-Lagrange equations
$$\frac{\partial L }{\partial q_i} - \frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial L }{\partial \dot{q_i}} = 0 \quad$$
for generalised coordinates $\{q_i, \dot{q_i}\}$, which follow from the variational principle when the action $S = \int_{t_0}^{t_1} L \mathrm dt$ is minimised/stationary.
Each physical system is characterized by a Lagrangian $L$, which in the case of non-relativistic particles can be expressed as the difference between the kinetic $(T)$ and potential $(U)$ energy of the system,
$$L(\underline{q},\underline{\dot{q}},t) = T - U\quad.$$
Plugging the expression for $L$ for a particular system into the Euler-Lagrange equations yields the equations of motion for the system in terms of the generalized coordinates $\{q_i\}$, which can be chosen to fulfill constraints placed on the system (such as a pendulum on a string always having a fixed distance from the origin).
The strength of the Lagrangian approach includes highly symmetric many-body problems where generalized coordinates can be used. An extension of the Lagrangian formalism is Hamiltonian mechanics, whereas Newtonian mechanics follow directly from the variational principle.
The Lagrangian formalism can be generalized to infinite degrees of freedom as continuous media or fields. Then, the important quantity is the Lagrangian density $\mathcal{L}$ defined for every system and taken as a postulate. The action integral now takes the form:
$$ S[\psi]= \int \mathcal{L}\left(\psi_i(s),\frac{\partial\psi_i(s_j)}{\partial s_j}; s_j\right) \mathrm ds_1 \, \mathrm ds_2 \, \mathrm d\cdots \mathrm ds_n $$
where $s_j$ are the $n$ independent parameters (such as time and position) and $\psi_i$ are the field variables. For example, the free electromagnetic field Lagrangian density is the famous $-\frac{1}{4}F^{\mu\nu}F_{\mu\nu}$, and the action integral looks like:
$$ S = \int - \frac{1}{4}F^{\mu\nu}F_{\mu\nu} \, \mathrm d^4x_j = \int_{t_a}^{t_b}\int_{V} \frac{1}{2} (\mathbf{E}^2 - \mathbf{B}^2) \, \mathrm dV \, \mathrm dt, $$
and the Euler-Lagrange of motion are:
$$ \partial_j \left(\frac{\partial \mathcal{L}}{\partial(\partial_j \psi)}\right) - \frac{\partial \mathcal{L}}{\partial \psi} = 0. $$
The Lagrangian density is an important concept in quantum field theory and more advanced subjects.