Let $y_0$ be an extremal embedded in a field over a region $D$ with slope function $p(x,y)$. Let $y$ be any competing curve lying in $D$ with the same endpoints as $y_0$. Then
\begin{align*}
J[y] - J[y_0] = \int_a^b \mathcal{E}(x, y(x), y'(x), p(x, y(x)))\,dx.
\end{align*}