Solution (source code)

= Solution

Set $z=e^{i\theta}$. The <integral> becomes
$$
\oint_{|z|=1}\frac{dz}{i[(1-i/2)z^2+3z+(1+i/2)]}.
$$
The roots are $z=(-3\pm2)/(2-i)$, only $z_+=-1/(2-i)$ lying inside. The <derivative> of the quadratic at $z_+$ is two, so the <residue> is $1/(2i)$. Consequently $\boxed{\int_0^{2\pi}d\theta/(3+2\cos\theta+\sin\theta)=\pi}$. The denominator is positive since $3>\sqrt5$, so no principal-value qualification is required.