Uncertain how the following step was accomplished. I'm working through a book example that aims to find the first two nonzero terms of the Laurent expansion of $f(z)=\tan(z)$, about $z=\frac{\pi}{2}$.
The substitution $z=\frac{\pi}{2}+u$ is made
$$f(z)=\frac{\sin(\frac{\pi}{2}+u)}{\cos(\frac{\pi}{2}+u)}=-\frac{\cos(u)}{\sin(u)}$$
The respective Taylor series are then utilized
$$f(z)=-\frac{(1-\frac{u^2}{2!}+ \cdots)}{(u-\frac{u^3}{3!}+ \cdots)}=-\frac{1}{u}\frac{(1-\frac{u^2}{2!}+ \cdots)}{(1-\frac{u^2}{3!}+ \cdots)}$$
Now here is where I get lost. The book then states that it is using
$$\frac{1}{1-z}=\sum_{n=0}^{\infty} z^{n} \quad for \quad|z|<1$$
To expand the denominator into the following
$$f(z)=-\frac{1}{u}(1-\frac{u^2}{2!}+ \cdots)(1+\frac{u^2}{3!}+ \cdots)$$
I cannot seem to pick up on the math going on above. Would anyone care to enlighten me?
 A: Here we do a geometric series expansion
\begin{align*}
\frac{1}{1-u}&=\sum_{n=0}^{\infty}u^n\\
&=1+u+u^2+u^3+\cdots \qquad\qquad\qquad\qquad\qquad |u|<1
\end{align*}
If we substitute $h(u)$ for $u$ we obtain
\begin{align*}
\frac{1}{1-h(u)}&=\sum_{n=0}^{\infty}\left(h(u)\right)^n\\
&=1+h(u)+\left(h(u)\right)^2+\left(h(u)\right)^3+\cdots\qquad\qquad |h(u)|<1
\end{align*}

In the series expansion of $f(u)=-\frac{\cos(u)}{\sin(u)}$ we are in a similar situation
\begin{align*}
f(u)&=-\frac{\left(1-\frac{u^2}{2!}+\frac{u^4}{4!}- \cdots\right)}{\left(u-\frac{u^3}{3!}+ \frac{u^5}{5!}-\cdots\right)}\\
&=-\frac{1}{u}\frac{\left(1-\frac{u^2}{2!}+ \frac{u^4}{4!}-\cdots\right)}{\left(1-\frac{u^2}{3!}+  \frac{u^4}{5!}-\cdots\right)}\\
&=-\frac{1}{u}\left(1-\frac{u^2}{2!}+\frac{u^4}{4!}-\cdots\right)\frac{1}{(1-h(u))}
\qquad\text{with}\qquad h(u)=\frac{u^2}{3!}- \frac{u^4}{5!}+\cdots\\
&=-\frac{1}{u}\left(1-\frac{u^2}{2!}+\frac{u^4}{4!}-\cdots\right)\left(1+h(u)+(h(u))^2+\cdots\right)\\
&=-\frac{1}{u}\left(1-\frac{u^2}{2!}+\frac{u^4}{4!}-\cdots\right)\\
&\qquad\cdot\left(1+\underbrace{\left(\frac{u^2}{3!}+  \frac{u^4}{5!}-\cdots\right)}_{h(u)}
+ \underbrace{\left(\frac{u^2}{3!}+  \frac{u^4}{5!}-\cdots\right)^2}_{\left(h(u)\right)^2}+\cdots\right)\\
&=-\frac{1}{u}\left(1-\frac{u^2}{2!}+\cdots\right)\left(1+\frac{u^2}{3!}+ \cdots\right)\\
\end{align*}

A: It's about plugging in a convergent power series into another: If
$$f(u):=a_1u+a_2u^2+a_3u^3+\ldots,\quad g(z):=b_0+b_1z+b_2z^2+\ldots$$
are both convergent in a neighborhood of the origin then $f$ and $g$ are analytic near $0$. Since  $f(0)=0$ the composition $g\circ f$ is analytic near $0$ as well, and can be developed into a Taylor series 
$$g\bigl(f(u)\bigr)=\sum_{l=0}^\infty c_lu^l=b_0+b_1a_1 u+(b_1a_2+b_2a_1^2)u^2+\ldots$$
there. It turns out that the coefficients $c_l$ can be computed recursively from the $a_j$ and the $b_k$ using only finite algebraic computations. This has happened in your example with $f(u):={u^2\over6}-{u^4\over120}+\ldots$ and $g(z):={1\over1-z}$. For the general theory see, e.g.,
Peter Henrici: Applied and computational complex analysis, Vol. I, Ch. 1: Formal poer series. Wiley 1974
