TITLE: Maclaurin series for $\frac{x}{e^x-1}$
QUESTION [13 upvotes]: Maclaurin series for 
$$\frac{x}{e^x-1}$$
The answer is 
$$1-\frac x2 + \frac {x^2}{12} - \frac {x^4}{720} + \cdots$$
How can i get that answer?

REPLY [6 votes]: This is not a straightforward solution, but I added this to show that we have other ways if we know some properties of the function.
Method 2. Using the Taylor series of the logarithm, we have
\begin{align*}
\frac{x}{e^x - 1}
&= \frac{\log(1+(e^x - 1))}{e^x - 1} \\
&= \sum_{n=0}^{\infty} \frac{(-1)^n}{n+1} (e^x - 1)^n \\
&= \sum_{n=0}^{\infty} \frac{(-1)^n}{n+1} x^n \left( \frac{e^x - 1}{x} \right)^n .
\end{align*}
Since we only want to extract terms up to degree 4, we can focus on the following expansion:
\begin{align*}
\frac{x}{e^x - 1}
&= 1 - \frac{x}{2} \left( 1 + \frac{x}{2} + \frac{x^2}{6} + \frac{x^3}{24} + \cdots \right) + \frac{x^2}{3} \left( 1 + \frac{x}{2} + \frac{x^2}{6} + \cdots \right)^2 \\
&\qquad - \frac{x^3}{4} \left(1 + \frac{x}{2} + \cdots \right)^3 + \frac{x^4}{5} \left(1 + \cdots \right)^4
\end{align*}
Method 3. We decompose the function into the odd part and the even part:
\begin{align*}
\frac{x}{e^x - 1}
&= \color{red}{\frac{1}{2}\left( \frac{x}{e^x - 1} - \frac{(-x)}{e^{-x} - 1} \right) } + \color{blue}{\frac{1}{2}\left( \frac{x}{e^x - 1} + \frac{(-x)}{e^{-x} - 1} \right)} \\
&= \color{red}{-\frac{x}{2}} + \color{blue}{\frac{x}{2} \cdot \frac{e^x + 1}{e^x - 1}} \\
&= \color{red}{-\frac{x}{2}} + \color{blue}{\frac{\cosh (x/2)}{\left(\frac{\sinh(x/2)}{x/2}\right)}}
\end{align*}
Expanding both the numerator and the denominator of the blue-colored term,
$$ \cosh(x/2) = 1 + \frac{x^2}{8} + \frac{x^4}{384} + \cdots, \qquad \frac{\sinh (x/2)}{x/2} = 1 + \frac{x^2}{24} + \frac{x^4}{1920} + \cdots. $$
Thus using the same trick as other answers we find that
$$ \frac{x}{e^x - 1} = -\frac{x}{2} + \left( 1 + \frac{x^2}{8} + \frac{x^4}{384} + \cdots \right)\left[ 1 - \left( \frac{x^2}{24} + \frac{x^4}{1920} + \cdots \right) + \left( \frac{x^2}{24} + \cdots \right)^2 - \cdots \right].  $$
So the burden of calculation reduces greatly.