3

This is for an introductory numerical analysis class. The answer shouldn't be too complicated, but if you have one, feel free to post it.

Figure out what $n$ should be such that $$\sum_{k=n+1}^\infty {1\over k^2}<10^{-8}.$$


My Simple Algebraic Attempt

We know that

$$\sum_{k=1}^\infty {1\over k^2} = \sum_{k=1}^n {1\over k^2} + \sum_{k=n+1}^\infty {1 \over k^2} \implies \sum_{k=n+1}^\infty {1 \over k^2} = \sum_{k=1}^\infty {1\over k^2} - \sum_{k=1}^n {1\over k^2}$$

And

$$\sum_{k=1}^\infty {1\over k^2} = \zeta(2)={\pi^2 \over6}$$

So,

$$\sum_{k=n+1}^\infty {1 \over k^2} = {\pi^2 \over6} - \sum_{k=1}^n {1\over k^2}$$

Then,

$$\sum_{k=n+1}^\infty {1 \over k^2} < 10^{-8} \implies {\pi^2 \over6} - \sum_{k=1}^n {1\over k^2} < 10^{-8} \implies \sum_{k=1}^n {1\over k^2} > {\pi^2 \over6} - 10^{-8}$$

I'm currently trying to brute force an answer to the last expression, but is there a better way to do this?

  • Is there any additional information to the question? In particular, is it sufficient to find any $n$ such that the inequality holds, or must we find the minimal $n$ ? – Ragib Zaman Sep 09 '12 at 17:25
  • Hm, it doesn't say to find a minimal $n$. The assignment doesn't give much more information. – Brandon Amos Sep 09 '12 at 17:30

3 Answers3

5

Since $\displaystyle \frac{1}{k^2} < \frac{1}{(k-1)k } = \frac{1}{k-1} - \frac{1}{k}$ we can bound your term by a telescoping sum: $$\sum_{k=n+1}^{\infty} \frac{1}{k^2} < \left(\frac{1}{n} - \frac{1}{n+1} \right)+\left(\frac{1}{n+1} - \frac{1}{n+2} \right)+\left(\frac{1}{n+2} - \frac{1}{n+3} \right) + \cdots = \frac{1}{n}$$ so $n=10^8$ works. The estimate we used isn't too weak, and this $n$ shouldn't be much worse than the minimal $n.$

Ragib Zaman
  • 35,127
5

Hint: $$ \sum_{k=n+1}^\infty\frac1{k^2}\le\int_n^\infty\frac1{x^2}\mathrm{d}x=\frac1n $$

robjohn
  • 345,667
2

A simple idea is to replace the remainder of the series by the corresponding integral : $$\sum_{k=N+1}^\infty \frac 1{k^2}\sim \int_{N+1}^\infty \frac {dk}{k^2}$$ or get the inequality : $$\sum_{k=N+1}^\infty \frac 1{k^2}< \int_N^\infty \frac {dk}{k^2}=\frac 1N$$

If you wish more precision you may use Euler Maclaurin formula and get (for $x=2$ in your case) : $$\zeta(x)-\sum_{k=1}^N \frac 1{k^x} \sim \frac 1{(x-1)N^{x-1}}-\frac 1{2\,N^x} + \frac x{12\,N^{x+1}} - \frac {x\,(x+1)(x+2)}{720\,N^{x+3}} +\frac {x\,(x+1)(x+2)(x+3)(x+4)}{30240\,N^{x+5}} +...$$ (the constants $\ \frac 1{2},\ \frac 1{12},\ \frac 1{720}$ are $\frac {|B_n|}{n!}$ with $B_n$ a Bernoulli number)

This is an asymptotic expansion and the error made corresponds to the first term omitted.

Raymond Manzoni
  • 43,021
  • 5
  • 86
  • 140
  • 2
    For the exponent $2$, I did this very thing in this answer. – robjohn Sep 09 '12 at 18:03
  • @robjohn: I like this method (much simpler to implement than Riemann-Siegel and with a much more direct error term) and the numerical details that you showed in your answer (+1: I fear I missed that thread...). This formula has the interesting feature of becoming exact for negative integer $x$ (only the first terms are not $0$). – Raymond Manzoni Sep 09 '12 at 18:15
  • 1
    Yes, because the EMS formula terminates for polynomials. More generally, I showed in this answer that if the Fourier transform of a function is supported within $[-1,1]$, then the EMS formula converges for that function. – robjohn Sep 09 '12 at 22:34