Taylor series of $\frac{x}{e^x-e^{-x}}$ My textbook says that (when $x$ approaches $0$):
$$\frac{x}{e^x-e^{-x}}=\frac{1}{2}-\frac{x^2}{12}+\cdots$$
It is also said that the result can be deduced by using $e^x=1+x+x^2/2+\cdots$.
But when I sub it in directly:
$$\begin{aligned}\frac{x}{e^x-e^{-x}}&=\frac{x}{(1+x+x^2/2+x^3/6\cdots)-(1-x+x^2/2-x^3/6+\cdots)}\\&=\frac{x}{2x+x^3/3+\cdots}\end{aligned}$$
I cannot get the right expansion. So what is the right approach?
 A: Another way:
$$\begin{split}\frac{x}{e^x-e^{-x}} &= e^{-x}\frac{x}{1-e^{-2x}} \\ &= e^{-x}\frac{x}{2x-2x^2+4x^3/3+O(x^4)}\\&=e^{-x}\frac{1}{2}\frac{1}{1-(x-2x^2/3+O(x^3))} \\&=\frac12\left(1-x+\frac 12x^2+O(x^3)\right)\left(1+\left(x-\frac23x^2\right)+\left(x-\frac23 x^2\right)^2+O(x^3)\right)\\&=\frac12\left(1-x+\frac 12x^2+O(x^3)\right)\left(1+x+\frac13x^2+O(x^3)\right)\\&=\frac12-\frac1{12}x^2+O(x^3).\end{split}$$ Here, we have used the expansion
$$\frac{1}{1-x}=1+x+x^2+\cdots.$$
A: You were on the right track, you could do
$$\frac{x}{2x+x^3/3+o(x^3)}\\=\frac1{2+x^2/3+o(x^2)}\\=\frac12\frac1{1-(-x^2/6)}+o(x^2)\\=\frac12\sum_{k=0}^\infty \frac{(-x^2)^n}{6^n} + o(x^2) \\= \frac12-\frac{x^2}{12}+o(x^2). $$

A question from the comments on the third line: it follows from the identity
$$\left|\frac{1}{A+h} - \frac{1}A \right|= \frac{|h|}{|A||A+h|} $$
Here, we have $A=2+x^2/3\ge 2$. If $h$ is small, say $|h|<1$, then
$|A+h|\ge |A|-|h|\ge 1$. Thus
$$ \left|\frac{1}{A+h} - \frac{1}A \right|\le |h|\times \frac12\times \frac11.$$
Consequently,
$$ \frac{1}{A+h} = \frac{1}A + O(h). $$
