[Math] Does an integral converge/diverge if its sum converges/diverges

calculussequences-and-series

I'm sure this has been asked many times before, sorry if it's a duplicate, but when googling this I mostly found instructions on how to do the integral test.

So I was given an integral $$\int_{1}^{\infty} f(x) dx$$
and asked to find whether it converges/diverges. I figured out that it diverges, and the next task was to find the sum
$$\sum_{n=1}^{\infty} f(n) $$ where $f(x)$ was the same expression in both tasks. So I concluded that since the integral diverges, the sum also diverges by the integral test. But assume I was given the sum of the series first, and let's say I were to use a limit-comparison test to figure out that the series diverges. If the next task was to calculate the integral, would it still hold to conclude that since the sum of the series $a_n$ diverges, then so does the integral, or does the implication not go both ways? I hope my question was clear, thanks in advance.

edit: Original $f(x)$ was $arctan(\frac{1}{x})$ and $f(n) = arctan(\frac{1}{n})$

Best Answer

If you don't have information about the values of $f$ between integer points, you can't establish any relationship between the sum and the integral.

@Bungo and @Goddard have given an example of convergent sum and divergent integral.

Example of divergent sum and convergent integral:

Define $f$ as follows:

  • $f(n)=\frac1n$ for $n\in\Bbb N$
  • $f(x)=0$ if $[x]+\frac1{[x]}\le x \le[x]+1-\frac1{[x]+1}$
  • Define $f$ in the intervals $[n-\frac1n,n+\frac1n]$ to be piecewise linear and continuous.

Informally, this is a function which is $0$ except around of integer points, where the graph renders "peaks" of height and base $1/n$.

Then $\sum_{n=1}^\infty f(n)=\sum_{n=1}^\infty\frac1n$, but $\int_1^\infty f(x)dx<\sum_{n=1}^\infty\frac1{n^2}$

Notation: Here, $[x]$ denotes the floor (integer part) of $x$.

Related Question