# How to calculate $S_{n}=\sum_{i=1}^{n}\frac{1}{i^{2}}$ [duplicate]

In math lesson, my teacher told me that Euler once used a very delicate method to calculate $\displaystyle S_{n}=\sum_{i=1}^{n}\frac{1}{i^{2}}$ and wrote a paper about it.

I wonder how to calculate this. I need a precise answer, not the answer that it's less than a number such as 2.

## marked as duplicate by J.R., Did, user127.0.0.1, user63181, Daniel Robert-NicoudFeb 5 '14 at 12:04

For the infinite series: $$\sum _{n=1}^{\infty }\dfrac{1}{n^2}=\dfrac{{\pi }^{2}}{6} \tag{1}$$ you could see Euler's paper "Remarques sur un beau rapport entre les series des puissances tant directes que reciproques" translated into english and open access in this pdf. There are also many other nice derivations of that result on this website here. For the finite sum, note that as the series is absolutely convergent, we can write: \begin{aligned} S_n=\sum _{i=1}^{n}\dfrac{1}{i^2}&=\sum _{i=1}^{\infty }\dfrac{1}{i^2}-\sum _{i=n+1}^{ \infty }\dfrac{1}{i^2}\\ &=\dfrac{{\pi }^{2}}{6}-\sum _{i=1}^{ \infty }\dfrac{1}{(i+n)^2} \end{aligned}\tag{2} then, by the definition of the Polygamma fucntion: $${\frac {\Psi^{(m)} \left(n+1 \right) }{ \left( -1 \right) ^{m+1}m!}}= \sum _{i=1}^{\infty } \dfrac{1}{(i+n)^{m+1}} \tag{3}$$ (2) becomes: $$S_n=\dfrac{{\pi }^{2}}{6}-\Psi^{(2)} \left(n+1 \right) \tag{4}$$