Integrate $\int \frac {dx}{1+\sin x}$ Integrate $\int \dfrac {dx}{1+\sin x}$
My attempt:
$$\begin{align}&=\int \dfrac {dx}{1+\sin x}\\
&=\int{\dfrac{dx}{1+\dfrac{2\tan \left( \dfrac{x}{2} \right)}{1+\tan ^2\left( \dfrac{x}{2} \right)}}}\\
&=\int{\dfrac{1+\tan ^2\left( \dfrac{x}{2} \right)}{\left( 1+\tan \left( \dfrac{x}{2} \right) \right) ^2}}\,dx\end{align}$$
 A: See Tangent_half-angle_substitution
If $z = \tan \big(\frac x2 \big)$, then $dx = \dfrac{2 dz}{1+z^2}$
and $\sin(x) = \dfrac{2z}{1+z^2}$
\begin{align}
   \int\frac{dx}{1+\sin x} 
   &= \int\frac{1}{1+\sin x} \cdot dx \\
   &= \int \dfrac{1}{\left(1+\dfrac{2z}{(1+z^2)}\right)} 
      \cdot \dfrac{2 dz}{1+z^2} \\
   &= \int \dfrac{2 \, dz}{(1+z)^2} \\
   &= -\dfrac{2}{1+z} + C \\
   &= -\dfrac{2}{1 + \tan(\frac x2)} \\
   &= \dfrac{-2}{1 + \dfrac{\sin x}{1+\cos x}} \\
   &= -2\dfrac{1+\cos x}{1 + \cos x + \sin x}
\end{align}
A: Hint:$$\int\frac1{1+\sin x}\,\mathrm dx=\int\frac{1-\sin x}{\cos^2x}\,\mathrm dx=\int\frac1{\cos^2x}\,\mathrm dx-\int\frac{\sin x}{\cos^2x}\,\mathrm dx.$$
A: Hint:
$$\dfrac1{1+\sin x}=\dfrac1{1+\cos\left(\dfrac\pi2-x\right)}=\dfrac{\sec^2\left(\dfrac\pi4-\dfrac x2\right)}2$$
Alternatively, 
$$\dfrac1{1+\sin x}=\dfrac{\sec^2\dfrac x2}{\left(1+\tan\dfrac x2\right)^2}$$
A: $$\int\frac{1}{1+sin(x)}dx$$
Apply u-substitution:$u=tan(\frac x2)$
$$=\int \frac{2}{u^2+1+2u}$$
$$=2\int \frac{1}{u^2+1+2u}$$
$$=2\int\frac{1}{(u+1)^2}$$
Again apply u-substitution:$v=u+1$
$$=2\int\frac{1}{v^2}dv$$
$$=2\int\ v^{-2}dv$$
$$=2\frac{v^{-2+1}}{-2+1}$$
Substitute back $v=u+1,u=tan\frac {x}{2}$
$$=-\frac{2}{tan\frac x2+1}$$
$$\int\frac{1}{1+sin(x)}dx=-\frac{2}{tan\frac x2+1}+C$$
A: I am continuing from where you left - 
$$\int \dfrac {dx}{1+\sin x}$$
$$=\int \dfrac {dx}{1+\dfrac {2\tan (\dfrac {x}{2})}{1+\tan^2 (\dfrac {x}{2})}}$$
$$=\int \dfrac {1+\tan^2 (\dfrac {x}{2})}{(1+\tan (\dfrac {x}{2}))^2}\,dx$$
$$=\int \dfrac {1+(\dfrac {\sin^2 (\dfrac {x}{2})}{\cos^2 (\dfrac {x}{2})})}{(1+\tan (\dfrac {x}{2}))^2}\,dx$$
$$=\int \dfrac {\dfrac{\sin^2(\dfrac{x}{2})+\cos^2(\dfrac{x}{2})}{\cos^2(\dfrac{x}{2})}}{(1+\tan (\dfrac {x}{2}))^2}\,dx$$
$$=\int \dfrac {\dfrac{1}{\cos^2(\dfrac{x}{2})}}{(1+\tan (\dfrac {x}{2}))^2}\,dx$$
$$=\int \dfrac {\sec^2(\dfrac{x}{2})}{(1+\tan (\dfrac {x}{2}))^2}\,dx$$
$$ Let,$$
$$\quad \quad \quad \quad \quad \quad \quad \quad 1+\tan(\dfrac{x}{2})=z$$
$$\quad \quad \quad \quad \quad \quad \quad \quad \implies(\sec^2(\dfrac{x}{2}))dx=2dz$$
$$=\int 2\dfrac {dz}{z^2}$$
$$=\dfrac{-2}{z}+c$$
$$=-\dfrac {2}{(1+\tan (\dfrac {x}{2}))}+c$$
