# Integrate $I(a) = \int_0^{\pi/2} \frac{dx}{1-a\sin x}$

I have a problem with this integral. It seems that solution has to be simple, but I couldn't find out.

$$I(a) = \int_0^{\pi/2} \frac{dx}{1-a\sin x}$$

I tried using integration by parts and differentiating with regard to a, but neither helped.

• Let $\tan \dfrac{x}{2}=u\implies \sin x=\dfrac{2u}{1+u^2}$ and $dx=\dfrac{udu}{1+u^2}$ – Jonas Kgomo Dec 24 '14 at 18:52
• @Jonas12 Should be $dx=\frac{2\,du}{1+u^2}$. – David H Dec 24 '14 at 18:59

Observe that your integral is convergent in the usual sense for $|a|<1$. You may then write $t=\tan \dfrac{x}{2}$, giving $\sin x=\dfrac{2t}{1+t^2}$.

Hence

\begin{align} I(a) &= \int_0^{\pi/2} \frac{dx}{1-a\sin x}\\\\ &= 2\int_0^{1} \frac{1}{1-a\dfrac{2t}{1+t^2}}\frac{dt}{1+t^2}\\\\ &= 2\int_0^{1} \frac{1}{(t-a)^2+(1-a^2)}dt\quad \left(t-a=\sqrt{1-a^2}\:u,\,dt=\sqrt{1-a^2}\:du\right)\\\\ &= \frac{2}{\sqrt{1-a^2}}\int_{-a/\sqrt{1-a^2}}^{(1-a)/\sqrt{1-a^2}} \frac{1}{u^2+1}du\quad \\\\ &= \frac{2}{\sqrt{1-a^2}}\arctan \left(\sqrt{\frac{1+a}{1-a}}\right) \end{align}

• Thank you! That was really easy. ;) – Martynas Riauka Dec 24 '14 at 19:37


With $\ds{\verts{a} < 1}$:

