I'm confused as to how each equation implies the next. To get from the first equality to the second we'd need to write $\sin\phi = \cos\phi\sin(\phi-\theta) + \sin\theta\cos(\phi-\theta)$ and I'm not sure if this is an identity or not.
To get to the second equality we must have $$\frac{\sin(\phi-\theta)}{1-2r\cos(\theta-\phi) + r^2}= \frac{\sin\phi}{1-2r\cos\phi + r^2}$$ and similarly $$\frac{\cos(\phi-\theta)}{1-2r\cos(\theta-\phi) + r^2}= \frac{\cos\phi}{1-2r\cos\phi + r^2}$$
but how do we even know if these equalities even hold?
If anything this boils down to a problem of trigonometric identities I think (and my lack of knowledge of what identities are being used)

The first identity is just the addition formula $$ \sin{(a+b)} = \sin{a}\cos{b}+\cos{a}\sin{b} $$ with $a=\theta, b = \phi-\theta$. The second is a rather unhelpfully-labelled substitution, $u=\phi-\theta$, and then relabelling $u$ to $\phi$.