Compute the integral $\int\limits_{0}^{\pi/2} \frac{dx}{\sqrt{1 + \sin x}}$ The original task was to find the arc length of $y = \ln(1 + \sin(x))$ where $x \in [0, \pi/2]$. Using the general formula for arc length of $y = f(x)$ I've got $\sqrt2 \int\limits_0^{\pi/2}\frac{dx}{\sqrt{1+ \sin x}}$. I've tried to make a substitution $\sqrt{1 + \sin x} = t$ and $dx = \frac{2t\,dt}{\sqrt{1 - (t^2 - 1)^2}}$ which gives an integral $2\sqrt{2} \int\limits_1^{\sqrt{2}}\frac{dt}{t\sqrt{2 - t^2}}$. This integral might be not so difficult to compute, but the strange thing is that this task gives only three points (max is $38$) for correct solution. I think it became too hard and other (and much easier) solution should exist.
So, the question is the following: is there any (easier) method to compute this integral (or may be some easier way to find the arc length of the curve)?
 A: Use the fact that $\int_0^a f(x)dx =\int_0^a f(a-x)dx$: $$\int_0^{\frac{\pi}{2}} \frac{1}{\sqrt{1+\sin x}} dx = \int_0^{\frac{\pi}{2}} \frac{1}{\sqrt{1+\cos x}} dx \\ = \int_0^{\frac{\pi}{2}} \frac{dx}{\sqrt{2\cos^2 \frac x2}} \\ = \frac{1}{\sqrt2} \int_0^{\frac{\pi}{2}} \sec \frac x2 dx\\ = \frac{2}{\sqrt 2} \bigg[\ln\left|\sec \frac x2 +\tan \frac x2\right|\bigg]_0^{\frac{\pi}{2}} \\ =\sqrt 2\ln(\sqrt 2+1)  $$
A: Well, we have:
$$\mathcal{I}:=\int_0^\frac{\pi}{2}\frac{1}{\sqrt{1+\sin\left(x\right)}}\space\text{d}x\tag1$$
Substitute $\text{u}=\frac{2x-\pi}{4}$, gives:
$$\mathcal{I}=\int_{-\frac{\pi}{4}}^0\frac{\sqrt{2}}{\cos\left(\text{u}\right)}\space\text{du}=\sqrt{2}\int_{-\frac{\pi}{4}}^0\sec\left(\text{u}\right)\space\text{du}\tag2$$
A: $$\int_0^{\pi/2}\frac{dx}{\sqrt{1+\sin x}}$$
$$=\int_0^{\pi/2}\frac{dx}{\sqrt{\left(\sin\frac{x}{2}+\cos\frac{x}{2}\right)^2}}$$
$$=\int_0^{\pi/2}\frac{dx}{\sin\frac{x}{2}+\cos\frac{x}{2}}$$
$$=\frac{1}{\sqrt2}\int_0^{\pi/2}\frac{dx}{\sin\left(\frac{x}{2}+\frac{\pi}{4}\right)}$$
$$=\frac{1}{\sqrt2}\int_0^{\pi/2}\csc\left(\frac{x}{2}+\frac{\pi}{4}\right)\ dx$$
A: $$
\begin{align}
\int_0^{\pi/2}\frac1{\sqrt{1+\sin(x)}}\,\mathrm{d}x
&=\int_0^{\pi/2}\frac{\sqrt{1-\sin(x)}\,\mathrm{d}x}{\cos(x)}\tag1\\
&=\int_0^{\pi/2}\frac{\sqrt{1-\sin(x)}\,\mathrm{d}\sin(x)}{1-\sin^2(x)}\tag2\\
&=\int_0^1\frac{\sqrt{1-u}\,\mathrm{d}u}{1-u^2}\tag3\\
&=\int_0^1\frac{2\,\mathrm{d}v}{2-v^2}\tag4\\
&=\int_0^1\frac1{\sqrt2}\left(\frac1{\sqrt2-v}+\frac1{\sqrt2+v}\right)\mathrm{d}v\tag5\\
&=\frac1{\sqrt2}\left[\log\left(\frac{\sqrt2+v}{\sqrt2-v}\right)\right]_0^1\tag6\\[9pt]
&=\sqrt2\log(\sqrt2+1)\tag7
\end{align}
$$
Explanation:
$(1)$: multiply by $\frac{\sqrt{1-\sin(x)}}{\sqrt{1-\sin(x)}}$
$(2)$: $\mathrm{d}x=\frac{\mathrm{d}\sin(x)}{\cos(x)}$
$(3)$: $u=\sin(x)$
$(4)$: $v=\sqrt{1-u}$
$(5)$: partial fractions
$(6)$: integrate
$(7)$: evaluate
