# Taylor Expansion of a Differential

How can the differential of an arbitrary function $f(t,S_t)$, through a second-order Taylor Expansion, become:

$df = \frac{∂f}{∂t}​dt+ \frac{∂f}{∂S_t}​dS_t​ + \frac{1}{2}​\frac{∂²f}{∂S^2_t}(dSt_t)^2$

What are the steps to arrive at this equation? Is the function expanded first and differentiated next? Or are "f,x, and a" of an ordinary TE replaced before expansion?

• $S_t$ is itself a function of $t$? – Bernard Sep 12 at 12:07
• Yes, that is my understanding. – user1603472 Sep 12 at 12:09

First we need a preamble on multivariate calculus. The following formula is due to differential of a bivariate function:$$df={\partial f\over\partial x}dx+{\partial f\over\partial y}dy$$(this can be generalized to multivariate calculus with number of variables more that 2 but we're not about to look for it) and if we substitute $$x=t$$ and $$y=S_t$$ we obtain$${df\over dt}={\partial f\over\partial t}+{\partial f\over\partial S_t}{dS_t\over dt}$$also$${d^2f\over dt^2}={d\over dt}{df\over dt}={\partial^2 f\over \partial t^2}+{\partial^2 f\over \partial t\partial S_t}{dS_t\over dt}+{\partial f\over \partial S_t}{d^2 S_t\over d t^2}$$Now we are able to write the 2nd-order Taylor series around $$0$$:$$f(t,S_t)=f(0,S_0)+\left\{{\partial f\over\partial t}+{\partial f\over\partial S_t}{dS_t\over dt}\right\}_{t=0}\cdot t+{1\over 2}\left\{{\partial^2 f\over \partial t^2}+{\partial^2 f\over \partial t\partial S_t}{dS_t\over dt}+{\partial f\over \partial S_t}{d^2 S_t\over d t^2}\right\}_{t=0}\cdot t^2+O(t^3)$$where $$O(.)$$ denotes Big-O Notation.