[step:Differentiate the functional and isolate the boundary terms]
Define the auxiliary functions
\begin{align*}
L_y:U\times\mathbb{R}\times\mathbb{R}\to\mathbb{R}
\end{align*}
and
\begin{align*}
L_{y'}:U\times\mathbb{R}\times\mathbb{R}\to\mathbb{R}
\end{align*}
by
\begin{align*}
L_y(x,z,p)=\partial_yL(x,z,p)
\end{align*}
and
\begin{align*}
L_{y'}(x,z,p)=\partial_{y'}L(x,z,p).
\end{align*}
After shrinking $\varepsilon_0>0$ if necessary, the continuity of $\varepsilon\mapsto b_\varepsilon$ and the inequality $a<b_0=b$ ensure that $a<b_\varepsilon$ for all $|\varepsilon|<\varepsilon_0$, so each interval $[a,b_\varepsilon]$ has the intended orientation. The map $(\varepsilon,x)\mapsto L(x,Y_\varepsilon(x),\partial_xY_\varepsilon(x))$ is $C^1$ on a neighbourhood of $\{0\}\times[a,b]$, because $L\in C^2$ and $(\varepsilon,x)\mapsto Y_\varepsilon(x)$ is $C^2$. The one-dimensional Leibniz rule for a $C^1$ integrand with $C^1$ moving upper limit therefore gives
\begin{align*}
I'(0)=\int_{[a,b]}\left(L_y(x,y(x),y'(x))h(x)+L_{y'}(x,y(x),y'(x))h'(x)\right)\,d\mathcal{L}^1(x)+L(b,y(b),y'(b))\delta b.
\end{align*}
Since $L\in C^2$ and $y\in C^2([a,b])$, the function
\begin{align*}
x\mapsto L_{y'}(x,y(x),y'(x))
\end{align*}
is $C^1$ on $[a,b]$. [Integration by parts](/theorems/2098) on $[a,b]$ gives
\begin{align*}
\int_{[a,b]}L_{y'}(x,y(x),y'(x))h'(x)\,d\mathcal{L}^1(x)=L_{y'}(b,y(b),y'(b))h(b)-L_{y'}(a,y(a),y'(a))h(a)-\int_{[a,b]}\frac{d}{dx}L_{y'}(x,y(x),y'(x))h(x)\,d\mathcal{L}^1(x).
\end{align*}
Using $h(a)=0$, this becomes
\begin{align*}
I'(0)=\int_{[a,b]}\left(L_y(x,y(x),y'(x))-\frac{d}{dx}L_{y'}(x,y(x),y'(x))\right)h(x)\,d\mathcal{L}^1(x)+L_{y'}(b,y(b),y'(b))h(b)+L(b,y(b),y'(b))\delta b.
\end{align*}
[/step]