Find the first three Laurent expansion terms of $\frac{1-z}{z^2} e^z$ I've this function $f(z)=\frac{1-z}{z^2} e^z$ and I've to find the first three Laurent expansion terms in $z=0$.
I've proceeded in this way:
First of all I've considered the expansion series of $e^z = \sum_{n=0}\frac{z^n}{n!}$ and I found the first three terms, so $$e^z=1+z+\frac{z^2}{2}+o(z^3)$$
At this point my function would be
$$f(z)=\frac{1}{z^2}(1-z)(1+z+\frac{z^2}{2}+o(z^3))$$
$$f(z)= \frac{1}{z^2}-\frac{1}{2}-\frac{z}{2}+o(z^3)$$
and it seems right, but using Wolfram Alpha, I've discovered that should be
$f(z)=\frac{1}{z^2}-\frac{1}{2}-\frac{z}{3}-\frac{z^2}{8}-\frac{z^3}{30}+o(z^4)$.
As you can see, the third term is different. What I've to do?
 A: Since$$e^z=1+z+\frac{z^2}2+\frac{z^3}6+\cdots,$$you have$$(1-z)e^z=1+z+\frac{z^2}2+\frac{z^3}6+\cdots-\left(z+z^2+\frac{z^3}2+\cdots\right)=1-\frac{z^2}2-\frac{z^3}3+\cdots$$Therefore$$\frac{1-z}{z^2}e^z=\frac1{z^2}-\frac12-\frac z3+\cdots$$indeed.
Concerning your approach, note that the term with $z$ comes from the term with $z^3$ in the expansion of $(1-z)e^z$. But, in order to get it, you have to take into account the term with $z^3$ in the expansion of $e^z$. However, you have stopped at $z^2$.
A: First, you can either write
$$
e^z=1+z+\frac{z^2}{2}+o(z^2)
$$
with “little-oh,” or
$$
e^z=1+z+\frac{z^2}{2}+O(z^3)
$$
with “big-oh.” Let's assume that you meant the latter. Then your calculation gives
$$
 (1-z)e^z = 1+z+\frac{z^2}{2}+O(z^3) - (z+z^2+\frac{z^3}{2}+O(z^4)) \\
 = 1 - \frac{z^2}{2}- \frac{z^3}{2}+O(z^3)+O(z^4) \\
 =  1 - \frac{z^2}{2} + O(z^3) \, .
$$
Note how the $-z^3/2$ is already covered by the $O(z^3)$. At that point, you calculated
$$
(1-z)e^z = 1 - \frac{z^2}{2} - \frac{z^3}{2}+O(z^4) \, ,
$$
which is wrong.
Finally,
$$
f(z)=\frac{1-z}{z^2} e^z =  \frac{1}{z^2}(1 - \frac{z^2}{2} + O(z^3))
=\frac{1}{z^2} - \frac 12 + O(z) 
$$
and that is consistent with
$$
f(z)=\frac{1}{z^2}-\frac{1}{2}-\frac{z}{3}-\frac{z^2}{8}-\frac{z^3}{30}+O(z^4)
$$
from Wolfram Alpha.
In order to get also the $z$ term in $f(z)$ (which is actually the fourth term in the Laurent expansion) you have to start with four terms, i.e. with
$$
e^z=1+z+\frac{z^2}{2}+\frac{z^3}{6}+O(z^4)
$$
A: $$e^z=\sum_{n=0}^{\infty}\frac{z^n}{n!}$$
So:
$$\frac{e^z}{z^2}=\sum_{n=0}^{\infty}\frac{z^{n-2}}{n!}=\sum_{n=-2}^{\infty}\frac{z^n}{(n+2)!}=\frac{1}{z^2}+\sum_{n=-1}^{\infty}\frac{z^n}{(n+2)!}$$
and
$$\frac{e^z}{z}=\sum_{n=0}^{\infty}\frac{z^{n-1}}{n!}=\sum_{n=-1}^{\infty}\frac{z^n}{(n+1)!}$$
Thus, since both converges we can subtract them
$$e^z\frac{1-z}{z^2}=\frac{e^z}{z^2}-\frac{e^z}{z}=\frac{1}{z^2}+\sum_{n=-1}^{\infty}\frac{z^n}{(n+2)!}-\sum_{n=-1}^{\infty}\frac{z^n}{(n+1)!}=\\\frac{1}{z^2}-\sum_{n=-1}^{\infty}\frac{z^n(n+1)}{(n+2)!}=\frac{1}{z^2}-\frac{1}{2}-\frac{z}{3}-\frac{z^2}{8}+O(z^4)$$
