2

I am trying to expand following function $f(x)=\frac{e^x}{(1-e^x)^2}$ using the Maclaurin series. According to wolframalpha it should be:

$\frac{1}{x^2}-\frac{1}{12}+\frac{x^2}{240}-\frac{x^4}{6048}+O(x^6)$

However, I am struggling to arrive at this result following a standard formula for Maclaurin expansion:

$f(x) = f(0)+f'(0)x+\frac{f''(0)}{2!}x^2+...$

In our case $\lim(x \to 0)\frac{e^x}{ (1 - e^x)^2 } = \infty$.

0 is a singular point for the $f(x)$ and zero appears in the denominator of every n'th order derivative as well.

So, how can I expand this function?

  • 3
    The answer given by Wolfram in this case is not a Maclaurin series, it is a Laurent series. – Peter Foreman May 05 '19 at 12:22
  • @PeterForeman Thanks, I have missed it. These two answers help to calculate Laurent series for this function: https://math.stackexchange.com/a/1452792/671293 https://math.stackexchange.com/a/1006804/671293 – abendrot May 05 '19 at 13:01

2 Answers2

1

Bernoulli numbers $B_n$ are defined in a way that:

$$\frac{x}{e^x-1}= \sum_{n=0}^{\infty} \frac{B_n x^n}{n!}\tag{1}\label{eq1}$$

Divide \eqref{eq1} by $x$: $$\frac{1}{e^x-1}= \sum_{n=0}^{\infty} \frac{B_n x^{n-1}}{n!}\tag{2}\label{eq2}$$

Calculate the first derivative of both sides of the \eqref{eq2}: $$-\frac{e^x}{(1-e^x)^2}= \sum_{n=0}^{\infty} B_n \frac{(n-1)x^{n-2}}{n!}\tag{3}\label{eq3}$$

Here are first few Bernoulli numbers: $B_0 = 1, B_1 = -\frac{1}{2}, B_2 = \frac{1}{6}, B_3 = 0, B_4 = -\frac{1}{30}, B_5 = 0, B_6 = \frac{1}{42}, B_7=0$

Substitute these in \eqref{eq3}: $$\frac{e^x}{(1-e^x)^2}= -B_0x^{-2}-B_2\frac{1}{2!}x^0-B_4\frac{3}{4!}x^2-B_6\frac{5}{6!}x^4+O(x^6)=\frac{1}{x^2}-\frac{1}{12}+\frac{x^2}{240}-\frac{x^4}{6048}+O(x^6)$$

1

Obtaining an expansion up to $o(x^4)$ requires in fact a much longer expansion.

As you have noticed with WA, we have an $\dfrac 1{x^2}$ leading coefficient this means that in fact we have to account for $x^{-2},x^{-1},x^0,\cdots,x^4$ these are $7$ terms.

Thus we need to expand the denominator up to $o(x^7)$ and the numerator up to $o(x^6)$, which divided by $x^2$ give a max order of $x^4$.

  • Let's start expanding the numerator:

$e^x = 1+x+\frac{x^2}{2}+\frac{x^3}{6}+\frac{x^4}{24}+\frac{x^5}{120}+\frac{x^6}{720}+o(x^6)$

  • And then the denominator :

Reminder : $(1+u)^{-2}=1-2u+3u^2-4u^3+5u^4-6u^5+7u^6+o(u^6)$

$\begin{align}(e^x-1)^{-2}&=\left(x+\frac{x^2}{2}+\frac{x^3}{6}+\frac{x^4}{24}+\frac{x^5}{120}+\frac{x^6}{720}+\frac{x^7}{5040}+o(x^7)\right)^{-2} \\&=x^{-2}\left(1+\frac{x}{2}+\frac{x^2}{6}+\frac{x^3}{24}+\frac{x^4}{120}+\frac{x^5}{720}+\frac{x^6}{5040}+o(x^6)\right)^{-2} \end{align}$

The tedious part start here, calulcating all these power of $u$. Just apply the binomial formula and ignore terms in $o(x^6)$.

$u=\frac{x}{2}+\frac{x^2}{6}+\frac{x^3}{24}+\frac{x^4}{120}+\frac{x^5}{720}+\frac{x^6}{5040}+o(x^6)$

$u^2=\frac{x^2}{4}+\frac{x^3}{6}+\frac{5x^4}{72}+\frac{x^5}{45}+\frac{17x^6}{2880}+o(x^6)$

$u^3=\frac{x^3}{8}+\frac{x^4}{8}+\frac{7x^5}{96}+\frac{137x^6}{4320}+o(x^6)$

$u^4=\frac{x^4}{16}+\frac{x^5}{12}+\frac{x^6}{16}+o(x^6)$

$u^5=\frac{x^5}{32}+\frac{5x^6}{96}+o(x^6)$

$u^6=\frac{x^6}{64}+o(x^6)$

Now you sum them all: $(1+u)^{-2}=1-x+\frac {5x^2}{12}-\frac {x^3}{12}+\frac {x^4}{240}+\frac {x^5}{720}-\frac {x^6}{6048}+o(x^6)$

And that gives you: $(e^x-1)^{-2}=\frac{1}{x^2}-\frac{1}{x}+\frac {5}{12}-\frac {x}{12}+\frac {x^2}{240}+\frac {x^3}{720}-\frac {x^4}{6048}+o(x^4)$

  • Finally you multiply numerator expansion with denominator expansion, ignoring all terms in $o(x^4)$.

$\dfrac{e^x}{(e^x-1)^2}=\frac{1}{x^2}-\frac {1}{12}+\frac {x^2}{240}-\frac {x^4}{6048}+o(x^4)$

Note:

I have detailed the process but not all the calculation. In practice we rarely do such deep expansion manually. It is feasible up to order $4$ or so, but after that, it becomes generally very tedious.

Beyond that, you generally go for theoretical expansion, as shown in the links in comments. Still this is only for $(e^x-1)^{-1}$, it may not be that easy for the square of that, except that in this particular example, it is a proper derivative as shown in Jack D'Aurizio's answer.

zwim
  • 29,833
  • Thanks. Even though not very practical, for educational purposes it is very straight-forward and avoids Bernoulli number "magic". – abendrot May 05 '19 at 15:27