Why is the integral of $\frac1{x^2}$ from $1$ to $\infty$ not the same as the infinite sum from $1$ to $\infty$?

Studying series I am a bit confused on this point. The infinite sum of $1/x^2$ from $1$ to $\infty$ was proved by Euler to be $\pi^2$ divided by $6$:

$$\sum_{x=1}^\infty\frac 1 {x^2}=\frac {\pi^2} 6$$

But if I integrate from $1$ to $\infty$ of the same entity namely $1/x^2$ it is $1$. Correct..? Unless I did it wrong. $$\int_1^\infty\frac 1 {x^2}dx=1$$ How can this be since by integrating it seems we are adding a lot more numbers to cover the same area so we should by all means get the same thing or something at least as large as $\pi^2/6$?

• Why would anyone expect them to be the same? Dec 24, 2017 at 16:49
• @LordSharktheUnknown, please read his entire question. Dec 24, 2017 at 16:54
• The relationship between the sum and the integral is given by en.wikipedia.org/wiki/Euler–Maclaurin_formula. they differ because rectangles are not curved. The area in the rectangles is not the area under the curve. Dec 24, 2017 at 16:54
• @Sedumjoy, please read your edited question for how to write the integral and sum :). Dec 24, 2017 at 17:00
• I agree with @LordSharktheUnknown, it is not natural to expect that $$f(x)=\frac{1}{x^2},\qquad g(x)=\frac{1}{\lfloor x\rfloor ^2}$$ have the same integral over $(1,+\infty)$, also because $g(x)\geq f(x)$. Dec 24, 2017 at 17:55

Note that $$\int_1^\infty \frac{1}{x^2}\leq\sum_1^\infty \frac{1}{n^2}\tag{1}$$ by considering a Riemann sum with left endpoints. Here is a picture (for the case of $1/x$ but a similar picture can be drawn for this case as well). See this picture. Image credits go to Wikipedia.

• +1 For the picture.. It illustrates the point better :) I will add it to my answer
– Ant
Dec 24, 2017 at 16:59
• no its the wrong graph, should be a graph of $\frac{1}{x^2}$, right? Dec 24, 2017 at 17:00
• @FoobazJohn, Just wondering, what program did you use to make this picture? Dec 24, 2017 at 17:00
• @mathreadler, yeah you're right, though the basic insight remains the same. Dec 24, 2017 at 17:01
• @mathreadler Yes I commented that it is for $1/x$ but a similar picture can be drawn for the case $1/x^2$. Dec 24, 2017 at 17:01

When you do the sum, you sort of approximate the area with rectangles of base length equal to $1$. Draw the function $1/x^2$ and draw the rectangles with base length 1; you'll see that the area under the rectangles is much bigger than the area under the function $1/x^2$

Here is an illustration for the function $1/x$, but it's essentially the same as in the $1/x^2$ case. (Thanks to @FoobazJohn) The integral adds a lot more numbers, but these numbers are multiplied by something very small. The end result is that the integral represents the area under the $1/x^2$ curve, which is less than the area under the rectangles.

Let us compare $1$ and $\int_1^2\frac1{x^2}\,\mathrm dx$. Since $\bigl(\forall x\in(1,2]\bigr):\frac1{x^2}<1$, $\int_1^2\frac1{x^2}\,\mathrm dx<1$. For the same reason, $\int_2^3\frac1{x^2}\,\mathrm dx<\frac14$, $\int_3^4\frac1{x^2}\,\mathrm dx<\frac19$, and so on. So$$1=\int_1^\infty\frac1{x^2}\,\mathrm dx<\sum_{n=1}^\infty\frac1{n^2}=\frac{\pi^2}6.$$

Note that it is not true that $\int_a^bf(x)\,\mathrm dx$ is the sum of all numbers $f(x)$ with $x\in[a,b]$. Instead, it is the average value of $f$ in $[a,b]$ times $b-a$.

• all three answers are very good in explaining this and I will pick one to close the problem but they are equally good....I feel stupid for not seeing this that I had to ask.... Dec 25, 2017 at 0:59