Title: Variational Principles

Q: Convex set
A: A set $S\subseteq \R^n$ is \emph{convex} if for any distinct $\mathbf{x}, \mathbf{y}\in S, t\in (0, 1)$, we have $(1 - t)\mathbf{x} + t\mathbf{y} \in S$. Alternatively, any line joining two points in $S$ lies completely within $S$.

Q: Convex function
A: A function $f: \R^n \to \R$ is \emph{convex} if
  \begin{enumerate}
    \item The domain $D(f)$ is convex
    \item The function $f$ lies below (or on) all its chords, ie.
      \[
        f((1 - t)\mathbf{x} + t\mathbf{y}) \leq (1 - t)f(\mathbf{x}) + tf(\mathbf{y})
      \]
      for all $\mathbf{x}, \mathbf{y}\in D(f), t\in (0, 1)$.
  \end{enumerate}
  A function is \emph{strictly convex} if the inequality is strict, ie.
  \[
    f((1 - t)\mathbf{x} + t\mathbf{y}) < (1 - t)f(\mathbf{x}) + tf(\mathbf{y}).
  \]

Q: First-order convexity conditions
A: Define \[
h(t) = (1 - t)f(\mathbf{x}) + tf(\mathbf{y}) - f((1 - t)\mathbf{x} + t f(\mathbf{y}))
\]
such that $h(t)\geq 0$ and $h(0)=0$. Then
\[
  \frac{h(t) - h(0)}{t} \geq 0
\]
for any $t\in (0, 1)$. So $ h'(0) \geq 0$, i.e.
\begin{align*}
   f(\mathbf{y}) &- f(\mathbf{x}) - (\mathbf{y} - \mathbf{x})\cdot \nabla f (\mathbf{x})\geq 0 \\
 f(\mathbf{y}) &\geq f(\mathbf{x}) + (\mathbf{y} - \mathbf{x})\cdot \nabla f(\mathbf{x}).
\end{align*}
This means the function lies above its tangent planes. Adding the symmetric equation gives
\[ (\mathbf{y} - \mathbf{x})\cdot \left[\nabla f(\mathbf{y}) - \nabla f(\mathbf{x}) \right] \geq 0. \]
That is $\nabla f(\mathbf{x})$ is a non-decreasing function.

Q: Second-order convexity condition
A: Start with the first order condition
\[
  (\mathbf{y} - \mathbf{x})\cdot [\nabla f(\mathbf{y}) - \nabla f(\mathbf{x})] \geq 0.
\]
Write $\mathbf{y} = \mathbf{x} + \mathbf{h}$. Then
\begin{align*}
  \mathbf{h} \cdot (\nabla f(\mathbf{x} + \mathbf{h}) - \nabla f(\mathbf{x})) &\geq 0 \\
h_i [h_j \nabla_j \nabla_i f + O(h^2)] &\geq 0 \\
h_i H_{ij}h_j + O(h^3) \geq 0.
\end{align*}
Hence (strict) convexity implies that the Hessian matrix is positive (definite) for all $\mathbf{x}\in D(f)$.
This condition is also sufficient.

Q: Stationary point of a convex function
A: A stationary point of a (strictly) convex function is a (unique) global minimum.
\begin{proof}
Given $\mathbf{x}_0$ such that $\nabla f(\mathbf{x}_0) = \mathbf{0}$, using the first order condition for convexity
  \[
    f(\mathbf{y}) \geq f(\mathbf{x_0}) + (\mathbf{y} - \mathbf{x}_0)\cdot \nabla f(\mathbf{x}_0) = f(\mathbf{x}_0).
  \]
\end{proof}

Q: Legendre transform
A: Given a function $f: \R^n \to \R$, its \emph{Legendre transform} $f^*$ is
  \[
    f^*(\mathbf{p}) = \sup_{\mathbf{x}}(\mathbf{p}\cdot \mathbf{x} - f(\mathbf{x})).
  \]
Geometrically, this is the (negative of) the $y$-intercept of the tangent.

