How to integrate these integrals $$\int^{\frac {\pi}2}_0 \frac {dx}{1+ \cos x}$$
$$\int^{\frac {\pi}2}_0 \frac {dx}{1+ \sin x}$$
It seems that substitutions make things worse:
$$\int \frac {dx}{1+ \cos x} ; t = 1 + \cos x; dt = -\sin x dx ; \sin x = \sqrt{1 - \cos^2 x} = \sqrt{1 - (t-1)^2} $$
$$ \Rightarrow
\int \frac {-\sqrt{1 - (t-1)^2}}{t} = \int \frac {-\sqrt{t^2 + 2t}}{t} = \int \frac {-\sqrt t \cdot \sqrt t \cdot \sqrt{t +
2}}{\sqrt t \cdot t} $$
$$= \int \frac {- \sqrt{t + 2}}{\sqrt t } = \int  - \sqrt{1 + \frac 2t} = ? $$
What next? I don’t know. Also, I’ve tried another “substitution”, namely $1 + \cos x = 2 \cos^2 \frac x2) $
$$ \int \frac {dx}{1+ \cos x} = \int \frac {dx}{2 \cos^2 \frac x2} = \int \frac 12 \cdot \sec^2 \frac x2 = ? $$
And failed again. Help me, please.

HINT:
$$\text{As }\frac{d(\tan mx)}{dx}=m\sec^2mx,$$
$$\int\sec^2mx= \frac{\tan mx}m+C$$
here $m=\frac12$
or using Weierstrass substitution $\tan \frac x2=t,$
$\frac x2=\arctan t\implies dx=2\frac{dt}{1+t^2}$  and $\cos x=\frac{1-t^2}{1+t^2}$
$$\int \frac{dx}{1+\cos x}=\int dt=t+K=\tan\frac x2+K$$
