We know that $\forall x \in [2,+\infty)$,
$$\frac{x^6(1+\cos^2 x)}{(x-1)^2(x+1)^2x^a} \leq \frac{2x^6}{(x-1)^2(x+1)^2x^a}$$
And it's easy to prove that $\int_2^{\infty} \frac{2x^6}{(x-1)^2(x+1)^2x^a} dx$ converges if and only if $a>3$.
But is it legitimate to conclude that our first integral converges if and only if $a>3$? The Comparison Criterion says that if $0 \leq f\leq g$, then, if $g$ converges, $f$ converges. But the converse isn't valid. Are we losing any possible values for $a$?
For example, the following equivalence holds:
$$\int_2^{\infty} \frac{x^6(1+\cos^2 x)}{(x-1)^2(x+1)^2x^a} dx = \int_2^{\infty} \frac{2x^6}{(x-1)^2(x+1)^2x^a} dx - \int_2^{\infty} \frac{x^6(\sin^2 x)}{(x-1)^2(x+1)^2x^a} dx$$
Shouldn't we prove that $\int_2^{\infty} \frac{x^6(\sin^2 x)}{(x-1)^2(x+1)^2x^a} dx$ converges to $0$?
I'm confused.
It is true that $\frac{x^6(1+\cos^2 x)}{(x-1)^2(x+1)^2x^a} \leq \frac{2x^6}{(x-1)^2(x+1)^2x^a}$. What is also true is that $\frac{x^6}{(x-1)^2(x+1)^2x^a} \leq \frac{x^6(1+\cos^2 x)}{(x-1)^2(x+1)^2x^a}$. Altogether, this inequality is $$\frac{x^6}{(x-1)^2(x+1)^2x^a} \leq \frac{x^6(1+\cos^2 x)}{(x-1)^2(x+1)^2x^a} \leq \frac{2x^6}{(x-1)^2(x+1)^2x^a}$$
The left-hand side diverges for $a \leq 3$. The right-hand side converges for $a > 3$. Therefore, the integral converges if and only if $a > 3$.