[proofplan]
Differentiate the energy along the curve on the open interval $(a,b)$. The product rule differentiates the momentum-velocity pairing, while the chain rule differentiates the Lagrangian itself. Because the Lagrangian is autonomous, the chain rule produces only the $\partial_x L$ and $\partial_v L$ terms, with no explicit time derivative. The acceleration terms cancel, and the remaining expression is exactly the Euler-Lagrange equation paired with $\dot q(t)$, so $E'(t)=0$ on $(a,b)$; continuity then extends constancy to the closed interval.
[/proofplan]
[step:Declare the momentum along the curve]
Define the momentum map
\begin{align*}
p: [a,b] \to \mathbb{R}^n, \qquad p(t) = \partial_v L(q(t), \dot q(t)).
\end{align*}
Since $L \in C^2(U \times \mathbb{R}^n)$ and $q \in C^2([a,b];U)$, the map $t \mapsto (q(t),\dot q(t))$ is $C^1$ from $[a,b]$ to $U \times \mathbb{R}^n$, and therefore $p$ is $C^1$ on $[a,b]$. The energy can be written as
\begin{align*}
E(t) = p(t)\cdot \dot q(t) - L(q(t),\dot q(t)).
\end{align*}
Thus $E$ is continuous on $[a,b]$ and differentiable on $(a,b)$.
[/step]
[step:Differentiate the energy and cancel the acceleration terms]
Fix $t \in (a,b)$. Applying the product rule to the scalar function $s \mapsto p(s)\cdot \dot q(s)$ gives
\begin{align*}
\frac{d}{dt}\bigl(p(t)\cdot \dot q(t)\bigr) = \dot p(t)\cdot \dot q(t) + p(t)\cdot \ddot q(t).
\end{align*}
Applying the chain rule to the scalar function $s \mapsto L(q(s),\dot q(s))$ gives
\begin{align*}
\frac{d}{dt}L(q(t),\dot q(t)) = \partial_x L(q(t),\dot q(t))\cdot \dot q(t) + \partial_v L(q(t),\dot q(t))\cdot \ddot q(t).
\end{align*}
Since $p(t)=\partial_v L(q(t),\dot q(t))$, subtracting the second identity from the first yields
\begin{align*}
E'(t) = \bigl(\dot p(t)-\partial_x L(q(t),\dot q(t))\bigr)\cdot \dot q(t).
\end{align*}
[guided]
We differentiate the two parts of the energy separately. First, $p(t)$ and $\dot q(t)$ are both $\mathbb{R}^n$-valued $C^1$ maps, so their Euclidean dot product is differentiable and the product rule gives
\begin{align*}
\frac{d}{dt}\bigl(p(t)\cdot \dot q(t)\bigr) = \dot p(t)\cdot \dot q(t) + p(t)\cdot \ddot q(t).
\end{align*}
Next, the map $t \mapsto (q(t),\dot q(t))$ is a $C^1$ curve in $U \times \mathbb{R}^n$, and $L$ is $C^2$, so the chain rule applies to $t \mapsto L(q(t),\dot q(t))$. Because $L$ is autonomous, its arguments are only the position variable $x \in U$ and the velocity variable $v \in \mathbb{R}^n$; there is no separate time variable. Therefore the chain rule produces exactly
\begin{align*}
\frac{d}{dt}L(q(t),\dot q(t)) = \partial_x L(q(t),\dot q(t))\cdot \dot q(t) + \partial_v L(q(t),\dot q(t))\cdot \ddot q(t).
\end{align*}
Now substitute the definition $p(t)=\partial_v L(q(t),\dot q(t))$. The term $p(t)\cdot \ddot q(t)$ from differentiating $p(t)\cdot \dot q(t)$ is identical to the term $\partial_v L(q(t),\dot q(t))\cdot \ddot q(t)$ from differentiating $L(q(t),\dot q(t))$. Since the energy subtracts the Lagrangian term, these acceleration terms cancel. Hence
\begin{align*}
E'(t) = \bigl(\dot p(t)-\partial_x L(q(t),\dot q(t))\bigr)\cdot \dot q(t).
\end{align*}
[/guided]
[/step]
[step:Use the Euler-Lagrange equation to force the derivative to vanish]
By definition of $p$, the Euler-Lagrange equation along $q$ is
\begin{align*}
\dot p(t)=\partial_x L(q(t),\dot q(t))
\end{align*}
for every $t \in (a,b)$. Substituting this identity into the formula for $E'(t)$ gives
\begin{align*}
E'(t) = 0
\end{align*}
for every $t \in (a,b)$.
[/step]
[step:Extend constancy from the open interval to the closed interval]
For any $s,t \in (a,b)$ with $s<t$, the one-variable mean-value argument applied to $E$ on $[s,t]$ gives $E(t)-E(s)=0$, because $E'=0$ on $(s,t)$. Hence $E$ is constant on $(a,b)$. Since $E$ is continuous on $[a,b]$, taking limits as $s \downarrow a$ and $t \uparrow b$ shows that the same constant value is attained at the endpoints. Therefore $E$ is constant on all of $[a,b]$.
[/step]