Find the value of below integral by deforming the contour.
Question 1. $$\int_{|z| = 2} e^z/z(z-3) \, dz $$
Question 2. $$\int_{|z+1| = 2} z^2/(4-z^2) \, dz $$
I tried to use partial fraction on these problems, but is this a right approach when it means deforming the contour? Would appreciate if you upload the step, as I feel like I am missing few steps.
I'll demonstrate the first problem, and then you can edit your problem to show a similar approach for the second problem.
$\displaystyle \frac{e^z}{z(z-3)}=\frac{1}{3}\left(\frac{e^z}{z-3}-\frac{e^z}{z} \right)$.
This integrand has poles at $z=0$ and $z=3$. However, the contour $|z|=2$ only contains the pole $z=0$; this is important.
We can split the integral as follows: $\displaystyle \frac{1}{3}\int_{|z|=2}\frac{e^z}{z-3}\,dz-\frac{1}{3}\int_{|z|=2}\frac{e^z}{z}\,dz$.
For the first term, since the integrand is continuous all over and inside the loop, the integral is equal to $0$. (The contour can be deformed to a point, and the integral over a point is $0$).
However, for the second term, since there is a pole inside the contour, we must use Cauchy's Theorem -- the integral is equal to $\displaystyle 2\pi i$. (I'm not including that negative sign in front of the whole thing or the coefficient.)
Therefore, the entire integral is just equal to $\displaystyle -\frac{2\pi i}{3}$ .