Let $T > 0$, let $U$ be a nonempty control set, and let $f: \mathbb{R}^n \times U \to \mathbb{R}^n$, $\ell: \mathbb{R}^n \times U \to \mathbb{R}$, and $g: \mathbb{R}^n \to \mathbb{R}$ be given functions. For each $t \in [0,T]$, let $\mathcal{A}[t,T]$ be a class of admissible controls $u: [t,T] \to U$. For each initial pair $(t,x) \in [0,T] \times \mathbb{R}^n$ and each $u \in \mathcal{A}[t,T]$, assume that there is a corresponding state trajectory $x_u: [t,T] \to \mathbb{R}^n$ satisfying
for every $(t,x) \in [0,T) \times \mathbb{R}^n$, and the terminal condition
paragraph
admin
\begin{align*}
W(T,x)=g(x)
\end{align*}
latex_env
admin
for every $x \in \mathbb{R}^n$.
paragraph
admin
Assume that for every initial pair $(t,x) \in [0,T]\times \mathbb{R}^n$ and every $u \in \mathcal{A}[t,T]$, the state equation is well posed and the chain rule applies to the function