Calculate the integrals $\oint_{\left|z\right|=1} (z+z^2)\cos(\sin (1/z)) dz$ and $\oint_{\left|z\right|=1} (z+z^2)\sin(\pi\cos(1/z)) dz $ I don't really know how to approach this, I've tried using $u=1/z$ to get that those integrals are simply  $$\oint_{\left|z\right|=1} (z+z^2)\cos(\sin (1/z)) dz = -\oint_{\left|u\right|=1} (1/u+1/z^2)\cos(\sin (u)) (-du/u^2) = $$
$$= \oint_{\left|u\right|=1} 1/u^3(1+1/u)\cos(\sin (u))du$$
And then use the Residue Theorem to get the integral using that you can get those residues by taking the limits on the poles at 0. But i don't know if this is either rigorous or quicker than some other way. Because for example, for the integral of $1/u^4 \cos(\sin(u))$ i would have to derive cos(sin(u)) three times. What if it were $\oint_{\left|z\right|=1} z^6\cos(\sin (1/z)) dz$? Eight times? That's crazy if so...
Thanks in advance for any ideas or advices.
 A: Using the expansions of $\cos(z)=1-\frac12z^2++O(z^4)$ and $\sin(z)=z-\frac16z^3+O(z^5)$, we can write
$$\begin{align}
\cos(\sin(1/z))&=1-\frac{1}{2}\sin^2(1/z)+O(\sin^4(1/z))\\\\
&=1-\frac12 \left(\frac1z+O\left(\frac1{z^3}\right)\right)^2+O\left(\frac1{z^4}\right)\\\\
&=1-\frac{1}{2z^2}+O\left(\frac{1}{z^4}\right)
\end{align}$$

Therefore, using the residue theorem, the first integral of interest becomes
$$\begin{align}
\oint_{|z|=1}(z+z^2)\cos(\sin(1/z))\,dz&=\oint_{|z|=1}(z+z^2)\left(1-\frac{1}{2z^2}+O\left(\frac{1}{z^4}\right)\right)\,dz\\\\
&=2\pi i \left(-\frac{1}{2}\right)\\\\
&=-\pi i
\end{align}$$

Similarly, we can write
$$\begin{align}
\sin(\pi \cos(1/z))&=\sin(2\pi \sin^2(1/2z))\\\\
&=\frac{\pi}{2z^2}+O\left(\frac{1}{z^4}\right)
\end{align}$$

Therefore, using the reside theorem, the second integral of interest becomes
$$\begin{align}
\oint_{|z|=1}(z+z^2)\sin(\pi \cos(1/z))\,dz&=\oint_{|z|=1}(z+z^2)\left(\frac{\pi}{2z^2}+O\left(\frac{1}{z^4}\right)\right)\,dz\\\\
&=2\pi i \left(\frac{\pi}{2}\right)\\\\
&=\pi^2 i
\end{align}$$
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$


*

*\begin{align}
&\oint_{\verts{z}\ =\ 1}\,\pars{z + z^{2}}\cos\pars{\sin\pars{1 \over z}}\,\dd z
\,\,\,\stackrel{z\ \mapsto\ 1/z}{=}\,\,\,
\oint_{\verts{z}\ =\ 1}\,\pars{{1 \over z} + {1 \over z^{2}}}
\cos\pars{\sin\pars{z}}\,{\dd z \over z^{2}}
\\[5mm] = &\
\oint_{\verts{z}\ =\ 1}{\pars{z + 1}\cos\pars{\sin\pars{z}} \over z^{4}}\,\dd z =
2\pi\ic\,{1 \over 3!}\,\
\underbrace{\lim_{z \to 0}\totald[3]{\bracks{\pars{z + 1}\cos\pars{\sin\pars{z}}}}{z}}_{\ds{-3}} = \bbx{\ds{-\pi\ic}}
\end{align}

*The next one is quite similar to the first one. Namely,
\begin{align}
&\oint_{\verts{z}\ =\ 1}\,\pars{z + z^{2}}
\sin\pars{\pi\cos\pars{1 \over z}}\,\dd z =
2\pi\ic\,{1 \over 3!}\,\
\underbrace{\lim_{z \to 0}\totald[3]{\bracks{\pars{z + 1}\sin\pars{\pi\cos\pars{z}}}}{z}}_{\ds{3\pi}} = \bbx{\ds{\pi^{2}\,\ic}}
\end{align}

