I am trying to verify a formula that was presented in a paper giving the intensity transmission of a resonator. I need to confirm that the squared modulus of
$$\frac{r-\tau\exp\left(i\varphi\right)}{1-\tau r\exp\left(i\varphi\right)} \tag{1}$$
is equal to
$$\frac{\tau^{2}-2r\tau\cos\varphi+r^{2}}{1+r^{2}\tau^{2}-2r\tau\cos\varphi}. \tag{2}$$
The squared modulus of a complex expression is found by multiplying the expression by its complex conjugate, i.e.,
$$\left|\frac{r-\tau\exp\left(i\varphi\right)}{1-\tau r\exp\left(i\varphi\right)}\right|^{2} = \frac{\left[r-\tau\exp\left(i\varphi\right)\right]}{\left(1-\tau r\exp\left(i\varphi\right)\right)}\frac{\left[\left[1-\tau r\cos\left(\varphi\right)\right]+i\tau r\sin\left(\varphi\right)\right]}{\left[\left[1-\tau r\cos\left(\varphi\right)\right]+i\tau r\sin\left(\varphi\right)\right]}$$
$$=\frac{\left[r-\tau\cos\left(\varphi\right)-i\tau\sin\left(\varphi\right)\right]}{\left(1-\tau r\cos\left(\varphi\right)-i\tau r\sin\left(\varphi\right)\right)}\frac{\left[\left[1-\tau r\cos\left(\varphi\right)\right]+i\tau r\sin\left(\varphi\right)\right]}{\left[\left[1-\tau r\cos\left(\varphi\right)\right]+i\tau r\sin\left(\varphi\right)\right]}.$$
The denominator correctly reduces to "$1+r^{2}\tau^{2}-2r\tau\cos\varphi$". However, I could not obtain the right form for the numerator. After multiplication, the numerator becomes:
$$r-\tau r^{2}\cos\left(\varphi\right)+i\tau r^{2}\sin\left(\varphi\right)...$$ $$-\tau\cos\left(\varphi\right)+\tau^{2}r\cos^{2}\left(\varphi\right)-i\tau^{2}r\sin\left(\varphi\right)\cos\left(\varphi\right)...$$ $$-i\tau\sin\left(\varphi\right)+i\tau^{2}r\sin\left(\varphi\right)\cos\left(\varphi\right)+\tau^{2}r\sin^{2}\left(\varphi\right).$$
After simplification, my final expression is:
$$\frac{r+\tau^{2}r-r^{2}\tau\left[\cos\left(\varphi\right)-i\sin\left(\varphi\right)\right]-\tau\left[\cos\left(\varphi\right)+i\sin\left(\varphi\right)\right]}{1+r^{2}\tau^{2}-2r\tau\cos\varphi}.$$
Is there any way that we can manipulate the numerator further to cast it in the form of Eqn (2)?
Has there been a flaw in my algebra, or has there been a mistake by the authors of the article?
Any suggestions would be greatly appreciated.
With $z:=\exp(i\varphi)$ the square modulus is $$\frac{(r-\tau z)(r-\tau/z)}{(1-\tau rz)(1-\tau r/z)}=\frac{r^2+\tau^2-r\tau(z+1/z)}{1+\tau^2r^2-\tau r(z+1/z)}=\frac{r^2+\tau^2-2r\tau\cos\varphi}{1+\tau^2r^2-2\tau r\cos\varphi}.$$