Q: Convexity of Legendre transforms
A: $f^*$ is always convex.
\begin{proof}
  \begin{align*}
    f^*((1 - t)\mathbf{p} + t\mathbf{q}) &= \sup_\mathbf{x} \big[((1 - t)\mathbf{p}\cdot \mathbf{x} + t\mathbf{q}\cdot \mathbf{x} - f(\mathbf{x})\big].\\
    &= \sup_\mathbf{x} \big[(1 - t)(\mathbf{p}\cdot \mathbf{x} - f(\mathbf{x})) + t(\mathbf{q}\cdot \mathbf{x} - f(\mathbf{x}))\big]\\
    &\leq (1 - t)\sup_\mathbf{x} [\mathbf{p}\cdot \mathbf{x} - f(\mathbf{x})] + t\sup_\mathbf{x}[\mathbf{q}\cdot \mathbf{x} - f(\mathbf{x})]\\
    &= (1 - t)f^*(\mathbf{p}) + tf^*(\mathbf{q}).
  \end{align*}
Since this is finite, $(1 - t)\mathbf{p} + t\mathbf{q}$ is also in the domain of $f^*$.
\end{proof}

Q: Legendre transform of the Legendre transform
A: If $f$ is convex, differentiable with Legendre transform $f^*$, then $f^{**} = f$.
\begin{proof}
  We have $f^*(\mathbf{p}) = (\mathbf{p}\cdot\mathbf{x}(\mathbf{p}) - f(\mathbf{x}(\mathbf{p}))$ where $\mathbf{x}(\mathbf{p})$ satisfies $\mathbf{p} = \nabla f(\mathbf{x}(\mathbf{p}))$.
  Differentiating with respect to $\mathbf{p}$, we have
  \begin{align*}
    \nabla_i f^*(\mathbf{p}) &= x_i + p_j \nabla_i x_j (\mathbf{p}) - \nabla_i x_j(\mathbf{p}) \nabla_j f(\mathbf{x})\\
    &= x_i + p_j \nabla_i x_j(\mathbf{p}) - \nabla_i x_j(\mathbf{p}) p_j\\
    &= x_i.
  \end{align*}
  So
  \[
    \nabla f^*(\mathbf{p}) = \mathbf{x}.
  \]
  This means that the conjugate variable of $\mathbf{p}$ is our original $\mathbf{x}$. So
  \begin{align*}
    f^{**}(\mathbf{x}) &= (\mathbf{x} \cdot \mathbf{p} - f^*(\mathbf{p}))|_{\mathbf{p} = \mathbf{p}(\mathbf{x})}\\
    &= \mathbf{x}\cdot \mathbf{p} - (\mathbf{p}\cdot \mathbf{x} - f(\mathbf{x}))\\
    &= f(\mathbf{x}).
  \end{align*}
\end{proof}
If $f^{**} = f$ is true, then $f$ must be convex, since it is a Legendre transform. So $f^{**} = f$ is also sufficient for convexity.

Q: Lagrange multipliers
A: Suppose we want to maximise $f(x,y)$ subject to $g(x,y)=0$. Then we require
\[
\forall \d\vec r: 0 = \d g = \nabla g\cdot \d \vec r \implies  0 = \d f = \nabla f\cdot \d\vec r.
\]
That is, $\forall \d\vec r:   \nabla f\cdot \d\vec r _\perp =0$. So $\nabla f_\perp=0$ (where $\perp$ denotes the component perpendicular to $\nabla g$). Hence
\[
  \nabla f = \lambda \nabla g
\]
for some Lagrange multiplier $\lambda$. So we have to solve
\begin{align*}
  \nabla f &= \lambda \nabla g\\
  g &= 0
\end{align*}
for the three variables $x, y, \lambda$.
Instead we can extremise the Lagrangian
\[
  \mathcal{L} (x, y, \lambda) = f(x, y) - \lambda g(x, y).
\]
When we maximize against the variables $x$ and $y$, we obtain the $\nabla f = \lambda \nabla g$ condition, and maximizing against $\lambda$ gives the condition $g = 0$.
In general, to maximise $f:\R^n\to\R$ subject to $m<n$ constraints $g_k(\vec x)=0$ for $k=1,2\ldots m$ we can maximise the Lagrangian
\[
  \mathcal{L} (\vec{r}, \lambda_1,\ldots \lambda_m) = f(\vec r) - \sum_{k=1}^m \lambda_k g_k(\vec r).
\]
Similarly to maximise $F[x]$ subject to $G[x]=0$ we extremise
\[
  \mathcal{L} (x(t), \lambda) = F[x]-\lambda G[x]
\]
by functional differentiation.
To maximise $\int_\alpha^\beta f(x,\dot{x},t) \ \d t$ subject to $g(x(t))\equiv 0$ we extremise
\[
\mathcal{L} (x(t), \lambda) = \int_\alpha^\beta f(x,\dot{x},t)-\lambda(t)g(x(t)) \d t
\]
where $\lambda(t)$ is the Lagrange multiplier function.

Q: Euler-Lagrange equation
A: Given a function $x(t)$ defined for $\alpha \leq t \leq \beta$, we study functional of the form
\[
  F[x] = \int_\alpha^\beta f(x, \dot{x}, t)\;\d t
\]
for some function $f$.
\begin{align*}
  \delta F[x] &= F[x + \delta x] - F[x]\\
  &= \int_\alpha ^\beta \big(f(x + \delta x, \dot{x} + \delta \dot{x}, t) - f(x, \dot{x}, t)\big)\;\d t \\
  &= \int_\alpha^\beta \left(\delta x\frac{\partial f}{\partial x} + \delta \dot{x} \frac{\partial f}{\partial \dot{x}}\right)\;\d t + o(\delta^2)\\
 &= \int_\alpha^\beta\delta x\left[\frac{\partial f}{\partial x} - \frac{\d}{\d t}\left(\frac{\partial f}{\partial \dot{x}}\right)\right]\;\d t + \left[ \delta x\frac{\partial f}{\partial \dot{x}}\right]_\alpha^\beta \\
&= \int_\alpha ^\beta \left(\delta x \frac{\delta F[x]}{\delta x(t)}\right)\;\d t
\end{align*}
where
  \[
    \frac{\delta F[x]}{\delta x} = \frac{\partial f}{\partial x} - \frac{\d }{\d t}\left(\frac{\partial f}{\partial \dot{x}}\right)
  \]
  is the \emph{functional derivative} of $F[x]$ and $\left[ \delta x\frac{\partial f}{\partial \dot{x}}\right]_\alpha^\beta$ is the boundary term which always vanishes due to boundary conditions (fixed end or free end or mixed).
For a stationary point of $F$ we have the \emph{Euler-Lagrange} equation
  \[
    \frac{\partial f}{\partial x} - \frac{\d}{\d t}\left(\frac{\partial f}{\partial \dot{x}}\right) = 0.
  \]
In general for $F[\mathbf{x}]$ for $\mathbf{x}(t) \in \R^n$:
\[
  \frac{\partial f}{\partial x_i} - \frac{\d }{\d t}\left(\frac{\partial f}{\partial \dot{x}_i}\right) = 0.
\]

Q: First integrals
A: \textbf{Case} $\frac{\partial f}{\partial x} = 0$. The Euler-Lagrange equation becomes
\[
  \frac{\d}{\d t}\left(\frac{\partial f}{\partial \dot{x}}\right) = 0.
\]
We can integrate this to obtain
\[
  \frac{\partial f}{\partial \dot{x}} = \text{constant}.
\]
\textbf{Case} $\frac{\partial f}{\partial t} = 0$. Using the chain rule and Euler-Lagrange equation gives
\begin{align*}
  \frac{\d f}{\d t} &= \frac{\partial f}{\partial t} + \frac{\d x}{\d t}\frac{\partial f}{\partial x} + \frac{\d \dot{x}}{\d t}\frac{\partial f}{\partial \dot{x}} \\
  &= \frac{\partial f}{\partial t} + \dot{x}\frac{\partial f}{\partial x} + \ddot{x} \frac{\partial f}{\partial \dot{x}} \\
 &= \frac{\partial f}{\partial t} + \dot{x} \frac{\d}{\d t}\left(\frac{\partial f}{\partial \dot{x}}\right) + \ddot{x}\frac{\partial f}{\partial \dot{x}}\\
  &= \frac{\partial f}{\partial t} + \frac{\d}{\d t}\left(\dot{x}\frac{\partial f}{\partial \dot{x}}\right).
\end{align*}
Then
\[
  \frac{\d}{\d t}\left(f - \dot{x}\frac{\partial f}{\partial \dot{x}}\right) = \frac{\partial f}{\partial t}=0.
\]
Then we have the first integral
\[
  f - \dot{x}\frac{\partial f}{\partial \dot{x}} = \text{constant}.
\]

Q: Lagrangian mechanics
A: Hamilton's principle states that the path $\xi(t)$ taken by a particle is a stationary point of the action
\[
  S[\xi] = \int L\;\d t
\]
where
\[
  L = T - V
\]
is the \emph{Lagrangian}, with $T$ the kinetic energy and $V$ the potential energy.
For 1 particle in Euclidean 3-space described by Cartesian coordinates
  \[
    T = \frac{1}{2}m|\dot{\mathbf{x}}|^2,\quad V = V(\mathbf{x}, t)
  \]
  and
  \[
    S[\mathbf{x}] = \int_{t_A}^{t_B}\left(\frac{1}{2}m|\dot{\mathbf{x}}|^2 - V(\mathbf{x}, t)\right)\;\d t.
  \]
  Then the Lagrangian is
  \[
    L(\mathbf{x}, \dot{\mathbf{x}}, t) = \frac{1}{2}m|\dot{\mathbf{x}}|^2 - V(\mathbf{x}, t)
  \]
  We apply the Euler-Lagrange equations to obtain
  \[
    0 = \frac{\d}{\d t}\left(\frac{\partial L}{\partial \dot{\mathbf{x}}}\right) - \frac{\partial L}{\partial \mathbf{x}} = m\ddot{\mathbf{x}} + \nabla V.
  \]
  So we have Newton's second law
  \[
    m\ddot{\mathbf{x}} = -\nabla V.
  \]

Q: Hamiltonian mechanics
A: The \emph{Hamiltonian} is the Legendre transform of the Lagrangian wrt the velocity
  \[
    H(\mathbf{x}, \mathbf{p}) = \mathbf{p}\cdot \dot{\mathbf{x}} - L(\mathbf{x}, \dot{\mathbf{x}}),
  \]
  where $\dot{\mathbf{x}}$ is the function of $\mathbf{p}$ given by the solution to $\mathbf{p} = \frac{\partial L}{\partial \dot{\mathbf{x}}}$.
  $\mathbf{p}$ is the \emph{conjugate momentum} of $\mathbf{x}$ and $\mathbf{x}, \mathbf{p}$ are the \emph{phase space} coordinates.
The Lagrangian can then be written as the Legendre transform of the Hamiltonian with respect to $\mathbf{p}$
\[
  L = \mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{x}, \mathbf{p})
\]
with
\[
  \dot{\mathbf{x}} = \frac{\partial H}{\partial \mathbf{p}}.
\]
Hence we can write the action using the Hamiltonian as
\[
  S[\mathbf{x}, \mathbf{p}] = \int (\mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{x}, \mathbf{p}))\;\d t.
\]
This is the \emph{phase-space form} of the action. The Euler-Lagrange equations for these are
\[
  \dot{\mathbf{x}} = \frac{\partial H}{\partial \mathbf{p}}, \quad \dot{\mathbf{p}} = -\frac{\partial H}{\partial \mathbf{x}}
\]
For a single particle in Cartesians the Lagrangian is
\[
  L = \frac{1}{2}m|\dot{\mathbf{x}}|^2 - V(\mathbf{x}, t),
\]
the conjugate momentum is the linear momentum
\[
  \mathbf{p} = \frac{\partial L}{\partial \dot{\mathbf{x}}} = m\dot{\mathbf{x}}
\]
and the Hamiltonian is the total energy in phase space coordinates
\begin{align*}
  H(\mathbf{x}, \mathbf{p}) &= \mathbf{p}\cdot \frac{\mathbf{p}}{m} - \frac{1}{2}m\left(\frac{\mathbf{p}}{m}\right)^2 + V(\mathbf{x}, t)\\
  &= \frac{1}{2m}|\mathbf{p}|^2 + V.
