# Generalization of Ito's Lemma to composite function

Ito's Lemma gives that for a function $$F$$ of a stochastic variable $$X$$, $$dF = \frac{dF}{dX}dX + \frac{1}{2}\frac{d^2F}{dX^2}dt$$

Given a stochastic differential equation $$dS = a(S) dt + b(S) dX$$ and a function $$V(S)$$, the differential equation satisfied by $$V(S)$$ is stated to be $$dV = \frac{dV}{dS}dS + \frac{1}{2}b^2 \frac{d^2V}{dS^2}dt$$. The book says this can be derived properly or the cheating substitution of $$dX^2 = dt$$ could be used.

But I just don't understand how the expression for $$dV$$ is obtained - either properly or by using the Taylor series. While using the Taylor series, how should I expand $$V$$? Should I use the Taylor series for a composite function, as shown, for instance, here? And how might I do it "properly"?

The book is Quantitative Finance of Paul Wilmott, I have made a screenshot of the relevant section.

I make a completely naive attempt by trying to apply Ito's lemma to $$V$$ treating $$S$$ as the random variable (since it is, in effect the function of one).

$$dV = \frac{dV}{dS}dS + \frac{1}{2}\frac{d^2V}{dS^2}dS^2$$

and then substituting the given expression of $$dS$$ in the second term of the RHS. $$dV = \frac{dV}{dS}dS + \frac{1}{2}\frac{d^2V}{dS^2}(a(S) dt + b(S) dX)^2$$

This can directly give the correct expression for $$dV$$ if the $$dt$$ term inside the braces can be made to go to zero. But why would that be? So obviously there's something subtle going on that I am completely missing. Any pointers would be appreciated. Also regarding how to derive it properly. In analysis, you generally consider (on the infinitesimal scale) only first-order variation ($$dt$$, $$dx$$) since continuously differentiable functions have bounded variation on any finite interval, hence zero quadratic variation: " $$\left(dt\right)^2 = 0$$".
However, this is not the case of Brownian motion, which has infinite variation on any finite interval; yet, it has finite quadratic variation, $$d\langle W\rangle_t = dt$$. This is why you have to consider its second-order variation, or quadratic variation (see Quadratic Variation on Wikipedia). You also have $$d\langle t, W_t\rangle \approx \left(dt\right)\left(dW_t\right)$$, which has zero mean and a negligible variance of order $$\left(dt\right)^3$$.
At the end of the day, the only nonnegligible term in the $$\left(dS_t\right)^2$$ term is the $$b\left(S\right)^2 dt$$ term.