# Integrating dx/(2+sin(x)) using a complex substitution

1. Mar 16, 2014

### MissMoneypenny

1. The problem statement, all variables and given/known data

Compute the real integral

$\int\frac{dθ}{2+sin(θ)}$, where the limits of integration are from 0 to 2π

by writing the sine function in terms of the exponential function and making the substitution z=e$^{iθ}$ to turn the real integral into a complex integral.

2. Relevant equations

sin(z)=$\frac{e^{iz}-e^{-iz}}{2i}$

Cauchy's integral formula.

3. The attempt at a solution

I wrote sin(θ)=$\frac{e^{iθ}-e^{-iθ}}{2i}$ and plugged that into the integral. The integrand then simplifies to $\frac{2i}{4i+e^{iθ}+e^{-iθ}}$. Letting z=e$^{iθ}$ gives dθ=$\frac{dz}{iz}$. However, plugging this substitution back into the integral gives

$\int\frac{2dz}{-4z+iz^{2}-1}$

That's where I get stuck. I'm not sure where to go from here. I thought about using partial fractions, but that seems like it may be a nastier approach than necessary. Any help will be much appreciated.

Last edited: Mar 16, 2014
2. Mar 16, 2014

### vela

Staff Emeritus
Are the limits on the original integral?

You also seemed to have made an algebra mistake somewhere. The integrand should be $\frac{2}{z^2+4iz-1}\,dz.$

Last edited: Mar 16, 2014
3. Mar 16, 2014

### MissMoneypenny

Hi vela,

Thanks for the reply! Yes, there should certainly be limits on the original integral. Integration is performed from 0 to 2π. I've added the limits to my post. You're also correct about my algebra error. Nonetheless, even with the correct integrand I'm not sure where to go.

Thanks again.

4. Mar 16, 2014

### vela

Staff Emeritus
It's a contour integration now, right? Use the residue theorem.

Last edited: Mar 16, 2014
5. Mar 16, 2014

### MissMoneypenny

This problem is listed several chapters before the residue theorem is presented, so I think that there must be some way to do it without the residue theorem. On the midterm I have coming up we won't be allowed to use the residue theorem, so I was wondering if there's another way to do it. The problem comes at the end of the first chapter on integration with respect to complex variables. The chapter presents Cauchy's integral formula.

6. Mar 16, 2014

### Ray Vickson

Are there not standard formulas for integrals of the form
$$\int \frac{dz}{a z^2 + b z + c}?$$
You must have done this in calculus 101.

7. Mar 16, 2014

### vela

Staff Emeritus
Oh, okay. Factor the denominator. One of the poles, say $z_1$, will lie inside the contour so that you have
$$\int_C \frac{2}{z^2+4iz-1}\,dz = \int_C \frac{2}{(z-z_1)(z-z_2)}\,dz = \int_C \frac{g(z)}{z-z_1}\,dz,$$ where $g(z) = \frac{2}{z-z_2}$. You can use the Cauchy integral formula to evaluate the latter integral.

8. Mar 16, 2014

### MissMoneypenny

Awesome, thanks a lot for the hint! Following your hint I got the correct answer. Thanks again, have a great day :)