Find $\int_0^{2\pi} \frac{x \cos x}{2 - \cos^2 x} dx$. I have to find the integral:
$$\int_0^{2\pi} \frac{x \cos x}{2 - \cos^ 2 x} dx$$
I rewrote it as:
$$\int_0^{2\pi} \frac{x \cos x}{1 + \sin^ 2 x} dx$$
But nothing further. I plugged it in a calculator and the result was $0$. I can see that the following relation holds:
$$f(-x) = -f(x)$$
For
$$ f: [0, 2\pi] \rightarrow \mathbb{R} \hspace{2cm} f(x) = \frac{x \cos x}{1 + \sin^2 x}$$
so that means that the function is an odd function. So if the interval $[0, 2\pi]$ is a symmetric interval for $f(x)$ then the result would be $0$.
I can see that the interval $[0, 2\pi]$ is symmetric for $\sin x$ and for $\cos x$, so it is not far fetched to believe it is symmetric for $\dfrac{\cos x}{1 + \sin^2 x}$, but wouldn't multiplying it with $x$ interfere with that symmetry? I don't see why $[0, 2\pi]$ is symmetric for the function
$$f(x) = \frac{x\cos x}{1 + \sin^2 x}$$
How come that $x$ doesn't ruin the symmetry?

We'll use a trick to get rid of the $x$.
As you've noted, $\sin(2\pi -x) = \sin x$, and $\cos(2\pi - x) = \cos x$.
Replacing $x$ with $2 \pi - x$, we get
$$I = \int_0^{2\pi} \frac{x \cos x}{1+\sin^2x} \, dx = \int_0^{2\pi} \frac{(2 \pi - x) \cos x}{1+\sin^2x} \, dx.$$
Adding the integral to itself, we get
$$2I = \int_0^{2\pi} \frac{2\pi \cos x}{1+\sin^2x} \, dx.$$
From here, the substitution $u = \sin x$ finishes quickly, because $\frac{du}{dx} = \cos x$, giving
$$\int \frac{2\pi \cos x}{1+\sin^2x} \, dx = 2 \pi \int \frac{1}{1+u^2} \, du = 2\pi \tan^{-1}(u)+c,$$
and so applying the bounds of the integral we obtain the desired result.
