Definite Integration

Evaluate $\displaystyle \int \limits_{0}^{\pi} \dfrac{x}{1 + x} \; dx$


$\begin{aligned} \text{Let } I & = \displaystyle \int \limits_{0}^{\pi} \dfrac{x}{1 + x} \; dx \;\;\; \cdots \; (1) \\\\ & = \displaystyle \int \limits_{0}^{\pi} \dfrac{\pi - x}{1 + \sin \left(\pi - x\right)} \; dx \hspace{3em} \left[\text{Note: } \int \limits_{0}^{a} f\left(x\right) \; dx = \int \limits_{0}^{a} f\left(x - a\right) \; dx\right] \\\\ & = \int \limits_{0}^{\pi} \dfrac{\pi - x}{1 + \sin x} \; dx \;\;\; \cdots \; (2) \end{aligned}$

Adding equations $(1)$ and $(2)$ gives

$\begin{aligned} 2 I & = \int \limits_{0}^{\pi} \dfrac{x + \pi - x}{1 + \sin x} \; dx \\\\ & = \pi \int \limits_{0}^{\pi} \dfrac{dx}{1 + \sin x} \\\\ & = \pi \int \limits_{0}^{\pi} \dfrac{1 - \sin x}{1 - \sin^2 x} \; dx \\\\ & = \pi \int \limits_{0}^{\pi} \dfrac{1 - \sin x}{\cos^2 x} \; dx \end{aligned}$

$\begin{aligned} \implies I & = \dfrac{\pi}{2} \left\{\int \limits_{0}^{\pi} \dfrac{1}{\cos^2 x} \; dx - \int \limits_{0}^{\pi} \dfrac{\sin x}{\cos^2 x} \; dx \right\} \\\\ & = \dfrac{\pi}{2} \left\{\int \limits_{0}^{\pi} \sec^2 x \; dx - \int \limits_{0}^{\pi} \sec x \; \tan x \; dx \right\} \\\\ & = \dfrac{\pi}{2} \left\{\left[\tan x\right]_{0}^{\pi} - \left[\sec x\right]_{0}^{\pi} \right\} \\\\ & = \dfrac{\pi}{2} \left[\tan \pi - \tan 0 - \sec \pi + \sec 0\right] \\\\ & = \dfrac{\pi}{2} \left[0 - 0 + 1 + 1\right] \\\\ & = \dfrac{\pi}{2} \times 2 = \pi \end{aligned}$