[guided]The energy is an integral of a pointwise quadratic expression in $dU_s$, so the first task is to differentiate that quadratic expression. Let $I:=(-\varepsilon,\varepsilon)$, and let $\pi:I\times M\to M$ be the projection defined by $\pi(s,p):=p$. The map $U:I\times M\to N$ pulls the tangent bundle $TN\to N$ back to a vector bundle $U^{-1}TN\to I\times M$. The Levi-Civita connection of $(N,h)$ induces a connection on this pullback bundle; denote it by $\nabla^U$.
Fix $p\in M$. Choose a local $g$-orthonormal frame $e_1,\dots,e_m$ on an open neighbourhood $W\subset M$ of $p$, where $m:=\dim M$. We extend each $e_i$ to $I\times W$ by making it independent of $s$. Define the local energy density as the smooth map $e_U:I\times W\to \mathbb{R}$. For $(s,q)\in I\times W$, set
\begin{align*}
e_U(s,q)=\frac{1}{2}\sum_{i=1}^m h\bigl(dU_{(s,q)}(e_i),dU_{(s,q)}(e_i)\bigr).
\end{align*}
This expression is independent of the chosen local orthonormal frame because it is the trace of the bilinear form $(X,Y)\mapsto h(dU_s(X),dU_s(Y))$ with respect to $g$.
Choose $\delta\in(0,\varepsilon)$. Since $M$ is compact and $U$ is smooth, the function $e_U$ is smooth on $I\times M$, so $\partial_s e_U$ is continuous on the compact set $[-\delta,\delta]\times M$. Therefore $\partial_s e_U$ is bounded on that compact set. This boundedness is the local domination needed for the [differentiation under the integral sign](/page/Differentiation%20Under%20the%20Integral%20Sign) at $s=0$, and hence
\begin{align*}
\frac{d}{ds}\Big|_{s=0}E[U_s]=\int_M \partial_s e_U(0,p)\,d\operatorname{vol}_g(p).
\end{align*}
Now compute $\partial_s e_U$. Metric compatibility of the pullback connection means that for sections $A,B\in\Gamma(U^{-1}TN)$,
\begin{align*}
\partial_s h(A,B)
=
h(\nabla^U_{\partial_s}A,B)+h(A,\nabla^U_{\partial_s}B).
\end{align*}
Apply this with $A=B=dU(e_i)$. The factor $\frac12$ cancels the two equal terms, so
\begin{align*}
\partial_s e_U
=
\sum_{i=1}^m h\bigl(\nabla^U_{\partial_s}(dU(e_i)),dU(e_i)\bigr).
\end{align*}
We next replace $\nabla^U_{\partial_s}(dU(e_i))$ by a derivative of the variation field. This is where the torsion-free property of the [Levi-Civita connection](/page/Levi-Civita%20Connection) on $N$ enters. For vector fields $A,B$ on $I\times M$, the pullback connection satisfies
\begin{align*}
\nabla^U_A(dU(B))-\nabla^U_B(dU(A))
=
dU([A,B]).
\end{align*}
Taking $A=\partial_s$ and $B=e_i$, and using that the lifted frame $e_i$ is independent of $s$, gives $[\partial_s,e_i]=0$. Hence
\begin{align*}
\nabla^U_{\partial_s}(dU(e_i))
=
\nabla^U_{e_i}(dU(\partial_s)).
\end{align*}
At $s=0$, the section $dU(\partial_s)$ restricts to the variation field $V\in\Gamma(u^{-1}TN)$, defined by $V(p):=dU_{(0,p)}(\partial_s)$ for $p\in M$, and $dU(e_i)$ restricts to $du(e_i)$. Therefore
\begin{align*}
\partial_s e_U(0,p)
=
\sum_{i=1}^m h\bigl(\nabla^u_{e_i}V,du(e_i)\bigr),
\end{align*}
where $\nabla^u$ is the pullback connection on $u^{-1}TN$. Substituting this pointwise identity into the differentiated energy gives
\begin{align*}
\frac{d}{ds}\Big|_{s=0}E[U_s]=\int_M \sum_{i=1}^m h\bigl(\nabla^u_{e_i}V,du(e_i)\bigr)\,d\operatorname{vol}_g.
\end{align*}
This formula is the analytic heart of the first variation: the derivative of the energy is the trace pairing between the covariant derivative of the variation field and the differential of $u$.[/guided]