[proofplan]
We test the local minimality of $q$ against variations whose initial endpoint is fixed and whose terminal endpoint moves through $M$. Every tangent vector $\eta\in T_{q(b)}M$ is realized by a smooth curve in $M$, and a scalar cutoff transports this terminal motion back along the interval while keeping the initial endpoint fixed. Differentiating the one-parameter family of admissible curves gives the first variation. The Euler-Lagrange equation cancels the interior term after [integration by parts](/theorems/210), leaving only the terminal boundary pairing with $\eta$.
[/proofplan]
[step:Realize an arbitrary terminal tangent vector by an admissible variation]
Fix $\eta\in T_{q(b)}M$. By the definition of the tangent space of a smooth embedded submanifold without boundary, there exist $\varepsilon>0$ and a smooth curve
\begin{align*}
\gamma:(-\varepsilon,\varepsilon)\to M
\end{align*}
such that $\gamma(0)=q(b)$ and $\gamma'(0)=\eta$.
Define the smooth cutoff function
\begin{align*}
\varphi:[a,b]\to\mathbb{R}
\end{align*}
by
\begin{align*}
\varphi(t):=\frac{t-a}{b-a}.
\end{align*}
Then $\varphi(a)=0$ and $\varphi(b)=1$. For $s\in(-\varepsilon,\varepsilon)$, define
\begin{align*}
r_s:[a,b]\to\mathbb{R}^n
\end{align*}
by
\begin{align*}
r_s(t):=q(t)+\varphi(t)(\gamma(s)-q(b)).
\end{align*}
Each $r_s$ is smooth, and
\begin{align*}
r_s(a)=q(a)=q_a,
\end{align*}
while
\begin{align*}
r_s(b)=q(b)+\gamma(s)-q(b)=\gamma(s)\in M.
\end{align*}
Thus $r_s\in\mathcal{A}$ for all $s\in(-\varepsilon,\varepsilon)$.
The associated variational vector field is the smooth map
\begin{align*}
h:[a,b]\to\mathbb{R}^n
\end{align*}
defined by
\begin{align*}
h(t):=\left.\frac{\partial r_s(t)}{\partial s}\right|_{s=0}=\varphi(t)\eta.
\end{align*}
Consequently $h(a)=0$ and $h(b)=\eta$.
[/step]
[step:Differentiate the functional along the admissible variation]
Define
\begin{align*}
J:(-\varepsilon,\varepsilon)\to\mathbb{R}
\end{align*}
by
\begin{align*}
J(s):=I[r_s].
\end{align*}
Since $r_s\to q$ in $C^1([a,b];\mathbb{R}^n)$ as $s\to0$ and $q$ is a $C^1$-local minimizer on $\mathcal{A}$, the function $J$ has a local minimum at $s=0$. Hence $J'(0)=0$.
Because $F$ is $C^2$ and the map $(s,t)\mapsto (t,r_s(t),\dot r_s(t))$ is smooth on the compact set $(-\varepsilon,\varepsilon)\times[a,b]$ after possibly shrinking $\varepsilon$, differentiation under the integral sign gives
\begin{align*}
0=J'(0)=\int_a^b \left(\frac{\partial F}{\partial x}(t,q(t),\dot q(t))\cdot h(t)+\frac{\partial F}{\partial v}(t,q(t),\dot q(t))\cdot \dot h(t)\right)\,d\mathcal{L}^1(t).
\end{align*}
[guided]
The role of the one-parameter family $r_s$ is to convert constrained minimality into a one-variable calculus statement. Define
\begin{align*}
J:(-\varepsilon,\varepsilon)\to\mathbb{R}
\end{align*}
by
\begin{align*}
J(s):=I[r_s].
\end{align*}
For every sufficiently small $s$, the curve $r_s$ belongs to the admissible class $\mathcal{A}$, and $r_s\to q$ in $C^1([a,b];\mathbb{R}^n)$ as $s\to0$. Since $q$ is a local minimizer with respect to this norm, $J$ has a local minimum at $0$. Therefore the ordinary derivative satisfies $J'(0)=0$.
We now compute this derivative. The map
\begin{align*}
(s,t)\mapsto (t,r_s(t),\dot r_s(t))
\end{align*}
is smooth, and $F$ is $C^2$. On a compact subinterval in the $s$-variable around $0$ and on $[a,b]$ in the $t$-variable, the relevant first derivatives of $F$ are continuous and bounded. Hence differentiating under the integral sign is justified. The chain rule gives
\begin{align*}
J'(0)=\int_a^b \left(\frac{\partial F}{\partial x}(t,q(t),\dot q(t))\cdot h(t)+\frac{\partial F}{\partial v}(t,q(t),\dot q(t))\cdot \dot h(t)\right)\,d\mathcal{L}^1(t).
\end{align*}
Combining this formula with $J'(0)=0$ yields the first-variation identity
\begin{align*}
0=\int_a^b \left(\frac{\partial F}{\partial x}(t,q(t),\dot q(t))\cdot h(t)+\frac{\partial F}{\partial v}(t,q(t),\dot q(t))\cdot \dot h(t)\right)\,d\mathcal{L}^1(t).
\end{align*}
[/guided]
[/step]
[step:Integrate by parts and cancel the interior term]
Define the smooth momentum curve
\begin{align*}
p:[a,b]\to\mathbb{R}^n
\end{align*}
by
\begin{align*}
p(t):=\frac{\partial F}{\partial v}(t,q(t),\dot q(t)).
\end{align*}
The first-variation identity becomes
\begin{align*}
0=\int_a^b \frac{\partial F}{\partial x}(t,q(t),\dot q(t))\cdot h(t)\,d\mathcal{L}^1(t)+\int_a^b p(t)\cdot \dot h(t)\,d\mathcal{L}^1(t).
\end{align*}
Applying [integration by parts](/theorems/2098) componentwise to the second integral gives
\begin{align*}
\int_a^b p(t)\cdot \dot h(t)\,d\mathcal{L}^1(t)=p(b)\cdot h(b)-p(a)\cdot h(a)-\int_a^b p'(t)\cdot h(t)\,d\mathcal{L}^1(t).
\end{align*}
Substituting this into the first-variation identity yields
\begin{align*}
0=p(b)\cdot h(b)-p(a)\cdot h(a)+\int_a^b \left(\frac{\partial F}{\partial x}(t,q(t),\dot q(t))-p'(t)\right)\cdot h(t)\,d\mathcal{L}^1(t).
\end{align*}
Since $h(a)=0$ and the Euler-Lagrange equation says
\begin{align*}
p'(t)=\frac{\partial F}{\partial x}(t,q(t),\dot q(t))
\end{align*}
for every $t\in(a,b)$, the integral term vanishes. Therefore
\begin{align*}
0=p(b)\cdot h(b).
\end{align*}
[/step]
[step:Conclude orthogonality to the terminal tangent space]
Using $h(b)=\eta$ and the definition of $p(b)$, the preceding identity gives
\begin{align*}
0=p(b)\cdot\eta=\frac{\partial F}{\partial v}(b,q(b),\dot q(b))\cdot\eta.
\end{align*}
The vector $\eta\in T_{q(b)}M$ was arbitrary. Hence
\begin{align*}
\frac{\partial F}{\partial v}(b,q(b),\dot q(b))\cdot\eta=0
\end{align*}
for every $\eta\in T_{q(b)}M$, which is the claimed transversality condition.
[/step]