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?

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)
$$
