I want to compute $$\oint_{\partial D_3(0)}\frac{\cos(z+4)}{z^2+1}dz$$ without using the residue theorem. My plan was to do a partial fractians decomposition: $$\frac{\cos(z+4)}{z^2+1}=\frac{i}{2}\cos(z+4)\left(\frac{-1}{z-i}+\frac{1}{z+i}\right)$$And then I want to use the Cauchy integral formula: $$\oint_{\partial D_3(0)}\frac{\cos(z+4)}{z^2+1}dz=\frac{i}{2}\oint\frac{-\cos(z+4)}{z-i}dz+\frac{i}{2}\oint\frac{\cos(z+4)}{z+i}dz$$ $$=-\frac{i}{2}\cos(4+i)+\frac{i}{2}\cos(4-i)$$
Is this correct? If not, how do I approach it?
Yes, it is fine, except that you forgot to multiply by $2\pi i$ at the last line. The answer is $\pi\bigl(\cos(4+i)-\cos(4-i)\bigr)$.