research36 min studyLesson 683 in Mathematics

Stochastic Hamilton–Jacobi–Bellman equations

Derive the second-order Bellman equation and solve a finite-horizon quadratic diffusion problem.

On this page

What you’ll understand

  • Derive the controlled generator and the minimizing HJB equation.
  • Track the terminal condition and the sign of backward time.
  • Solve and check a scalar Riccati ansatz including its noise-dependent constant.

The Hamilton–Jacobi–Bellman equation is a local expression of dynamic programming when the value is smooth enough to differentiate. Drift contributes a first derivative, diffusion contributes a second derivative, and current action selection contributes a pointwise infimum. Removing the second derivative would erase the effect of noise even when its mean is zero. A quadratic example shows exactly where that noise enters and why a correct feedback law does not by itself determine the entire value.

The controlled generator comes from Itô’s formula

For a fixed current action a, the diffusion generator acts on a smooth function through its gradient and Hessian. The covariance matrix is σσT\sigma\sigma^{\mathsf T}, and its Hessian trace carries a factor one half. Itô's formula includes a stochastic integral as well. Under the moment and localization conditions needed to take expectations, this stochastic integral contributes no drift, while the quadratic variation remains through the second-order term.

Apply dynamic programming over a short time interval and expand the continuation value. If the value is continuously differentiable in time and twice in space, the leading-order cost balance produces the HJB equation with the terminal cost as its terminal condition. This calculation motivates a classical equation; it does not prove the value has these derivatives. Degenerate diffusion and switching minimizers can destroy smoothness, requiring the viscosity formulation developed later.

Laϕ=b(t,x,a)⋅Dϕ+12tr⁡ ⁣(σσT(t,x,a)D2ϕ).\mathcal L^a\phi=b(t,x,a)\cdot D\phi+\frac12\operatorname{tr}\!\left(\sigma\sigma^{\mathsf T}(t,x,a)D^2\phi\right).
The generator records the drift of a smooth spatial test function under one selected action.↔ Scroll wide equations horizontally.

A minimizing problem evolves backward from its terminal data

With running cost ℓ\ell, the classical equation is Vt+inf⁡a(LaV+ℓ)=0V_t+\inf_a(\mathcal L^aV+\ell)=0. The infimum rather than a supremum matches the convention of minimizing expected cost. Since the terminal condition is prescribed at the end of the horizon, this is a backward equation. Replacing time by remaining horizon changes the sign of the time derivative, which must be done consistently in any Riccati reduction.

For scalar dynamics with drift u, constant diffusion coefficient, and running cost u2/2u^2/2, minimize a quadratic expression in u. When the action set is the whole real line, completing the square gives the feedback u=−Vxu=-V_x. With bounded actions this becomes projection onto the action interval and changes the resulting equation outside the unconstrained region. Thus a formula derived under unconstrained quadratic effort cannot silently be reused for a constrained controller.

Vt+inf⁡a∈A{LaV+ℓ(t,x,a)}=0,V(T,x)=g(x);inf⁡u∈R(uVx+12u2)=−12Vx2.V_t+\inf_{a\in A}\{\mathcal L^aV+\ell(t,x,a)\}=0,\quad V(T,x)=g(x);\qquad \inf_{u\in\mathbb R}\left(uV_x+\frac12u^2\right)=-\frac12V_x^2.
The last identity assumes unconstrained scalar actions and supplies the nonlinear gradient term.↔ Scroll wide equations horizontally.

Quadratic closure separates feedback from noise cost

Let the terminal cost be qx2/2qx^2/2 with positive q, and try V(t,x)=P(t)x2/2+c(t)V(t,x)=P(t)x^2/2+c(t). Matching the coefficients of the square and the constant yields a Riccati equation and a scalar integral. The terminal conditions are P equal to q and c equal to zero. The finite-horizon Riccati solution stays positive and bounded, so the resulting linear feedback gives a well-posed state with finite moments.

Additive noise affects the constant c, while the feedback slope P is unchanged in this fully observed linear-quadratic problem. Omitting c gives the same action but an incorrect expected cost. This particular separation depends on the linear dynamics, quadratic objective, and uncontrolled additive diffusion; it is not a principle for arbitrary nonlinear stochastic control. The solved candidate must still be linked to the value by a verification argument with adequate integrability.

