How do we apply Ito's lemma to a product of functions In finance an optimal portfolio choice it is common to use some tools of stochastic calculus. Going through a book, I found the following statement,
\begin{equation}
a_t = \int_s N_t(s) P_t(s) ds
\end{equation}
     By Ito's lemma:
\begin{equation}
da_t = \int_s N_t(s) dP_t(s)ds + \int_s dN_t(s) P_t(s)ds + \int_s dN_t(s) dP_t(s)ds
\end{equation}
I have being trying to understand how this follows from Ito's lemma, but I don't see it. 
Thank you 
 A: The product rule for finite differences is $\Delta(fg)=\Delta f g + \Delta g f + \Delta f \Delta g$. In classical calculus, when we send $\Delta t \to 0$, the last term is much smaller than $\Delta t$, so it vanishes in the limit. In stochastic calculus, the lowest order terms in $\Delta X_t$ and $\Delta Y_t$ are on the order of $(\Delta t)^{1/2}$: namely, the stochastic integral terms. Consequently when those two terms multiply, we get a term which is on the order of $\Delta t$, which does not vanish in the limit, and we have to include it. So if 
$$dX_t = a dt + r dW$$
and 
$$dY_t = b dt + s dW$$ 
(for the same Brownian motion $W$), then
$$d(X_t Y_t)=X_t dY_t + Y_t dX_t + dX_t dY_t \\
= X_t (b dt + s dW) + Y_t ( a dt + r dW) + (a dt + r dW)(b dt + s dW) \\
= (a Y_t + b X_t + rs) dt + (r Y_t + s X_t) dW$$
using the informal rules $(dW)^2=dt$ and dropping all terms of order higher than $dt$. (Here $a,b,r,s$ might be functions, it doesn't matter.)
This can be rigorously justified with Ito's lemma: the "extra" term comes from the Hessian of $xy$, which is $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$.
