I am trying to brush up on calculus and picked up Peter Lax's Calculus with Applications and Computing Vol 1 (1976) and I am trying to solve exercise 5.2 a) in the first chapter (page 29):
How large does $n$ have to be in order for
$$ S_n = \sum_{j = 1}^n \frac{1}{j^2}$$
to be within $\frac{1}{10}$ of the infinite sum? within $\frac{1}{100}$? within $\frac{1}{1000}$? Calculate the first, second and third digit after the decimal point of $ \sum_{j = 1}^\infty \frac{1}{j^2}$
Ok so the first part is easy and is derived from the chapter's text:
$ \forall j \geq 1 $ we have $\frac{1}{j^2} \leq \frac{2}{j(j+1)}$ and therefore:
\begin{equation} \begin{aligned} \forall n \geq 1,\quad \forall N \geq n +1 \quad S_N - S_n &\leq 2\sum_{k = n+1}^N \frac{1}{k(k+1)}\\ &= 2\sum_{k = n+1}^N \left\{ \frac{1}{k}- \frac{1}{k+1}\right\}\\ &= 2 \left[ \frac{1}{n+1} - \frac{1}{N+1}\right] \end{aligned} \end{equation}
Now because we know $S_N$ converges to a limit $l$ from below and by the rules of arithmetic for convergent sequences we have:
$$ 0 \leq S - S_n \leq \frac{2}{n+1}$$
So if we want $S_n$ to be within $\frac{1}{10^k}$ of $S$ it suffices to have:
$$ n \geq N_{k} = 2\times10^k -1$$
But the second part of the question puzzles me. I would like to say that computing $S_{N_{k}}$ is enough to have the first $k$ decimal points of $S$. But earlier in the chapter (on page 9), there is a theorem that states:
if $a$ and $b$ have the same integer parts and the same digits up to the $m$-th, then they differ by less than $10^{-m}$, $$ |a - b | < 10^{-m}$$ and the converse is not true.
And the example of $a = 0.29999...$ and $b = 0.30000...$ indeed shows that two numbers can differ by less than $2\times 10^{-5}$ and yet have all different first digits.
So I think there is something missing in my "demonstration" above. How to show that I indeed "catch" the first $k$ digits of $S$ by computing $S_{N_k}$?
Thanks!
If you get an answer like $1.29999$, you'll simply have to compute more terms of the series, but in all likelihood, you'll be able to make a definite statement. Try to compute the first four digits after the decimal point. You may be doubtful about the fourth digit, but in all likelihood, you'll be able to make a definite statement about the first three. With $n=20000$ I got $$\sum_{k=1}^{20000}\frac1{n^2}=1.6448840680982086$$ We can't be sure if the value is $1.6448\dots$ or $1.6449\dots$ but we know it's $1.644\dots$.
(In point of fact, the value is $\frac{\pi^2}6\approx1.6449340668482264$).