# Showing a portfolio is a self financing portfolio

I'm having some trouble understanding how you are able to use Ito's lemma to show in the example I've attached it's equal to $d\pi = 2BdB$ because I can't collapse the $dt$ term I've attached the Ito's lemma I'm using and I can't grasp what is the $a(X,t)$ term or $b(X,t)$ term, any help will be much appreciated

• Check your application of the Ito formula to compute $\mathrm{d}B_t^2$ again. You should get $\mathrm{d}B_t^2 = 2 B_t \mathrm{d}B_t + \mathrm{d}t$. Thus the $\mathrm{d}t$ cancels out in the differential of $\Pi_t$. I am voting to close this question for being too basic. – LocalVolatility Jan 5 '18 at 11:39

$$d\Pi_t=d(B^2_t-t)=d(B^2_t)-dt=2B_tdB_t+dt-dt=2B_tdB_t$$
Let $f(B_t, t) = B_t^2 -t=\Pi_t$, then Ito's Lemma tells us that:
$$df = (\frac{\partial f}{\partial t}+\frac{1}{2}\frac{\partial^2f}{\partial x^2})dt + \frac{\partial f}{\partial x}dB_t=(-1+1)dt+2B_tdB_t.$$