# $\int_0^{\pi/4}\!\frac{\mathrm dx}{2+\sin x}$ , $\int_0^{2\pi}\!\frac{\mathrm dx}{2+\sin x}$

$$\int_0^{\pi/4}\!\frac{\mathrm dx}{2+\sin x}$$

and

$$\int_0^{2\pi}\!\frac{\mathrm dx}{2+\sin x}$$

I've tried the standard $u = \tan \frac{x}{2}$ substitution but it looks horrible.

• I've enhanced the typesetting of your question according to these style guidelines; the reference may help you for future questions. – Lord_Farin May 15 '13 at 19:59

Let's give another try to your failed technique...

$$\displaystyle\int \frac{dx}{2+\sin x}$$

Let $u = \tan \frac{x}{2}$

$$\int \frac{du}{u^2+u+1} = \int \frac{du}{\left(u+\frac{1}{2}\right)^2 + \left(\frac{\sqrt{3}}{2}\right)^2}$$

Let $s=u+\frac{1}{2}$

\begin{align}\int \frac{ds}{s^2 + \left(\frac{\sqrt{3}}{2}\right)^2} &= \frac{2}{\sqrt{3}}\arctan\left(\frac{2s}{\sqrt{3}}\right)\\ &=\frac{2}{\sqrt{3}}\arctan\left(\frac{2u+1}{\sqrt{3}}\right)\\&=\frac{2}{\sqrt{3}}\arctan\left(\frac{2\tan\frac{x}{2}+1}{\sqrt{3}}\right)\end{align}

Evaluating the above from $0$ to $\dfrac{\pi}{4}$ yields approximately $0.33355$ while $0$ to $2\pi$ gives $\dfrac{2\pi}{\sqrt{3}}$.

• @Lord_Farin Thanks for the edit. – Maazul May 15 '13 at 20:08
• Maybe some details about how you evaluated the limits in the integral over $[0,2 \pi)$. – Ron Gordon May 15 '13 at 20:28
• Ran a trapezoidal intregator on C++ for the integration on the limit from $0$ to $2\pi$. In my understanding if we consider $\tan 0=0$ we should get $\arctan\left(\frac{1}{\sqrt{3}}\right)=\frac{\pi}{6}$, but if we take $\tan \pi=0$, we're working a period ahead and hence $\arctan\left(\frac{1}{\sqrt{3}}\right)$ should return $\frac{7\pi}{6}$. – Maazul May 15 '13 at 21:01

For the second one, where the integral is from $0$ to $2\pi$, here is a way out.

\begin{align} \dfrac12\int_0^{2\pi} \dfrac{dx}{1+\dfrac{\sin(x)}2} & = \dfrac12\int_0^{2\pi}\sum_{k=0}^{\infty}\left(-\dfrac12 \right)^k \sin^{k}(x) dx = \sum_{k=0}^{\infty}\dfrac1{2^{2k+1}} \int_0^{2 \pi}\sin^{2k}(x) dx\\ & = \sum_{k=0}^{\infty} \dfrac1{2^{2k+1}} \cdot \dfrac{2\pi}{2^{2k}} \dbinom{2k}k = \sum_{k=0}^{\infty} \cdot \dfrac{\pi}{16^{k}} \dbinom{2k}k= \dfrac{\pi}{\sqrt{1-4\times \left(\dfrac1{16}\right)}} = \dfrac{2\pi}{\sqrt3} \end{align} where we used the following facts:

$\dfrac1{1+r} = \displaystyle \sum_{k=0}^{\infty}(-r)^k$, $\displaystyle \int_0^{2\pi} \sin^{2k}(x) dx = \dbinom{2k}k \dfrac{2\pi}{2^{2k}}$ and $\dfrac1{\sqrt{1-4x}} = \displaystyle\sum_{k=0}^{\infty} \dbinom{2k}k x^k \,\, \forall x \in \left[-\dfrac14,\dfrac14 \right)$