single valued function in complex plane Let 
$$f(z)=\int_{1}^{z} \left(\frac{1}{w} + \frac{a}{w^3}\right)\cos(w)\,\mathrm{d}w$$
Find $a$ such that $f$ is a single valued function in the complex plane.

$$
\begin{align}
\left(\frac1w+\frac{a}{w^3}\right)\cos(w)
&=\left(\frac1w+\frac{a}{w^3}\right)\left(1-\frac12w^2+O\left(w^4\right)\right)\\
&=\frac{a}{w^3}+\color{#C00000}{\left(1-\frac12a\right)}\frac1w+O(w)
\end{align}
$$
The residue at $0$ is $1-\frac12a$, so setting $a=2$ gives a residue of $0$.
