Let the integrand be:
\[
f(x) = \frac{2x(1 + \sin x)}{1 + \cos^2 x}
\]
We split this into even and odd function:
\[
\begin{align}
f(-x) = \frac{2(-x)(1 + \sin(-x))}{1 + \cos^2(-x)} = \frac{-2x(1 - \sin x)}{1 + \cos^2 x}
\]
So:
\[
\begin{align}
f(x) + f(-x) = \frac{2x(1 + \sin x) - 2x(1 - \sin x)}{1 + \cos^2 x}
= \frac{4x \sin x}{1 + \cos^2 x}
\]
But to evaluate \( \int_{-\pi}^{\pi} f(x) dx \), note that \( f(x) \) is an even function. So:
\[
\int_{-\pi}^{\pi} f(x) dx = 2 \int_0^{\pi} f(x) dx
\]
After evaluating directly or by substitution (using symmetry and known integrals), we find:
\[
\int_{-\pi}^{\pi} f(x)\, dx = \pi^2
\]