\begin{align}&\color{#66f}{\large\int_{0}^{\pi/2}{\dd x \over 1 - a\sin\pars{x}}} =\int_{0}^{\pi/2}{1 + a\sin\pars{x} \over 1 - a^{2}\sin^{2}\pars{x}}\,\dd x =\int_{0}^{\pi/2}{1 + a\sin\pars{x} \over 1 - a^{2} + a^{2}\cos^{2}\pars{x}}\,\dd x \\[5mm]&=\int_{0}^{\pi/2} {\sec^{2}\pars{x} \over \pars{1 - a^{2}}\sec^{2}\pars{x} + a^{2}} \,\dd x +\int_{0}^{\pi/2}{a\sin\pars{x} \over a^{2}\cos^{2}\pars{x} + 1 - a^{2} }\,\dd x \\[5mm]&=\underbrace{\int_{0}^{\pi/2} {\sec^{2}\pars{x} \over \pars{1 - a^{2}}\tan^{2}\pars{x} + 1}\,\dd x} _{\ds{\dsc{y}\ \equiv \dsc{\root{1 - a^{2}}\tan\pars{x}}}}\ +\ {1 \over 1 - a^{2}}\ \underbrace{\int_{0}^{\pi/2}{a\sin\pars{x} \over a^{2}\cos^{2}\pars{x}/\pars{1 - a^{2}} + 1}\,\dd x} _{\ds{\dsc{z}\ \equiv\ \dsc{{\verts{a} \over \root{1 - a^{2}}}\,\cos\pars{x}}}} \end{align}

Then,

\begin{align}&\color{#66f}{\large\int_{0}^{\pi/2}{\dd x \over 1 - a\sin\pars{x}}} \\[5mm]&={1 \over \root{1 - a^{2}}}\int_{0}^{\infty}{\dd y \over y^{2} + 1} - {\sgn\pars{a}\root{1 - a^{2}} \over 1 - a^{2}} \int_{\verts{a}/\root{1 - a^{2}}}^{0}{\dd z \over z^{2} + 1} \\[5mm]&={1 \over \root{1 - a^{2}}}\bracks{% {\pi \over 2} + \sgn\pars{a}\arctan\pars{\verts{a} \over \root{1 - a^{2}}}} \\[5mm]&=\color{#66f}{\large{1 \over \root{1 - a^{2}}}\bracks{% {\pi \over 2} + \arctan\pars{a \over \root{1 - a^{2}}}}} \end{align}

The purpose of this reply is twofold. Firstly, I'd like to point out that the integral is convergent for all real $a<1$. Secondly, I'd like to show another possible way of calculating the integral.

Let $f(x)=1/(1-a\sin x)$. We calculate $$\int_0^{\pi/2}f(x)\, dx.$$ If $0<a<1$ then $f$ is monotonically increasing on $(0,\pi/2)$ with values in $(1,1/(1-a))$. Its inverse $f^{-1}$ is given by $f^{-1}(x)=\arcsin\bigl(\tfrac{1}{a}\bigl(1-\tfrac{1}{x}\bigr)\bigr)$. We use the fact that (draw the graph!) $$\int_0^{\pi/2}f(x)\, dx + \int_{1}^{1/(1-a)} f^{-1}(x)\, dx = \frac{\pi}{2}\times \frac{1}{1-a}.$$ (Another way here is to just use the substitution $y=1/(1-a\sin x)$.)

Integration by parts gives \begin{align} \int_{1}^{1/(1-a)} \arcsin\bigl(\tfrac{1}{a}\bigl(1-\tfrac{1}{x}\bigr)\bigr)\, dx &= \Bigl[x\arcsin\bigl(\tfrac{1}{a}\bigl(1-\tfrac{1}{x}\bigr)\bigr)\Bigr]_{1}^{1/(1-a)} \\ &\qquad - \int_{1}^{1/(1-a)} \frac{\sqrt{1-a^2}}{a\sqrt{1-\bigl(\frac{1-a^2}{a}x-\frac{1}{a}\bigr)^2}}\, dx\\ &=\Bigl[x\arcsin\bigl(\tfrac{1}{a}\bigl(1-\tfrac{1}{x}\bigr)\bigr) -\tfrac{1}{\sqrt{1-a^2}}\arcsin\bigl(\tfrac{1-a^2}{a}x-\tfrac{1}{a}\bigr) \Bigr]_{1}^{1/(1-a)}\\ &=\frac{\pi}{2}\times\frac{1}{1-a}-\frac{\pi+2\arcsin(a)}{2\sqrt{1-a^2}}. \end{align} Hence $$\int_0^{\pi/2}\frac{1}{1-a\sin x}\, dx =\frac{\pi+2\arcsin(a)}{2\sqrt{1-a^2}}.\tag{*}$$

If $-1<a<0$, then $f$ is monotonically decreasing from $1$ to $1/(1-a)$ on the interval $(0,\pi/2)$. The same calculations as above (be a bit careful with the limits of the integral!) gives $(*)$ again. Finally, it is trivial that $(*)$ also holds for $a=0$.

The integral is, however, convergent also for $a\leq -1$. For $a<-1$, the same calculations as above give $$\int_{0}^{\pi/2}\frac{1}{1-a\sin x}\, dx = \frac{\ln(-a+\sqrt{a^2-1})}{\sqrt{a^2-1}}.$$ (This could also be expressed using the inverse hyperbolic sine, $\text{arsinh}$. If you know complex analysis this is not a problem.)

Finally, for $a=-1$, the value of the integral is $1$. This can be seen either as a limit of the previous expressions or by a direct calculation (it holds that $\int 1/(1+\sin x)\, dx = 2\sin(x/2)/(\cos(x/2)+\sin(x/2))$).

Using $u=\sin x$ and $v^2=\frac{1+u}{1-u}$ we have \begin{eqnarray} \int_0^{\frac{\pi}{2}}\frac{dx}{1-a\sin x}&=&\int_0^{1}\frac{1}{(1-au)\sqrt{1-u^2}}du\\ &=&\int_0^{1}\frac{1}{(1-au)(1+u)}\sqrt{\frac{1+u}{1-u}}du\\ &=&\int_1^\infty\frac{1}{(1-a\frac{v^2-1}{v^2+1})(1+\frac{v^2-1}{v^2+1})}v\frac{2v}{(1+v^2)^2}dv\\ &=&2\int_1^\infty\frac{1}{(1+a)+(1-a)v^2}dv\\ &=&\frac{2}{1-a}\int_1^\infty\frac{1}{v^2+\frac{1+a}{1-a}}dv\\ &=&\frac{2}{1-a}\sqrt{\frac{1-a}{1+a}}\arctan\left(\sqrt{\frac{1-a}{1+a}}v\right)\bigg|_1^\infty\\ &=&\frac{2}{\sqrt{1-a^2}}\left(\frac{\pi}{2}-\arctan\left(\sqrt{\frac{1-a}{1+a}}\right)\right) \end{eqnarray}