Asymptotic expansion of ratio function I want to expand the following function:
$$
f(x)=\frac{1}{(1-e^{-x})}
$$
$f(x)$ can be rewritten as 
$$
f(x) \sim \frac{1}{x-x^2/2 + x^3/2/3}
$$
But  I want to express big-oh notation such that
$$
f(x) = \frac{1}{x} + .... +O(x^2)
$$
up to $x^2$ order. 
How to do it?

Around $0$:
$$
f(x) = \frac{1}{x-\frac{x^2}{2}+\frac{x^3}{6}+o(x^3)}
= \frac{1}{x}\frac{1}{1-\frac{x}{2}+\frac{x^2}{6}+o(x^2)}
$$
(Advice: when doing Taylor expansions, avoid the equivalents $\sim$, which are made to capture the first term only. Confusions and mistake may arise very quickly otherwise.)
Now, use the fact that $\frac{x}{2}+\frac{x^2}{6}+o(x^2) \xrightarrow[x\to0]{}0$, and that $$\frac{1}{1+u} = 1-u+u^2 + o(u^2)$$ when $u\to 0$ (your $u$ will be $-\frac{x}{2}+\frac{x^2}{6}+o(x^2)$):
$$\begin{align}
f(x) &= \frac{1}{x}\frac{1}{1-\frac{x}{2}+\frac{x^2}{6}+o(x^2)}
= \frac{1}{x} \left(1+\frac{x}{2}-\frac{x^2}{6}+o(x^2)+\left(\frac{x}{2}+\frac{x^2}{6}+o(x^2)\right)^2\right)\\
&= \frac{1}{x} \left(1+\frac{x}{2}-\frac{x^2}{6}+o(x^2)+\left(\frac{x^2}{4}+o(x^2)\right)\right)
= \frac{1}{x} \left(1+\frac{x}{2}-\frac{x^2}{6}+o(x^2)+\frac{x^2}{4}\right)\\
&= \frac{1}{x} \left(1+\frac{x}{2}+\frac{x^2}{12}+o(x^2)\right)
= \frac{1}{x}+\frac{1}{2}+\frac{x}{12}+o(x)
\end{align}$$
