Question:
$\frac{\cos x}{1+\cos x}$
Solution:
$\frac{\cos x}{1+\cos x}=\frac{\cos ^{2} \frac{x}{2}-\sin ^{2} \frac{x}{2}}{2 \cos ^{2} \frac{x}{2}}$ $\left[\cos x=\cos ^{2} \frac{x}{2}-\sin ^{2} \frac{x}{2}\right.$ and $\left.\cos x=2 \cos ^{2} \frac{x}{2}-1\right]$
$=\frac{1}{2}\left[1-\tan ^{2} \frac{x}{2}\right]$
$\therefore \int \frac{\cos x}{1+\cos x} d x=\frac{1}{2} \int\left(1-\tan ^{2} \frac{x}{2}\right) d x$
$=\frac{1}{2} \int\left(1-\sec ^{2} \frac{x}{2}+1\right) d x$
$=\frac{1}{2} \int\left(2-\sec ^{2} \frac{x}{2}\right) d x$
$=\frac{1}{2}\left[2 x-\frac{\tan \frac{x}{2}}{\frac{1}{2}}\right]+\mathrm{C}$
$=x-\tan \frac{x}{2}+\mathrm{C}$