<s>[INST] Evaluating: $\int \frac {1+\sin (x)}{1+\cos (x)} dx$ 
Evaluate: $\int \dfrac {1+\sin (x)}{1+\cos (x)} dx$

My Attempt:
$$=\int \dfrac {1+\sin (x)}{1+\cos (x)} dx$$
$$=\int \dfrac {(\sin (\dfrac {x}{2}) + \cos (\dfrac {x}{2}))^2}{2\cos^2 (\dfrac {x}{2})} dx$$
$$=\dfrac {1}{2} \int (\dfrac {\sin (\dfrac {x}{2}) + \cos (\dfrac {x}{2})}{\cos (\dfrac {x}{2})})^2 dx$$
$$=\dfrac {1}{2} \int (\tan (\dfrac {x}{2}) +1)^2 dx$$
How do I continue?
 [/INST] The integration of
$$\frac{\sin x}{1+\cos x}$$ which is of the form $f'(x)/f(x)$ is immediate. The rest is
$$\int\frac{dx}{1+\cos x}=\int\frac{dx}{2\cos^2\frac x2}$$ and
$$I=-\log|1+\cos x|+\tan\frac x2+C.$$
</s>