By the Least Action Principle (also referred to as _Hamilton's Principle_), the path between two points at initial and final times, $t_i$ and $t_f$ are the ones that minimize the path. Thus, to solve for the action, the [variation of the functional](Variation%20of%20a%20functional.md) is set such that $\delta S= 0$ for an [[Action]], $S.$
# Deriving equations of motion from the least action principle
We may use the [Action](Action.md) in order to extract the [equations of motion](Equations%20of%20motion.md) for a given system.
# Formulation of the least action principle for discrete systems
In terms of an action $S[q(t)]$ where $q(t)$ is a [generalized coordinate](Generalized%20coordinates.md).
$\delta S[q(t)]=\int_{t_i}^{t_f} dt\, \delta \mathcal{L}(q(t),\dot{q}(t))=\int_{t_i}^{t_f} dt\, [\mathcal{L}(q(t)+\delta q(t),\dot{q}(t)+\delta\dot{q}(t))-\mathcal{L}(q(t),\dot{q}(t))]$
In addition the boundary condition is that $\delta q(t_i)=\delta q(t_f).$
# Formulation of the least action principle on a continuous field
Here where $\varphi$ represents a [field](Field.md) in [space-time](Spacetime.md). The condition for an action is expressed as
$\delta S[\varphi,\delta \varphi]=S[\varphi + \delta \varphi]-S[\varphi] = \int d^4x[\mathscr{L}(\varphi+\delta\varphi,\dot{\varphi}+\delta\dot{\varphi},\partial_\mu\varphi+\delta\partial_\mu\varphi)-\mathscr{L}(\varphi,\dot{\varphi},\partial_\mu\varphi)] = 0$
Rather than simply having the same boundary condition in time as in the discrete particle system, we also include the boundary condition, $\delta \varphi = 0.$ This is simply because we assume that the field is $0$ at $\infty.$ in order for our model to be [physical](Field.md#Properties%20of%20fields).
#Mechanics