A linear stochastic differential problem Given $dY(t) = (a_1(t)Y(t)+a_2(t))dt + b_2(t)dW(t)$ 
, $Y(0)=Y_0\in R$
where $a_1,a_2,a_3$ are deterministic, W is a wiener process and $f(t)=$exp$(\int_{0}^{t}a_1(s))ds$
Prove that $d(\frac{Y(t)}{f(t)})$ =$\frac{a_2(t)}{f(t)}$dt + $\frac{b_2(t)}{f(t)}$$dW(t)$ 
My idea is to figure out how $(\frac{a_1(t)Y(t)}{f(t)})$$dt$ = $0$ and I should have the solution.
 A: So stochastics is about doing calculus with functions that are noisy and hence not differentiable, and one of the core things you lose with those sorts of functions is the nice expression for the chain rule. This can be viewed as coming from the "fact" that $dW = \sqrt{ dt}$ in a certain airy-fairy sense and so we have to keep terms that we otherwise wouldn't have, to have everything that is either first order or half-order in $dt$.
Fortunately, we at least have that $d(AB) = A~dB + B~dA + dA~dB$, and we can confirm that if $B$ is not stochastic (it doesn't have any $\sqrt{dt}$ term or any of this noisy behavior; it is just a normal differentiable function) then $dB$ is first-order in $dt$ and $dA$ is at least half-order in $dt$ and so $dA~dB = 0$ to that first order. So the product rule still applies normally, if one of the terms is non-stochastic.
In this case we have a non-stochastic $f$ and stochastic $Y$ with the differential,$$d\left(\frac Yf\right) = \frac1f~dY - \frac{df}{f^2}~Y,$$by this principle. Now given your expression that $\ln f$ is the antiderivative of $a_1(t)$, we have that $df/f = a_1~dt$ directly. 
So it's not that $(a_1~Y/f)~dt = 0$; if you are looking for that you shall never find it. Instead you are looking for a cancellation,$$\left(\frac{a_1~Y}{f} -\frac{a_1~Y}{f}\right) dt = 0~dt = 0.$$
That is the only way that this can possibly work.