\end{align*}

Q: Symmetry
A: Given
\[
  F[x]= \int_\alpha^\beta f(x, \dot{x}, t)\;\d t,
\]
applying the transformations $t \mapsto t^*(t)$ and $x\mapsto x^*(t^*)$ gives
\[
  F[x] \mapsto F^* [x^*] = \int_{\alpha^*}^{\beta^*} f(x^*, \dot{x}^*, t^*)\;\d t^*
\]
with $\alpha^* = t^*(\alpha)$ and $\beta^* = t^*(\beta)$.
  If $F^*[x^*] = F[x]$ for all $x$, $\alpha$ and $\beta$, then the transformation $*$ is a \emph{symmetry}.

Q: Noether's theorem
A: For every continuous symmetry of $F[x]$, the solutions (ie. the stationary points of $F[x]$) will have a corresponding conserved quantity.
\begin{proof}
Since the symmetry is continuous we may write up to first order
\[
  t \mapsto t,\quad x(t)\mapsto x(t) + \varepsilon h(t),
\]
for some $h(t)$ representing the symmetry transformation.
Since the transformation is a symmetry
\begin{align*}
  \delta F &= \int \big(f(x + \varepsilon h, \dot{x} + \varepsilon \dot{h} + \dot{\varepsilon} h, t) - f(x, \dot{x}, t)\big)\;\d t\\
  &= \int\left(\frac{\partial f}{\partial x}\varepsilon h + \frac{\partial f}{\partial \dot{x}}\varepsilon \dot{h} + \frac{\partial f}{\partial \dot{x}}\dot{\varepsilon} h\right)\;\d t\\
  &= \int \varepsilon\left(\frac{\partial f}{\partial x}h + \frac{\partial f}{\partial \dot{x}}\dot{h}\right)\;\d t + \int \dot{\varepsilon} \left(\frac{\partial f}{\partial \dot{x}}h\right)\;\d t \\
