Derivative of exponential integral Take the derivative of $$y_t = e^{-\int_{0}^{t}r_s ds}x_t$$  by chain rule, 
$$dy_t = d(e^{-\int_{0}^{t}r_s ds})x_t + e^{-\int_{0}^{t}r_s ds}dx_t$$
but what should the following equation be? $$d(e^{-\int_{0}^{t}r_s ds})$$
do I take the derivative wrt $x_t$ or $r_t$ ? 
 A: Your first derivative step is using the product rule and not the chain rule. To find $d\left(e^{-\int_0^t r(s) \,ds}\right)$, you will need the chain rule. Recall that if $f(x) = e^{g(x)}$, then $f'(x) = e^{g(x)}\cdot g'(x)$. Thus,
$$\frac{d}{dt}\left(e^{-\int_0^t r(s) \,ds}\right) = e^{-\int_0^t r(s) \,ds} \cdot \frac{d}{dt}\left(-\int_0^t r(s) \,ds\right) = e^{-\int_0^t r(s) \,ds} \cdot (-r(t)) = -r(t) \cdot e^{-\int_0^t r(s) \,ds}$$
That is where @Sammy Black's hint comes into play. Taking the derivative of the integral makes use of the fundamental theorem of calculus. You should look this up if you do not remember the details, as it is a very important concept that should be ingrained.
So given $y(t) = x(t) \cdot e^{-\int_0^t r(s) \,ds}$,
$$\begin{align}
\frac{dy}{dt} &= \frac{dx}{dt}(t) \cdot e^{-\int_0^t r(s) \,ds} + x(t) \cdot \frac{d}{dt} \left( e^{-\int_0^t r(s) \,ds} \right) \\
&= \frac{dx}{dt}(t) \cdot e^{-\int_0^t r(s) \,ds} - x(t)\cdot r(t)\cdot e^{-\int_0^t r(s)}
\end{align}$$
