Let $S$ follow GBM with $dS=(r-q)S\,dt+\sigma S\,dW$ where $W$ is a standard Brownian motion.
Define $I_t=\int_0^t qe^{r(t-u)}S_u \,du$, then how can I determine $dI_t$? The answer should be $dI_t=(rI_t+qS_t)\,dt$. (Oh and this is not homework, I was just reading some papers on stock loan pricing and ran into this formula, whose proof was not given.)
If I'm correct, then $\frac{\partial I_t}{\partial t}=qS_u e^{r(t-t)}=qS_u.$ I just don't know how to proceed with $\frac{\partial I_t}{\partial S}$ and $\frac{\partial^2 I_t}{\partial S^2}$. Any help is greatly appreciated, thank you!