Why an extra term appears

Suppose XtX_t follows

dXt=μtdt+σtdWt,dX_t=\mu_t\,dt+\sigma_t\,dW_t,

and let f(t,Xt)f(t,X_t) be smooth. In ordinary calculus, a first-order expansion would seem sufficient. Brownian motion changes the bookkeeping because dWtdW_t is of order dt\sqrt{dt}, so (dWt)2(dW_t)^2 is of order dtdt and cannot be discarded.

Keep the second order

A second-order Taylor expansion gives

dfftdt+fxdXt+12fxx(dXt)2.df \approx f_t\,dt+f_x\,dX_t+\frac12 f_{xx}(dX_t)^2.

Substituting the dynamics of XtX_t and retaining terms of order dtdt leaves (dXt)2σt2dt(dX_t)^2\approx\sigma_t^2dt. The mixed and higher-order terms vanish in the limit. Therefore,

df=(ft+μtfx+12σt2fxx)dt+σtfxdWt.df= \left(f_t+\mu_t f_x+\frac12\sigma_t^2f_{xx}\right)dt +\sigma_t f_x\,dW_t.

The mental model

The stochastic chain rule is not ordinary calculus with random symbols pasted in. Its extra curvature term records the quadratic variation of Brownian paths. If ff is linear, fxx=0f_{xx}=0 and the familiar first-order rule returns. Curvature is where the difference lives.