Compute the integral $\int\limits_{0}^{\pi/2} \frac{dx}{\sqrt{1 + \sin x}}$

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) $$


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$$


$$\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$$