I want to calculate $$\int_{|z|=2}\frac{1}{z^3+z^2+z+1}$$ where $|z|=2$ is run counterclockwise.
What I did: $$\int_{|z|=2}\frac{1}{z^3+z^2+z+1}=\int_{|z|=2}\frac{1}{(z+1)(z^2+1)} $$ Using Cauchy's integral formula
$$f(-1)=\frac{1}{2\pi i}\int_{|z|=2} \frac{f(z)}{z+1}dz$$
where $f(z)=\frac{1}{z^2+1}$
Therefore $$\int_{|z|=2}\frac{1}{z^3+z^2+z+1}=\pi i$$
However I realized that $f$ is not holomorphic in $1,-i,i$ (the roots of $z^3+z^2+z+1$) and this made me doubt my result. What is the correct answer?
Use partial fractions to write $$\frac{1}{(z+1)(z^2+1)}$$ as a sum of three functions each with a simple pole interior to the circle $|z| = 2$.