(b) Use part (a) to deduce the formula

$$\int_0^\pi \frac{x \sin x}{1 + \cos^2 x} \, dx = \pi \int_0^1 \frac{dx}{1 + x^2}.$$