Consider the following stochastic optimal control problem.
\begin{equation} V(t,x) = \max_{u}\,\, \log \left(\mathbb{E}\left[\int_{0}^{T} u^{2}(t)dt\right]\right) \end{equation}
subject to the dynamic contsraint
\begin{equation} dx(t) = x(t)[(r + u(\mu-r))dt + \sigma u w(t)] \, ; \,\,x(0)=x>0 \end{equation}
where $u$ is the control process to be chosen, $\mu, r, \sigma$ are positive constants and $w$ is a standard Brownian motion. My question is how to write the HJB equation for this problem.
My approach this far
\begin{align} V_t(t,x) + x(r + u(\mu-r))V_{x}(t,x) + \frac{1}{2}\sigma^{2}x^{2}V_{xx} + \log(u^{2}) \end{align} where $V_{t}, V_{x}, V_{xx}$ respresent the partial derivatives of the function $V$ with respect to $t,x$. Is this ok ?