&=0. \\
\intertext{Considering the case of constant $\varepsilon$ we obtain}
0&=\varepsilon \int \left(\frac{\partial f}{\partial x}h + \frac{\partial f}{\partial\dot{x}}\dot{h}\right)\;\d t \\
&= \frac{\partial f}{\partial x}h + \frac{\partial f}{\partial\dot{x}}\dot{h} \\
&= h\frac{\d}{\d t} \frac{\partial f}{\partial \dot x} + \frac{\partial f}{\partial\dot{x}}\dot{h} \\
&=\frac{\d}{\d t}\left(\frac{\partial f}{\partial \dot{x}}h\right)
\end{align*}
using the Euler-Lagrange equation since $x(t)$ is a stationary point of $F[x]$.
Therefore $\frac{\partial f}{\partial \dot{x}}h$ is a conserved quantity where
 \[
  \delta F = \int\dot{\varepsilon}\left(\frac{\partial f}{\partial \dot{x}}h\right)\;\d t.
\]
\end{proof}

Q: Conservation of momentum
A: Consider the phase space action
 \[
    S[\mathbf{x}, \mathbf{p}] = \int \left(\mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{x}, \mathbf{p})\right)\;\d t,
  \]
  where
  \[
    H = \frac{1}{2m} |\mathbf{p}|^2 + V(\mathbf{x}).
  \]
