Answer
The solution is $$\int\frac{\cos\theta}{1+\cos\theta}d\theta=\theta-\tan\frac{\theta}{2}+c.$$
Work Step by Step
To solve the integral $$\int\frac{\cos\theta}{1+\cos\theta}d\theta$$ we will use substitution $\tan\frac{\theta}{2}=t$ which gives us $d\theta=\frac{2}{1+t^2}dt,\cos\theta=\frac{1-t^2}{1+t^2}$. Putting all of this into the integral we have:
$$\int\frac{\cos\theta}{1+\cos\theta}d\theta=\int\frac{\frac{1-t^2}{1+t^2}}{1+\frac{1-t^2}{1+t^2}}\frac{2}{1+t^2}dt=\int\frac{\frac{1-t^2}{1+t^2}}{\frac{1+t^2+1-t^2}{1+t^2}}\frac{2}{1+t^2}dt=\int\frac{1-t^2}{2}\frac{2}{1+t^2}dt=\int\frac{1-t^2}{1+t^2}dt=-\int\frac{t^2-1}{1+t^2}dt=-\int\frac{t^2+1-2}{1+t^2}=-\left(\int\frac{1+t^2}{1+t^2}dt-2\int\frac{dt}{1+t^2}\right)=-\int dt+2\int\frac{dt}{1+t^2}=-t+2\arctan t+c,$$
where $c$ is arbitrary constant. Now we have to express our solution (which is in terms of $t$) in terms of $\theta$:
$$\int\frac{\cos\theta}{1+\cos\theta}d\theta=-t+2\arctan t+c=-\tan\frac{\theta}{2}+2\arctan(\tan\frac{\theta}{2})+c=-\tan\frac{\theta}{2}+2\frac{\theta}{2}+c=\theta-\tan\frac{\theta}{2}+c.$$