Residue theorem integral - calculating with trigonometric functions

55 Views Asked by At

I am trying to solve the following integral:

$$I = \int_0^{2\pi} \frac{d\phi}{a + 2 b \cos(\phi) + 2 c \sin(\phi)}$$

We can assume that the denominator is always strictly positive ($a \gg b, c$). Using as example the values $(a, b, c) = (20, 1, 2)$, I could nicely see the smooth integrand function in Desmos Graphing Calculator and also use find the numerical solution using numerical integration in Python. However, now I want to solve it theoretically for general $(a, b, c)$ parameters, and I believe the Residue Theorem is the right approach.

I found a countradiction in my reasoning below, and I would greatly appreciate it if you help me find where I made the mistake.

Defining $z = e^{i \phi}$, we get $d\phi = \frac{dz}{iz}$. Of course, we can also use $\cos(\phi) = \frac{z + z^{-1}}{2}$, and $\sin(\phi) = \frac{z - z^{-1}}{2i}=-i\frac{z - z^{-1}}{2}$. After the substitution, one gets

$$ I = \int_{|z|=1} \frac{dz}{iz \big[ a + b (z + z^{-1}) - i c (z - z^{-1}) \big]} = \int_{|z|=1} \frac{dz}{z^2 (c + i b) + z (i a) + (-c + i b) } = \int_{|z|=1} \frac{dz}{f(z)}$$

We can now find the roots of $f(z)$ using the well-known quadratic equation, yielding $$z_{1,2} = \frac{-a i \pm \sqrt{-a^2 + 4 b^2 + 4 c^2}}{2 (c + ib)}$$

Please note that discriminant must be negative, as it is always the case that $a^2 > 4 b^2 + 4 c^2$, and we can then equivalently write $\sqrt{-a^2 + 4 b^2 + 4 c^2}$ as $i \sqrt{a^2 - 4 b^2 - 4 c^2}$ to work with the root of a positive real number instead. At this point, we now have the integral

$$I = \int_{|z|=1} \frac{dz}{(z - z_1)(z-z_2)}$$

And we can directly apply the Residue theorem. Although I was not able to prove it theoretically, I checked numerically (with different parameters) that $z_1$ is within the unit circle, while $z_2$ is outside. Therefore, the theorem tell us that

$$I = 2 \pi i \cdot R\bigg(\frac{1}{f(z)}, z_1 \bigg) = 2 \pi i \cdot \lim_{z \rightarrow z_1} (z - z_1) \frac{1}{(z - z_1)(z-z_2)} = \frac{2 \pi i}{z_1 - z_2}$$

Here comes now the contradiction...

$$z_1 - z_2 = \frac{\sqrt{-a^2 + 4 b^2 + 4 c^2}}{(c + ib)} = \frac{i \sqrt{a^2 - 4 b^2 - 4 c^2} \cdot (c - ib)}{(c^2 + b^2)}$$

Because $z_1 - z_2$ is not a pure imaginary number and has both real and imaginary part, we get that $I = \frac{2 \pi i}{z_1 - z_2}$ must be a complex number too, also with real and imaginary part, which does not make sense to me, since our original integral $I$ only contained a real function.

Thank you very much for any help!

PD: I know there are very similar threads (e.g. Residue theorem integration). However, I was not able to solve this particular problem from the other responses.