If the potential has space translation invariance, then under $\mathbf{x}\mapsto \mathbf{x} + \boldsymbol\varepsilon$ we have
      \begin{align*}
        \delta S &= \int \Big[\big(\mathbf{p}\cdot (\dot{\mathbf{x}} + \dot{\boldsymbol\varepsilon}) - H(\mathbf{p})\big) - \big(\mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{p})\big)\Big]\;\d t\\
        &= \int \mathbf{p}\cdot \dot{\boldsymbol\varepsilon}\;\d t.
      \end{align*}
      Hence the momentum is a constant of motion.
Alternatively the first integral gives conservation of momentum assuming $\frac{\partial V}{\partial \mathbf{x}}=0$.

Q: Conservation of angular momentum
A: Consider the phase space action
 \[
    S[\mathbf{x}, \mathbf{p}] = \int \left(\mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{x}, \mathbf{p})\right)\;\d t,
  \]
  where
  \[
    H = \frac{1}{2m} |\mathbf{p}|^2 + V(\mathbf{x}).
  \]
If $V$ is rotationally invariant then $H$ is rotationally invariant so for any axis $\boldsymbol\omega$
\vspace{-0.2in}
      \begin{align*}
        \mathbf{x}&\mapsto \mathbf{x} + \varepsilon\boldsymbol\omega\times \mathbf{x}\\
        \mathbf{p}&\mapsto \mathbf{p} + \varepsilon\boldsymbol\omega\times \mathbf{p}
      \end{align*}
