Proving an integral using a series If $f:(0,1]\rightarrow \textbf {R}$ is defined by $f(x)=2nx$ for $\frac{1}{n+1}\leq x \leq \frac 1n$ and $n$ is a natural number, assuming that $\sum_{k=1}^{k=\infty}1/k^2=\pi^2/6$,  show that $\int_0^1 f(x)dx=\pi^2/6$.
So I wrote the summation of the integral from $x=\frac{1}{n+1}$ to $x=\frac{1}{n}$ of $f(x)dx$. After I integrate I'm left with the infinite series of $\frac{1}{k}-\frac{k}{(k+1)^2}$ from $k=1$ to $k=\infty$? Not sure where to go from here.
 A: Here's a simple way:
$$\begin{align}\int_0^1 dx \, f(x) &= \sum_{n=1}^{\infty} 2 n \int_{1/(n+1)}^{1/n} dx\; x\\ &=  \sum_{n=1}^{\infty} n \left [\frac1{n^2} - \frac1{(n+1)^2} \right ]\\ &= \sum_{n=1}^{\infty} n \left (\frac1{n}-\frac1{n+1}\right )\left (\frac1{n}+\frac1{n+1}\right )\\ &= \sum_{n=1}^{\infty} \frac1{n+1}\left (\frac1{n}+\frac1{n+1}\right )\\ &= \sum_{n=1}^{\infty} \left (\frac1{n(n+1)} + \frac1{(n+1)^2} \right )  \\ &= 1 + \frac{\pi^2}{6}-1 \\ &= \frac{\pi^2}{6}\end{align}$$
A: I feel a bit silly, as I missed the clearly correct way to do this.
As you say, you manipulate the integral into the sum
$$ \sum_{k \geq 1} \frac{1}{k} - \frac{k}{(k+1)^2}.$$
We now use the deep fact that $k = k + 1 - 1$ to finish.
$$ \begin{align}
\sum_{k \geq 1} \frac{1}{k} - \frac{k}{(k+1)^2} &= \sum_{k \geq 1} \frac{1}{k} - \frac{k+1}{(k+1)^2} + \frac{1}{(k+1)^2} \\
&= \sum_{k \geq 1} \frac{1}{k} - \frac{1}{k+1} + \frac{1}{(k+1)^2} \\
&= \sum_{k \geq 1} \frac{1}{k^2} = \frac{\pi^2}{6}.
\end{align}$$
