# Complex integration exercise

I have to calculate $$\int_0^{2\pi}\arctan \biggl( \frac{\sin \theta} {\cos \theta +3}\biggr)d\theta$$ I don't have any ideas, but I think that I should apply a substitution. Can you give me a hint? Thank you in advance

• Make the substitution $z=e^{i\theta }$ and use residue theorem. – Todd Dec 8 '19 at 16:51
• Are you able to find the poles of the integrand? Particularly those with real part between $0$ and $2\pi$? Are you able to find their residues? – Eric Towers Dec 8 '19 at 17:02
• Thank you, I made that substitution, and I obtained $\oint_C \frac {\arctan \frac {z^2-1}{iz^2+3iz+i}}{zi}dz$. However this implies that the integral is equal to $2\pi \arctan i$. Where am I wrong? – Dorian Dec 8 '19 at 19:17
• Show that the integral is equal to $$\operatorname {Im} \int_{|z - 3| = 1} \frac {i \ln z} {3 - z} dz$$ with a suitable choice of $\ln z$. $z = 0$ is not a pole for the integrand that you've obtained ($3 i z$ should be $6 i z$, but $z = 0$ still would be a branch point). – Maxim Dec 9 '19 at 1:09

$$\arctan\left(\frac{\sin\theta}{\cos\theta + 3}\right)=\text{Im}\log\left(i\sin\theta+\cos\theta+3\right)=\text{Im}\log(3+e^{i\theta})=\text{Im}\log\left(1+\frac{e^{i\theta}}{3}\right)$$ so the integral equals $$\text{Im}\int_{0}^{2\pi}\sum_{n\geq 1}(-1)^{n+1}\frac{e^{ni\theta}}{n 3^n}\,d\theta=\text{Im}(0)=\color{red}{0}.$$
• Thanks. I could say that the integral is equal to $0$ even observing that $3+z$ is a holomorphic function never vanishing in an open set containing $D_1 (0)$, right? – Dorian Dec 9 '19 at 7:55
oops, I missed the part it should be done by complex integration... Anyway, I'll leave this result as a hint what to look for. Note that $$\arctan\left(\frac{\sin(\pi-x)}{3+\cos(\pi-x)}\right) = \arctan\left(\frac{\sin(x)}{3-\cos(x)}\right)$$ and $$\arctan\left(\frac{\sin(\pi+x)}{3+\cos(\pi+x)}\right) = -\arctan\left(\frac{\sin(x)}{3-\cos(x)}\right)$$ thus integration from $$0$$ to $$2\pi$$ yields $$0$$.