(This question is about Exercise 27 on page 55 from these lecture notes.)
We consider a $M/E_r/1$ queue with arrival rate $\lambda$ and mean service time $r/\mu$. We let $P(z):=\sum_{n=0}^{\infty}p_nz^n$ be the generating function of the probabilities $p_n$. We assume that the occupation rate $\rho=\lambda \cdot r/\mu$ is smaller than 1.
From Exercise (i), we know that $$ P(z)(\lambda+\mu) - p_0\mu = P(z)\lambda z^r + (P(z) - p_0)\mu z^{-1}, \tag{$\dagger$} $$ but now we need to show that $P(z)$ is given by $$ P(z) = \frac{(1-\rho)\mu}{\mu-\lambda(z^r+z^{r-1}+\dots+z)}. \tag{$\ddagger$} $$
I rewrited $(\dagger)$, which yields $$ P(z) = \frac{p_0\mu(1-z^{-1})}{\lambda(1-z^r)+\mu(1-z^{-1})}, $$ but from there on, I couldn't find a way to rewrite $P(z)$ in such a way that it resembles $(\ddagger)$.
Also, plugging $(\ddagger)$ into $(\dagger)$ did not yield any results.
Your help is greatly appreciated.
From your last identity giving $P(z)$, for $z\neq1$, you may write $$ \begin{align} P(z) &= \frac{p_0\mu(1-z^{-1})}{\lambda(1-z^r)+\mu(1-z^{-1})}\\\\ &=\frac{p_0\mu}{\mu+\lambda\dfrac{1-z^r\:}{1-z^{-1}}}\\\\ &=\frac{p_0\mu}{\mu-\lambda z\dfrac{1-z^r}{1-z}}\\\\ &=\frac{p_0\mu}{\mu-\lambda z\left(1+z+\ldots+z^{r-1} \right)}\\\\ &=\frac{p_0\mu}{\mu-\lambda \left(z+\ldots+z^{r-1}+z^{r} \right)} \end{align} $$ and since $p_0=1-\rho$, you then obtain the desired result $(\ddagger)$, where we have used the identiy $$ 1+x+\ldots+x^{n-1}=\frac{1-x^{n}}{1-x}, \quad x\neq1,\,n=1,2,\ldots. $$