Compute $$\int_{|z|=1}z^ne^z~dz$$ for $n\in \Bbb Z$.
My thought is that we need to consider when $n$ is a negative integer so the singularity is $0$.
Then let $f_1(z)= z^{n+1}e^z.$
$$\int_{|z|=1}\frac{z^{n+1}e^z}{z-0}~dz = 2\pi if_1(0)=0.$$
Is this correct?
When $n\ge0, f\in H(\triangle)$, so the integral is $0$. Am I right about that?
The case when $n$ is non-negative you are correct about, as then the integrand is an entire function.
Suppose now that $n$ is negative, and let $m=-n$. Then the integral we want to evaluate is
$$I=\int_{\lvert z\rvert =1}\frac{e^z}{z^m}~\mathrm{d}z.$$
Now clearly $z\mapsto\frac{e^{z}}{z^m}$ is holomorphic on $\mathbb{C}\setminus\{0\}$, and so by the Residue theorem,
$$I=2\pi i\mathop{\operatorname{Res}}_{z=0}\frac{e^z}{z^m}.$$
But notice that we have the Laurent expansion
$$\frac{e^z}{z^m}=\frac{1}{z^m}\sum_{j=0}^\infty\frac{z^j}{j!}=\sum_{j=-m}^\infty\frac{z^j}{(j+m)!},$$
which means that
$$\mathop{\operatorname{Res}}_{z=0}\frac{e^z}{z^m}=\frac{1}{(m-1)!}.$$
Thus
$$\int_{\lvert z\rvert =1}\frac{e^z}{z^m}~\mathrm{d}z=\frac{2\pi i}{(m-1)!}.$$