Find BlackScholes PDE $\frac{\partial C}{\partial t} + rS\frac{\partial C}{\partial S} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 C}{\partial S^2}=rC$ G'day, I have some basic knowledge about Ito Calculus and Brownian Motions. We assume that stock price S follows the GBM: 


*

*1) $()=_t_t+_tS_t_t$
The value of the change in portfolio is given by:


*

*2) $dX_t = rX_tdt + \Delta_t(u - r)S_td_t + \Delta_t \sigma S_tdW_t$
Let C be a call option written on underlying value S.
The differential of $C(t,S_t)$ is given by:


*

*3) $dC(s,S_t) = \frac{\partial C}{\partial t}dt + \frac{\partial C}{\partial S}dS_t + \frac{1}{2}\frac{\partial^2 C}{\partial S^2}(dS_t)^2$ 

*4) $= [\frac{\partial C}{\partial t} + uS_t\frac{\partial C}{\partial S} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 C}{\partial S^2}]dt + \sigma S_t\frac{\partial C}{\partial S}dW_t $
to get eventually the result:


*

*5) $\frac{\partial C}{\partial t} + rS\frac{\partial C}{\partial S} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 C}{\partial S^2}=rC$
I am very much wondering how we get from step 3) to 4) doing the derivation. When I was calculating stochastic equations, my method was to define f(x) = $X^3$, f'(x)= $3x^2$, f''(x) = 6x and then substitute them in Ito's lemma. Can someone use a similar approach?
And with the icing on the cake: how do we eventually get to step 5). 
Any help or tips is very much appreciated!
Linked: How to obtain $\frac{\partial C}{\partial \sigma}$ from Black-Scholes PDE?
 A: You have a self-financing portfolio $X_t=B_t+\Delta_tS_t$ where $B_t$ is your risk-free rate bond.
You want $X_t+C(t,S_t)=0$, in other words, a perfect hedge.
You also have 
$$dX_t+dC(t,S_t)=0$$
By using the self-financing property of $X_t$
$$dX_t=dB_t+\Delta_tdS_t$$
Using Ito's lemma on $C$, we have 
$$dC(t,S_t) = \frac{\partial C}{\partial t}dt + \frac{\partial C}{\partial S}dS_t + \frac{1}{2}\frac{\partial^2 C}{\partial S^2}d<S_t,S_t>$$
with $d<S_t,S_t>=(\sigma_tS_t)^2dt$ 
Using the third equation, we have 
$$dB_t+\Delta_tdS_t+\frac{\partial C}{\partial t}dt + \frac{\partial C}{\partial S}dS_t + \frac{1}{2}\frac{\partial^2 C}{\partial S^2}(\sigma_tS_t)^2dt=0$$
To get rid of the source of randomness $dS_t$, a natural choice is $$\Delta_t=-\frac{\partial C}{\partial S}$$
Therefore,
$$dB_t+\frac{\partial C}{\partial t}dt +   \frac{1}{2}\frac{\partial^2 C}{\partial S^2}(\sigma_tS_t)^2dt=0$$
The bond grows are the risk-free rate $r_t$, hence
$$dB_t=r_tB_tdt$$ 
Thus,
$$r_tB_tdt+\frac{\partial C}{\partial t}dt +   \frac{1}{2}\frac{\partial^2 C}{\partial S^2}(\sigma_tS_t)^2dt=0$$
Using the first two equations and the definition of $\Delta$, we have 
$$B_t=-C(t,S_t)-\Delta_tS_t=-(C(t,S_t)-\frac{\partial C}{\partial S}S_t)$$
Finally you have (removing the dt)
$$-r_tC(t,S_t)+\frac{\partial C}{\partial S}r_tS_t+\frac{\partial C}{\partial t} +   \frac{1}{2}\frac{\partial^2 C}{\partial S^2}(\sigma_tS_t)^2=0$$
A: In order to obtain 4), you plug $_t=_t_t+_tS_t_t$ into 
$$dC(t,S_t) = \frac{\partial C}{\partial t}dt + \frac{\partial C}{\partial S}dS_t + \frac{1}{2}\frac{\partial^2 C}{\partial S^2}(dS_t)^2$$
and use $(_t)^2 = (_tS_t_t)^2=\sigma_t^2S_t^2dt$ to get
$$dC(t,S_t) = \left[\frac{\partial C}{\partial t} + uS_t\frac{\partial C}{\partial S} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 C}{\partial S^2}\right]dt + \sigma S_t\frac{\partial C}{\partial S}dW_t $$
To arrive at 5). You construct the hedged portfolio with $-\frac{\partial C}{\partial t}$ unit of stocks and apply the non-arbitrage argument that any hedged portfolio is equivalent to the risk-free portfolio that grows at risk-free rate $r$, i.e. 
$$dC(t,S_t) - \frac{\partial C}{\partial t}_t = rC(t,S_t) dt$$
which leads to the Black-Scholes PDE,
$$\frac{\partial C}{\partial t} + rS\frac{\partial C}{\partial S} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 C}{\partial S^2}=rC$$
