Evaluate the following integrals:
$\int \frac{x+\sin x}{1+\cos x} d x$
Let $I=\int \frac{x+\sin x}{1+\cos x} d x$
$1+\cos x$ can be written as, $2 \cos ^{2} \frac{x}{2}$ and $\sin x$ can be written as $2 \sin \frac{x}{2} \cos \frac{x}{2}$
$=\int \frac{x}{2 \cos ^{2} \frac{x}{2}} d x+\int \frac{2 \sin \frac{x}{2} \cos \frac{x}{2}}{2 \cos ^{2} \frac{x}{2}} d x$
$=\frac{1}{2} \int x \sec ^{2} \frac{x}{2}+\int \tan \frac{x}{2} d x$
Using integration by parts,
$=\frac{1}{2}\left[x \int \sec ^{2} \frac{x}{2}-\int \frac{d}{d x} x \int \sec ^{2} \frac{x}{2} d x\right]+\int \tan \frac{x}{2} d x$
$=\frac{1}{2}\left[2 x \tan \frac{x}{2}-2 \int \tan \frac{x}{2} d x\right]+\int \tan \frac{x}{2} d x$
$=x \tan \frac{x}{2}-\int \tan \frac{x}{2} d x+\int \tan \frac{x}{2} d x$
$=\mathrm{x} \tan \frac{\mathrm{x}}{2}+\mathrm{c}$