Complex Closed Loop Integral of a value inside and outside the contour If C is a positvely-oriented simple closed contour, then I need to compute the value of $$g(w) = \int_C \frac{z^3+2z}{(z-w)^n}dz; n=1,2,...$$ for when w is both inside and outside $C$.
I have applied the residue theorem.  There are n poles at z=w, so the residue theorem gives  $$\frac{1}{(n-1)!}\lim_{z \to w} \frac{d^{n-1}}{dz^{n-1}}(z^3+2z)$$  I could go though and solve for n=1,2,3,... but that does not take into account for when w is both inside and outside $C$.
Once n=6, the entire thing seems to go to 0 anyway.  Also, when n=1 the $\frac{1}{(n-1)!}$ term goes to infinity.
 A: When $w$ is outside of $\textrm{int}(C)$, the integrand is holomorphic in $\textrm{int}(C)$ (regardless of what $n$ is), and hence $g(w) = 0$. When $w \in \textrm{int}(C)$, then (as you pointed out) the residue theorem implies that $g(w) = 0$ for $n \geq 5$, and we compute the residues to find the value of $g(w)$ for $n=1,2,3,4$.
A: In my opinion, this integral can be computed using higher-order Cauchy Integral Theorem. 
The definition of higher-order Cauchy integral theorem is as follow: 
Let $f$: $\Omega \rightarrow \mathbb{C}$ be a holomorphic function defined on a simply-connected domain $\Omega$, and $w$ be any point in $\Omega$. Then, for any simple closed curve $\gamma$ enclosing $w$, the n-th order derivative of $f$ at $w$ s equal to:
$f^{(n)}(w) = \frac{n!}{2 \pi i } \oint_{\gamma} \frac{f(z)}{(z-w)^{n+1}} dz$ ,
for n = 0,1,2,3,.....
Shifting the index n in order to make n starts from 1, we get the following:
$f^{(n-1)}(w) = \frac{(n-1)!}{2 \pi i } \oint_{\gamma} \frac{f(z)}{(z-w)^{n}} dz$ ,
for n = 1,2,3,.....
By comparing your question and the higher-order Cauchy Integral theorem,  we can see that $f(z) = g(z) = z^{3} + 2z$. Besides, $g(z) = z^{3} + 2z$ is an entire function, which means it is holomorphic in whole complex plane. Therefore, the $g(w)$ that you want is the $(n-1)$-th derivative of $g(z)$ at $w$.  