leaves the action unchanged to order $\varepsilon$.
Then
      \begin{align*}
        \delta S &= \int \left(\mathbf{p}\cdot \frac{\d}{\d t}\left(\mathbf{x} + \varepsilon\boldsymbol\omega \times \mathbf{x}\right) - \mathbf{p}\cdot \dot{\mathbf{x}}\right)\;\d t\\
        &= \int \left(\mathbf{p}\cdot \frac{\d}{\d t}(\varepsilon\boldsymbol\omega\times \mathbf{x})\right)\;\d t\\
        &= \int \left(\mathbf{p}\cdot \left[\boldsymbol\omega\times \frac{\d}{\d t}(\varepsilon\mathbf{x})\right]\right)\;\d t\\
        &= \int \left(\mathbf{p}\cdot \left[\boldsymbol\omega\times (\dot{\varepsilon} \mathbf{x} + \varepsilon \dot{\mathbf{x}})\right]\right)\;\d t\\
        &= \int \left(\dot{\varepsilon}\mathbf{p}\cdot (\boldsymbol\omega\times \mathbf{x}) + \varepsilon \mathbf{p}\cdot (\boldsymbol\omega \times \dot{\mathbf{x}})\right)\;\d t\\
        &= \int \left(\dot{\varepsilon}\mathbf{p}\cdot (\boldsymbol\omega\times \mathbf{x})\right)\;\d t\\
        &= \int \dot{\varepsilon}\boldsymbol\omega\cdot (\mathbf{x}\times \mathbf{p})\;\d x.
      \end{align*}
      So $\boldsymbol\omega\cdot (\mathbf{x}\times \mathbf{p})$ is a constant of motion. Since this is true for all $\boldsymbol\omega$, the angular momentum $\mathbf{L} = \mathbf{x}\times \mathbf{p}$ is a constant of motion.

Q: Conservation of energy
A: Consider the phase space action
 \[
    S[\mathbf{x}, \mathbf{p}] = \int \left(\mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{x}, \mathbf{p})\right)\;\d t,
  \]
  where
  \[
    H = \frac{1}{2m} |\mathbf{p}|^2 + V(\mathbf{x}).
  \]
If the potential is time independent, then the action is invariant under time translation $t^*= t+\varepsilon$ for any $\varepsilon$. The variation of the action induced by $\vec {x} \mapsto \vec {x} -\varepsilon\dot{\vec {x}}$,$\vec {p} \mapsto \vec {p} -\varepsilon\dot{\vec {p}}$, is
\begin{align*}
\delta S&=\int (\mathbf{p}-\varepsilon\dot{\vec {p}})\cdot \frac{\d}{\d t} (\mathbf{x}-\varepsilon\dot{\vec {x}}) - H(\mathbf{x}-\varepsilon\dot{\vec {x}}, \mathbf{p}-\varepsilon\dot{\vec {p}}) \;\d t \\
&-\int \left(\mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{x}, \mathbf{p})\right)\;\d t \\
&=\int -\varepsilon \dot{\vec {p}} \cdot\vec{\dot {x}} -\vec {p} \cdot \frac{\d}{\d t}(\varepsilon \vec{\dot {x}}) + \varepsilon(\dot{\vec {x}} \cdot\frac{\partial H}{\partial \vec {x}} +\vec{\dot {p}} \cdot \frac{\partial H}{\partial \vec{p}})\;\d t \\
&=\int -\frac{\d}{\d t}(\varepsilon \vec {p}\cdot \vec{\dot {x}}) + \varepsilon \dot{H} \;\d t \\
&=\int -\frac{\d}{\d t}(\varepsilon S) - \dot\varepsilon H \;\d t \\
&=[\varepsilon S] -\int \dot\varepsilon H \;\d t \\
\end{align*}
where the boundary term must be zero and $H$ is a conserved quantity.
Alternatively, if $\frac{\partial V}{\partial t}=0$, then the first integral gives
\[
\mathbf{p}\cdot \dot{\mathbf{x}} - H(\mathbf{x}, \mathbf{p})- \mathbf{p}\cdot \dot{\mathbf{x}}=\textrm{constant}.
\]
So the energy $H(\mathbf{x}, \mathbf{p})$ is a constant of motion.

