Suppose we have the following SDE
$$dS(t) = S(t)(\mu(t)dt + \sigma(t)dW(t))=:S(t)dX(t)$$
where $W$ is a Brownian Motion and the processes $\mu,\sigma$ are well defined, such that the expression makes sense. Then I know that
$$S(t)=S(0)\mathcal{E}(X)(t)$$
where $\mathcal{E}$ denotes the stochastic exponential. Additionally we have
$$dB(t) = B(t)r(t)dt$$
hence
$$B(t) = \exp\left(\int_0^tr(s)ds\right)$$
Now I want to compute $d(\frac{S(t)}{B(t)})$ using the product formula:
$$d(U(t)Y(t))=U(t)dY(t)+Y(t)dU(t)+\langle U,Y\rangle (t)$$
here I use $U(t)=S(t)$ and $Y(t)=\frac{1}{B(t)}$. Hence
$$d(\frac{S(t)}{B(t)})=S(t)d\frac{1}{B(t)}+\frac{1}{B(t)}dS(t)+\langle S,\frac{1}{B}\rangle(t)$$
this should be equal
$$\frac{S(t)}{B(t)}(\mu(t)-r(t))dt+\frac{S(t)}{B(t)}\sigma(t)dW(t).$$
How do I get this equality?
First of all, note that $\langle \cdot,\frac1B\rangle = 0$ no matter which process you place instead of $\cdot$. Thus $$ \mathrm d \frac{S}{B} = S\,\mathrm d\frac1B+\frac1B\,\mathrm dS = \frac1B\left(-S\frac{\mathrm d B}{B} + \mathrm dS\right) = \frac SB\left(-r\mathrm dt+\mu\mathrm dt+\sigma\mathrm dw_t\right) $$ as needed.