P(t)=q1+q(T−t),c(t)=σ22log⁡ ⁣(1+q(T−t)),P′=P2.P(t)=\frac{q}{1+q(T-t)},\qquad c(t)=\frac{\sigma^2}{2}\log\!\bigl(1+q(T-t)\bigr),\qquad P^{\prime}=P^2.
The scalar constant integrates the diffusion contribution and vanishes at the terminal time.↔ Scroll wide equations horizontally.

Check every term in a scalar quadratic HJB solution

Take horizon one, terminal cost x2/2x^2/2, diffusion coefficient one, drift u, and effort u2/2u^2/2. Calculate the candidate value and feedback at time zero and state one, and check the Riccati and constant equations.

  1. Here q=1q=1 and P(t)=1/(2−t)P(t)=1/(2-t), so P(0)=1/2P(0)=1/2 and the initial feedback is u∗=−1/2u^*=-1/2. Differentiating gives P′=1/(2−t)2=P2P^{\prime}=1/(2-t)^2=P^2, with terminal value one.

  2. The scalar term is c(t)=12log⁡(2−t)c(t)=\tfrac12\log(2-t), whose derivative is −P(t)/2-P(t)/2. In the HJB equation this cancels the diffusion term P/2P/2, while the Riccati identity cancels the coefficient of the state square.

  3. At the requested point, the quadratic contribution is one quarter and the noise contribution is half the natural logarithm of two. The terminal condition is correct because P becomes one and the logarithmic term vanishes at time one.

V(0,1)=14+12log⁡2,u∗(0,1)=−12.V(0,1)=\frac14+\frac12\log2,\qquad u^*(0,1)=-\frac12.
The positive logarithmic term is the additive noise cost, not an extra term in the feedback.↔ Scroll wide equations horizontally.
The result

The candidate value is 1/4+(log 2)/2≈0.596574, with initial optimal feedback candidate −1/2. Verification is needed to identify the candidate with the value.

Explore the model

Interactive lab

Interactive lab · function

Read a quadratic feedback from its derivative

Pause and Reset, then set coefficient a to 0.25 and position x to 1. Predict the displayed slope 0.5, whose negative is the initial feedback in the example. For a fresh comparison, Pause and Reset, then set a to 0.5 and x to 1; the slope is 1, matching the limiting terminal quadratic slope. The lab plots only ax², so it omits the time-dependent additive constant and does not solve the HJB equation. Changing a control retains the clock; use Reset and both settings for each fresh run.

Read a quadratic feedback from its derivativeThis lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Current readings: y at chosen x: 0.608; Tangent slope · 2ax: 1.35; Signed area · ax³/3: 0.182. All parameters are adjustable with the labeled controls below.−2.4−1.201.22.4−9−4.504.59xy(x, ax²)
y = ax²TangentSigned integral
y at chosen x
0.608
Tangent slope · 2ax
1.35
Signed area · ax³/3
0.182
t = 0 s

This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forThe feedback depends on the state derivative, while an additive constant still matters for the value.

Check your understanding

For minimizing effort u²/2 with drift u and unconstrained scalar actions, which HJB term results from optimizing over u?

Try it yourself

Set diffusion to zero, q to three, and terminal time to two in the quadratic model. At time one and state two, compute P, the value, and the feedback. Explain why the logarithmic contribution disappears.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

There is one unit of remaining time. Substitute into the finite-horizon formula, rather than solving a new differential equation.

Compare with the solution

The coefficient is P=3/(1+3)=3/4P=3/(1+3)=3/4. With no diffusion the scalar term is zero, so V=(1/2)(3/4)(22)=3/2V=(1/2)(3/4)(2^2)=3/2. The feedback is u=−Px=−3/2u=-Px=-3/2. The logarithmic contribution is multiplied by the diffusion variance, which is zero in this deterministic specialization.

Take it with you

  • The diffusion generator contains a covariance-weighted Hessian trace.
  • The minimizing HJB uses an infimum and terminal data at the horizon.
  • A noise-dependent additive value term can leave the fully observed LQ feedback unchanged.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.