Evaluating the definite integral $\int^{\pi/2}_0 \frac{x+\sin x}{1+\cos x}\,\mathrm dx$ Problem : 
$$\int^{\pi/2}_0 \frac{x+\sin x}{1+\cos x}\,\mathrm dx \tag{i}$$
My approach : 
$$\frac{x+\sin x}{1+\cos x}\,\mathrm dx= \left ( \frac{x}{2\cos^2(x/2)} + \tan(x/2) \right )\,\mathrm dx$$
Therefore, (i) will become : 
$$\int^{\pi/2}_0\left (\frac{x }{2\cos^2(x/2)} + \frac{1}{2}\tan(x/2) \right )\,\mathrm dx = \int^{\pi/2}_0 \frac{1}{2}x \sec^2(x/2)\,\mathrm dx + \int^{\pi/2}_0 \frac{1}{2}\tan(x/2)\,\mathrm dx$$
Please guide how to proceed. Thanks.
 A: Since $\displaystyle\int\dfrac{x+\sin x}{1+\cos x}dx$ has close-form, I don't think this question is really difficult.
Since
$$
\begin{align}
\int\dfrac{x+\sin x}{1+\cos x}\text{d}x & = \int\dfrac{x}{1+\cos x}dx+\int\dfrac{\sin x}{1+\cos x}dx \\
& = \int\dfrac{x}{2\cos^2\dfrac{x}{2}}dx+\int\tan\dfrac{x}{2}dx \\
& = \int\dfrac{x}{2}\sec^2\dfrac{x}{2}dx+\int\tan\dfrac{x}{2}dx \\
& = \int x~d\left(\tan\dfrac{x}{2}\right)+\int\tan\dfrac{x}{2}dx \\
& = x\tan\dfrac{x}{2}-\int\tan\dfrac{x}{2}dx+\int\tan\dfrac{x}{2}dx \\
& =x\tan\dfrac{x}{2}+C
\end{align}
$$
we have that
$$
\int_0^{\frac{\pi}{2}}\dfrac{x+\sin x}{1+\cos x}dx=\left[x\tan\dfrac{x}{2}\right]_0^{\frac{\pi}{2}}=\dfrac{\pi}{2}
$$
A: Hint: 
$$\int dx \, \sec^2{(x/2)} = 2 \tan{(x/2)} + C$$
Integrate by parts to get
$$\frac12 \int_0^{\pi/2} dx \, x \, \sec^2{(x/2)} = [x \tan{(x/2)}]_0^{\pi/2} - \int_0^{\pi/2} dx \, \tan{(x/2)}$$
A: Note first that $$1+\cos x=2\cos^2\frac x2\tag{1}.$$
We can use (1) to perform the integration by parts because $\frac1{1+\cos x}$ is the derivative of $\tan\frac x2$:
$$I=\int_0^{\pi/2}\frac{x+\sin x}{1+\cos x}\mathrm{d}x=\left[\left(\tan\frac x2
\right)\left(x+\sin x\right)\right]_0^{\pi/2}-\int_0^{\pi/2}\tan\frac x2(1+\cos x)\mathrm{d}x.$$
Using (1) again, we observe that the integrand of the right-hand term is simply $\sin x$. As $\int_0^{\pi/2}\sin x\;\mathrm{d}x=1$ one obtains the result of the integral: $I=1\times(\frac\pi2+1)-1=\frac\pi2$. 
