# Equation Derivation: Help with intermediate steps

As per the attached image above, I don't know how the equation in the first line transformed to the form in second line.

I tried solving it by multiplication but the result was different.

\begin{align}e^{-n/D}\frac{1-e^{(n+1)/D}}{1-e^{1/D}}&=\frac{e^{-n/D}-e^{1/D}}{1-e^{1/D}}\\&=\frac{e^{1/D}}{e^{1/D}}\cdot\frac{e^{-(n+1)/D}-1}{e^{-1/D}-1}\\&=\frac{1-e^{-(n+1)/D}}{1-e^{-1/D}}\end{align}