initial value $x_{0}.$ The objective functional $J(v(\cdot))$ can be written as $$J(v(\cdot))=\int_{0}^{T}\int_{\mathbb{R}^{n}}f(x,m_{v(\cdot)}(t),v(x))m_{v(\cdot)}(x,t)dxdt+\int_{\mathbb{R}^{n}}h(x,m_{v(\cdot)}(T))m_{v(\cdot)}(x,T)dx\label{eq:2.2}$$

We next use the traditional invariant embedding approach. Define a family of control problems indexed by initial conditions $(m,t)$: $$\label{eq:2.3}
\left\{
\begin{array}{l}
    \dfrac{\partial m_{v(\cdot)}}{\partial s}+\mathcal{A}^{*}m_{v(\cdot)}+\text{div }(g(x,m_{v(\cdot)},v(x))m_{v(\cdot)}(x))=0,\\
    m_v(x,t)=m(x);
\end{array}
\right.$$ $$J_{m,t}(v(\cdot))=\int_{t}^{T}\int_{\mathbb{R}^{n}}f(x,m_{v(\cdot)}(s),v(x))m_{v(\cdot)}(x,s)dxds+\int_{\mathbb{R}^{n}}h(x,m_{v(\cdot)}(T))m_{v(\cdot)}(x,T)dx,\label{eq:2.4}$$ and we set $$V(m,t)=\inf_{v(\cdot)}J_{m,t}(v(\cdot))\label{eq:2.5}.$$

We can then write the Dynamic Programming equation satisfied by $V(m,t).$ By standard arguments, one obtains [^1] $$\label{eq:2.6}
\left\{
\begin{array}{l}
    \dfrac{\partial V}{\partial t}-\displaystyle\int_{\mathbb{R}^{n}}\dfrac{\partial V(m)}{\partial m}(\xi)\mathcal{A}^{*}m(\xi)d\xi\\
    \qquad+\displaystyle\inf_{v}\left(\displaystyle\int_{\mathbb{R}^{n}}f(\xi,m,v(\xi))m(\xi)d\xi\right.\left.-\displaystyle\int_{\mathbb{R}^{n}}\dfrac{\partial V(m)}{\partial m}(\xi)\text{div }(g(\xi,m,v(\xi))m(\xi))d\xi\right)=0,\\
    V(m,T)=\int_{\mathbb{R}^{n}}h(x,m)m(x)dx.
\end{array}
\right.$$

By setting $$U(x,m,t)=\frac{\partial V(m,t)}{\partial m}(x),$$ we can rewrite (\[eq:2.6\]) as $$\frac{\partial V}{\partial t}-\int_{\mathbb{R}^{n}}\mathcal{A}U(\xi,m,t)m(\xi)d\xi+\int_{\mathbb{R}^{n}}H(\xi,m,DU)m(\xi)d\xi=0\label{eq:2.9}$$ since the optimization in $v$ can be done inside the integral. We next differentiate (\[eq:2.9\]) with respect to $m$ which gives $$\begin{array}{l}
\dfrac{\partial}{\partial m}\bigg[\displaystyle\int_{\mathbb{R}^{n}}H(\xi,m,DU(\xi,m,t))m(\xi)d\xi\bigg](x)=H(x,m,DU(x))\\
\qquad+\displaystyle\int_{\mathbb{R}^{n}}\frac{\partial}{\partial m}H(\xi,m,DU(\xi))(x)m(\xi)d\xi+\int_{\mathbb{R}^{n}}G(\xi,m,DU(\xi))m(\xi)D_{\xi}\frac{\partial}{\partial m}U(\xi,m,t)(x)d\xi.
\end{array}$$

Hence under sufficient continuous differentiability, using $$\label{add_3}
\frac{\partial}{\partial m}U(\xi,m,t)(x)=\frac{\partial}{\partial m}U(x,m,t)(\xi)=\frac{\partial^{2}V(m,t)}{\partial m^{2}}(x,\xi),$$ we obtain the master equation $$\label{eq:2.10}
\left\{
\begin{array}{l}
    -\dfrac{\partial U}{\partial t}+\mathcal{A}U+\displaystyle\int_{\mathbb{R}^{n}}\frac{\partial}{\partial m}U(x,m,t)(\xi)(\mathcal{A}^{*}m(\xi)+\text{div (}G(\xi,m,DU(\xi))m(\xi))d\xi\\
    \qquad=H(x,m,DU(x))+\displaystyle\int_{\mathbb{R}^{n}}\frac{\partial}{\partial m}H(\xi,m,DU(\xi))(x)m(\xi)d\xi,\\
    U(x,m,T)=h(x,m)+\displaystyle\int_{\mathbb{R}^{n}}\frac{\partial}{\partial m}h(\xi,m)(x)m(\xi)d\xi.
\end{array}
\right.$$

The probability density, corresponding to the optimal feedback control, is given by $$\left\{
\begin{array}{l}
    \dfrac{\partial m}{\partial t}+\mathcal{A}^{*}m+\text{div }(G(x,m,DU)m(x))=0,\\
    m(x,0)=m_{0}(x).
\end{array}
\right.$$

Define $u(x,t)=U(x,m(t),t),$ then clearly, from (\[eq:2.10\]) we obtain $$\label{eq:2.12}
\left\{
\begin{split}
    -\dfrac{\partial u}{\partial t}+\mathcal{A}u  &=H(x,m,Du(x))+\displaystyle\int_{\mathbb{R}^{n}}\frac{\partial}{\partial m}H(\xi,m,Du(\xi))(x)m(\xi)d\xi,\\
    u(x,T)&=h(x,m)+\displaystyle\int_{\mathbb{R}^{n}}\frac{\partial}{\partial m}h(\xi,m)(x)m(\xi)d\xi;  
\end{split}
\right.$$ which together with the FP equation

$$\label{eq:2.14}
\left\{
\begin{array}{l}
\dfrac{\partial 