Solution (source code)

= Solution

For an <Itô process> $dX_t=a_tdt+b_tdW_t$ and $F\in C^{1,2}$, the differential <Itô formula> is
$$
\boxed{dF(t,X_t)=\left(F_t+a_tF_x+\frac12b_t^2F_{xx}\right)dt+b_tF_x\,dW_t,}
$$
where the <derivatives> are evaluated at $(t,X_t)$. A multidimensional version replaces $b_t^2F_{xx}$ by the contraction of the <Itô diffusion> <covariance matrix> with the spatial <Hessian>.

For a heuristic derivation, partition time and use the Euler increment $\Delta X=a\,\Delta t+b\sqrt{\Delta t}\,Z$, where $Z$ is standard normal. A second-order <Taylor expansion> gives
$$
\Delta F=F_t\Delta t+F_x\Delta X+\frac12F_{xx}(\Delta X)^2+\text{higher-order terms}.
$$
The term $b^2(\Delta W)^2$ has order $\Delta t$, so it survives summation; ordinary first-order calculus would incorrectly discard it. For independent <Brownian motion> increments,
$$
\mathbb E\sum_k[(\Delta W_k)^2-\Delta t_k]=0,\qquad
\operatorname{Var}\left(\sum_k[(\Delta W_k)^2-\Delta t_k]\right)
=2\sum_k(\Delta t_k)^2\longrightarrow0.
$$
This gives the <quadratic variation> $[W]_t=t$. The summed mixed $dt\,dW$ terms and $dt^2$ terms vanish, while the linear random increments converge to an <Itô integral>. After localizing bounded coefficients and <derivatives>, Taylor remainders are negligible and the surviving terms give the formula. Thus $(dW)^2=dt$ is shorthand for a statement about summed <quadratic variation>, not an equality of individual random increments.