Integral test for convergence? Why does the series' terms have to be non-negative to use the integral test?
Consider the series:
$$\sum_{n = 1}^{\infty}\frac{n\cos n - \sin n}{n^2}$$
Even though it has negative terms, why can't the integral test be used with the integral being:
$$\int_1^\infty\frac{x\cos x - \sin x}{x^2}$$
Since the series can be interpreted as the Riemann sum of the function above?

Indeed, a more general version of the Integral Test holds.
Let $f(x)$ be a monotone function for $x\ge x_0$. Then, the infinite series $\sum f(n)$ converges if and only if the improper integral $\int^\infty f(x)dx$ converges.
