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

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