Q: The second variation
A: Let $\delta x(t) = \varepsilon \xi(t)$ with constant $\varepsilon$ and
\[
  F[x] = \int_\alpha^\beta f(x, \dot{x}, t)\;\d t
\]
with fixed-end boundary conditions, ie. $\xi(\alpha) = \xi(\beta) = 0$.
We consider a variation $x \mapsto x + \delta x$ and expand the integrand to obtain
\begin{align*}
&F[x + \varepsilon \xi] - F[x] \\
  &=\int_\alpha^\beta f(t + \varepsilon \xi, \dot{x} + \varepsilon \dot{\xi}, t) - f(x, \dot{x}, t) \;\d t\\
  &=\int_\alpha^\beta\varepsilon \left(\xi \frac{\partial f}{\partial \dot{x}} + \underbrace{\dot{\xi}}_{\dot{v}}\underbrace{\frac{\partial f}{\partial \dot{x}}}_{u}\right) + \frac{\varepsilon^2}{2}\left(\xi^2 \frac{\partial^2 f}{\partial x^2} + \underbrace{2\xi\dot{\xi}}_{\dot{v}} \underbrace{\frac{\partial^2 f}{\partial x \partial \dot{x}}}_{u} + \dot{\xi}^2 \frac{\partial^2 f}{\partial \dot{x}^2}\right) \;\d t  \\
  &= \int_\alpha^\beta\varepsilon \xi\left[\frac{\partial f}{\partial x} - \frac{\d}{\d t}\left(\frac{\partial f}{\partial \dot{x}}\right)\right] + \frac{\varepsilon^2}{2}\left\{\xi^2\left[\frac{\partial^2 f}{\partial x^2} - \frac{\d}{\d t}\left(\frac{\partial^2 f}{\partial x\partial \dot{x}}\right)\right] + \dot{\xi}^2 \frac{\partial f}{\partial \dot{x}^2}\right\} \;\d t  \\
&=\int_\alpha^\beta\varepsilon\xi\left[ \frac{\partial f}{\partial x} - \frac{\d}{\d t}\left( \frac{\partial f}{\partial \dot{x}} \right) \right]\;\d t  + \frac{\varepsilon^2}{2}\delta^2 F[x, \xi].
\end{align*}
plus some boundary terms which vanish and an error $O(\varepsilon^3)$. Here
\begin{align*}
  \delta^2 F[x, \xi] &= \int_\alpha^\beta \left\{\xi^2 \left[\frac{\partial^2 f}{\partial x^2} - \frac{\d}{\d t}\left(\frac{\partial^2 f}{\partial x \partial \dot{x}}\right)\right] + \dot{\xi}^2 \frac{\partial^2 f}{\partial \dot{x}^2}\right\}\;\d t \\
&= \int_\alpha^\beta \xi^2 \sigma(t) + \dot{\xi}^2\rho(t) \;\d t
\end{align*}
is a functional of both $x(t)$ and $\xi(t)$ known as the second variation.
If $\delta^2 F[x, \xi] > 0$ for all non-zero $\xi$ and all allowed $x$, then any solution $x_0(t)$ of $\frac{\delta F}{\delta x} = 0$ is an absolute minimum.
A necessary condition for $\delta^2 F[x_0, \xi] > 0$ is the Legendre condition $\forall t: \rho(t)\geq 0$. A sufficient condition is $\forall t: \rho(t)> 0,\sigma(t)\geq 0$.

Q: Jacobi condition for local minima of functionals
A: Assume $\rho(t) > 0$ for $\alpha < t < \beta$ (the strong Legendre condition) and boundary conditions.
If we can find a non-zero $u(x)$ satisfying the Jacobi accessory equation
\[
-(\rho \dot{u})' + \sigma u = 0.
\]
then then $\delta^2 F > 0$.
A suitable solution will always exists for sufficiently small $\beta - \alpha$, but may not exist if $\beta - \alpha$ is too large.