Complex Analysis :Real integral with residues calculation I'm new in the forum. I start saying sorry for my bad English (I'm Italian).
I have to solve the following integral
$$I=  \int_{-\pi}^{\pi} \frac{e^{2ix}}{1+\frac{\sin(x)}{2}} dx$$
So I obtain :
$$ I=4\oint_c {z^2\over z^2 +4iz-1 }dz$$
of course making the substitution
$$ e^{ix}=z, e^{2ix}=z^2, \sin x={{z-z^{-1}}\over2i}, dx={dz\over iz}$$
where c is the circumference centered in the origin and with radius r =1.
So I find singularities of the function and calculate residue of singularities inside the circumference :
$  z^2+4iz-1=0\longmapsto z=-2i+_-\sqrt{3}i$.
Only $  z_1=-2i+\sqrt{3}i$ is inside c, and it's a single pole.
So,
$$ Res{z^2 \over {z^2+4iz-1}}=\lim_{z \to -2i+\sqrt3i} {z^2 \over {(z+2i-\sqrt3i)(z+2i+\sqrt3i}}  (z+2i-\sqrt3i)={{7-4\sqrt3}\over2\sqrt3i}$$
So
$$ I=4 \cdot 2\pi i{{7-4\sqrt3}\over2\sqrt3i}\simeq0.52$$
And I think it's correct because Wolfram Alpha calculator finds the same result. My problem is that the exercise, then, asks to " justify why the integral is a real number". " Justify", not "calculate",  So I divided real and complex part of original integral :
$$ I=  \int_{-\pi}^{\pi} \frac{e^{2ix}}{1+\frac{sin(x)}{2}} dx=\int_{-\pi}^{\pi} \frac{cos(2x)}{1+\frac{sin(x)}{2}} dx +i\int_{-\pi}^{\pi} \frac{sin(2x)}{1+\frac{sin(x)}{2}} dx$$
But i notice that complex part is not odd so I can't make theoretical consideration about the fact it should be null. I ask you if I can " say something" by deduction or if I necessarily have to calculate the integral of imaginary part as I did for the whole integral. Thanks in advance .
 A: Let $g(x) = \frac{\sin 2x}{1+\frac{\sin x}{2}} $ so
$ \int_{-\pi}^\pi g(x) dx = \Im I.$
Since $h(x) = g(x-\pi/2)$ is odd, and periodic with period $2\pi$,
$$ \Im I = \int_{-\pi}^\pi g(x) dx = \int_{-\pi}^\pi h(x) dx = 0.$$


A: Let's divide the integral of the complex part into 2 pieces, of length $\pi$.
$$\int_{-\pi}^{\pi} \frac{\sin(2x)}{1+\frac{\sin(x)}{2}} dx=\int_{-\pi}^{0} \frac{\sin(2x)}{1+\frac{\sin(x)}{2}} dx+\int_{0}^{\pi} \frac{\sin(2x)}{1+\frac{\sin(x)}{2}} dx$$
Let's calculate the first integral:
$$I_1=\int_{-\pi}^{0} \frac{\sin(2x)}{1+\frac{\sin(x)}{2}} dx$$
We do the substitution $x=y-\pi/2$, $dx=dy$, and the limits will be from $-\pi/2$ to $\pi/2$:
$$I_1=\int_{-\pi/2}^{\pi/2} \frac{\sin(2y-\pi)}{1+\frac{\sin(y-\pi/2)}{2}} dy=\int_{-\pi/2}^{\pi/2} \frac{-\sin(2y)}{1-\frac{\cos(y)}{2}} dy$$
Notice that the numerator is even and the denominator is odd, so the integral is zero. Similarly, you can get that $I_2=0$.
A: Actually, for any continuous function $f$ we have$$\int_{-\pi}^\pi f\bigl(\sin(x)\bigr)\cos(x)\,\mathrm dx=0$$(in your case, $f(t)=\frac{2t}{1+t/2}$). In fact, since we are integrating a periodic function with period $2\pi$, the previous is equal to$$\int_{-\pi/2}^{\pi/2}f\bigl(\sin(x)\bigr)\cos(x)\,\mathrm dx+\int_{\pi/2}^{3\pi/2}f\bigl(\sin(x)\bigr)\cos(x)\,\mathrm dx.\tag1$$You can deal with the first integral doing $\sin(x)=t$ and $\cos(x)\,\mathrm dx=\mathrm dt$; it becomes$$\int_{-1}^1f(t)\,\mathrm dt.\tag2$$If you deal with the second integral from $(1)$ in the same way, what you get now is$$\int_1^{-1}f(t)\,\mathrm dt.\tag3$$But $(2)$ and $(3)$ are symmetric of each other. Therefore, the integral $(1)$ is equal to $0$.
