<s>[INST] 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}$$
 [/INST] 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$$
</s>