I am encountering difficulty in seeing how this relationship holds:
with $S_T$ being stock price at time $T$, I want to find the sde for $S_t e^{-rt}$ $$dS_t = rS_tdt + \sigma S_t d\hat B_t$$
Where $ d\hat B_t$ is brownian motion such that $$X_t = S_t e^{-rt} = X_0 e^{\sigma \hat B_t - \frac{1}{2} \sigma^2 t}$$
So now, If the product rule for SDE's is:
$$d(X_tY_t) = X_tdY_t + Y_tdX_t + dX_tdY_t$$ then, $$d(S_t e^{-rt}) = (S_t)d(e^{-rt}) + e^{-rt}dX_t + d(S_t)d(e^{-rt})$$ correct?
However, my book says the end result is:
$$d(S_t e^{-rt}) = e^{-rt}dS_t - re^{-rt}S_tdt$$ $$ = e^{-rt}(\mu S_tdt + \sigma S_tdB_t - rS_tdt)$$ $$ = \sigma S_t e^{-rt}(\frac{\mu - r}{\sigma}dt + dB_t)$$
How is this achieved, and what have I done wrong?