I'm trying to figure out the following:
Suppose that an $M/M/1$ is at stationarity (arrival rate $\lambda$, service rate $\mu$).
Suppose that $B$ is the next person to arrive in the queue.
What is the distribution of the number of people in the queue when $B$ arrives?
Assuming balance conditions exist ($\mu>\lambda$), just use them
Let $\pi_i$ be the probability of being in state $i$
We have the following system then:
$\pi_1 =\pi_0 (\lambda/\mu) , ..., \pi_i=\pi_0(\lambda/\mu)^i$
Sum of the probabilities of all of the states should be 1
$\sum_{i=0}^\infty \pi_i=\sum_{i=0}^\infty \pi_0(\lambda/\mu)^i = \pi_0 1/(1-(\lambda/\mu))=1$ Then $\pi_0=1-(\lambda/\mu)$
You are interested in expected number of jobs in the system (If you are not convinced please search Poisson Arrivals See Time Averages, PASTA)
Anyway $\sum_{i=0}^\infty i\pi_i=\sum_{i=0}^\infty i\pi_i=\sum_{i=0}^\infty i\pi_0(\lambda / \mu)^i=\pi_0(\lambda / \mu)\sum_{i=0}^\infty i(\lambda / \mu)^{i-1}$ and $\sum_{i=0}^\infty i(\lambda / \mu)^{i-1}$ is the derivative of $\sum_{i=0}^\infty (\lambda / \mu)^{i}$ wrt $(\lambda / \mu)$
From here you can conclude
$\sum_{i=0}^\infty i(\lambda / \mu)^{i-1}=1/(1-(\lambda / \mu))^2$
So expected number of jobs $E=\pi_0(\lambda / \mu)/(1-(\lambda / \mu))^2=(1-(\lambda / \mu))(\lambda / \mu)/(1-(\lambda / \mu))^2=(\lambda / \mu)/(1-(\lambda / \mu))=\lambda/(\mu-\lambda)$