Find the exact value of $\int_{0}^{2}x[\frac{1}{x}]dx$. Find the exact value of $\int_{0}^{2}x[\frac{1}{x}]dx$.
Let $[x]$ denote $\lceil{x-\frac{1}{2}}\rceil$.
Using Desmos, I got $2.46736022133$ and WolframAlpha does not give me a solution. My intuition tells me that it might be possible to find an exact value using Trapezoidal Reimann Sums but I am not really sure how to go about doing it. After my attempt, I got stuck but I was at a point where I could plug it into WolframAlpha and it gave me $\frac{\pi^2}{4}$. Why did it come out so nicely?
My attempt:
Where $A_n$ denotes the area of the $nth$ trapezoid from the right:
$$A=\frac{h}{2}(a+b)$$
$$A_n=\frac{\frac{2}{2n-1}-\frac{2}{2n+1}}{2}(\frac{2n}{2n-1}+\frac{2n}{2n+1})$$
$$A_n=\frac{\frac{4n+2}{4n^{2}-1}-\frac{4n-2}{4n^{2}-1}}{2}\left(\frac{4n^{2}+2n}{4n^{2}-1}+\frac{4n^{2}-2n}{4n^{2}-1}\right)$$
$$A_n=\frac{2}{4n^{2}-1}\left(\frac{8n^{2}}{4n^{2}-1}\right)$$
$$A_n=\frac{16n^{2}}{\left(4n^{2}-1\right)^{2}}$$
Then:
$$\int_{0}^{2}x[\frac{1}{x}]dx=\sum_{n=1}^{\infty}A_n=\sum_{n=1}^{\infty}\frac{16n^{2}}{\left(4n^{2}-1\right)^{2}}$$
I do not know how to solve this infinite summation so I plugged it into WolframAlpha and it gave me $\frac{\pi^2}{4}$. How did it get to this conclusion? Is there a more efficient way to solve this?
 A: Continuing where you left off. Note
\begin{align*}
&\sum_{n=1}^\infty\frac{16n^2}{4n^2-1} \\
&= 2\sum_{n=1}^\infty n\left(\frac{1}{(2n-1)^2} - \frac{1}{(2n+1)^2}\right)\\
&= 2\sum_{n=1}^\infty \left(\sum_{k=1}^n 1\right) \left(\frac{1}{(2n-1)^2} - \frac{1}{(2n+1)^2}\right)\\
&= 2\sum_{n=1}^\infty \sum_{k=1}^n \left(\frac{1}{(2n-1)^2} - \frac{1}{(2n+1)^2}\right)\\
&= 2\sum_{k=1}^\infty \sum_{n=k}^\infty \left(\frac{1}{(2n-1)^2} - \frac{1}{(2n+1)^2}\right)\\
&= 2\sum_{k=1}^\infty \sum_{n=k}^\infty \left(\frac{1}{(2n-1)^2}\right) - \sum_{n=k+1}^\infty\left(\frac{1}{(2n-1)^2}\right)\\
&= 2\sum_{k=1}^\infty \frac{1}{(2k-1)^2} \\
&= 2\left(\sum_{k=1}^\infty \frac{1}{k^2} - \sum_{k=1}^\infty \frac{1}{(2k)^2}\right) \\
&= 2\cdot\frac{3}{4}\sum_{k=1}^\infty\frac{1}{k^2} \\
&= 2\cdot\frac{3}{4}\cdot\frac{\pi^2}{6} = \frac{\pi^2}{4}
\end{align*}
A: *

*If $[x]:=n$ iff $n-\tfrac12< x\leq n+\tfrac12$ (i.e. $[x]=\lceil x-\tfrac12\rceil$, which seems to be what the OP had in mind), then
\begin{align}
\int^2_0  x[1/x]\,dx & =\sum^\infty_{n=1}\int_{[\tfrac{2}{2n+1},\tfrac2{2n-1})}nx\,dx\\
&=\sum^\infty_{n=1}\Big(\frac{2n-1+1}{(2n-1)^2}-\frac{2n+1-1}{(2n+1)^2}\Big)\\
&=\sum^\infty_{n=1}\Big(\frac{1}{2n-1}-\frac{1}{2n+1}+\frac{1}{(2n-1)^2}+\frac{1}{(2n+1)^2}\Big)\\
&=1+2\sum^\infty_{n=1}\frac{1}{(2n-1)^2}-1=2\Big(\sum^\infty_{n=1}\frac{1}{n^2}-\frac14\sum^\infty_{n=1}\frac1{n^2}\Big)\\
&=\frac{\pi^2}{4}
\end{align}


*The same estimate holds when $[x]:=n$ iff $n-\tfrac12 \leq x<n+\tfrac12$ (i.e., $[x]=\lfloor x+\tfrac12\rfloor$) since $\lceil x-\tfrac12\rceil=\lfloor x+\tfrac12\rfloor$ a.s.


*

*If by $[\cdot]$ the OP means the ceiling function $\lceil x\rceil=n$ where $n-1<x\leq n$, then
$$\int^2_0 x\lceil 1/x \rceil\,dx=\int^1_0  x\lceil 1/x \rceil\,dx +\int^2_1 x\,dx=\int^1_0 x\lceil 1/x\rceil \,dx + \frac32$$
From
\begin{align}
\int^1_0  x\lceil 1/x \rceil\,dx & =\sum^\infty_{n=2}\int_{[\tfrac{1}{n},\tfrac1{n-1})}nx\,dx=\sum^\infty_{n=2}\frac{n}{2}\Big(\frac{1}{(n-1)^2}-\frac{1}{n^2}\Big)\\
&=\sum^\infty_{n=2}\frac{2n-1}{2n(n-1)^2}=\sum^\infty_{n=2}\frac{1}{(n-1)^2}+\frac{n-1-n}{2n(n-1)^2}\\
&=\frac12\sum^\infty_{n=1}\frac{1}{n^2}+\frac12\sum^\infty_{n=2}\frac{1}{n(n-1)} =\frac{\pi^2}{12}+\frac12
\end{align}
The value of the integral in this case is  $\frac{\pi^2}{12}+2\approx 2.822467$


*If the OP means $[\cdot]$ to be the integer part function (floor function) $\lfloor x\rfloor =n$ iff $n\leq x<n+1$, then
$$\int^2_0 x\lfloor 1/x \lfloor\,dx=\int^1_0  x\lfloor 1/x \rfloor\,dx +\int^2_1 0\cdot x\,dx=\int^1_0 x\lfloor 1/x\rfloor \,dx $$
The value of the integral is then given by
\begin{align}
\int^1_0  x\lfloor 1/x \rfloor\,dx & =\sum^\infty_{n=1}\int_{(\tfrac{1}{n+1},\tfrac1n]}nx\,dx=\sum^\infty_{n=1}\frac{n}{2}\Big(\frac{1}{n^2}-\frac{1}{(n+1)^2}\Big)\\
&=\sum^\infty_{n=1}\frac{2n+1}{2n(n+1)^2}=\sum^\infty_{n=1}\frac{1}{(n+1)^2}+\frac{n+1-n}{2n(n+1)^2}\\
&=\frac12\sum^\infty_{n=2}\frac{1}{n^2}-\frac12\sum^\infty_{n=1}\frac{1}{n(n+1)} =\frac{\pi^2}{12}
\end{align}
A: Another way to get the sum of the series
$\displaystyle\sum_{n=1}^{\infty}\frac{16n^2}{\left(4n^2-1\right)^2}$
without double summations and without switching the order of the sums.
$\displaystyle\sum_{n=1}^N\frac{16n^2}{\left(4n^2-1\right)^2}=$
$=\displaystyle\sum_{n=1}^N\left[\frac{2n}{\left(2n-1\right)^2}-\frac{2n}{\left(2n+1\right)^2}\right]=$
$=\displaystyle2\sum_{n=1}^N\frac1{\left(2n-1\right)^2}+\sum_{n=1}^N\left[\frac{2(n-1)}{\left(2n-1\right)^2}-\frac{2n}{\left(2n+1\right)^2}\right]=$
$=\displaystyle2\left(\sum_{n=1}^{2N-1}\frac1{n^2}-\sum_{n=1}^{N-1}\frac1{(2n)^2}\right)+\left[0-\frac2{3^2}+\frac2{3^2}-\frac4{5^2}+\ldots+\\\quad+\frac{2(N-1)}{\left(2N-1\right)^2}-\frac{2N}{\left(2N+1\right)^2}\right]=$
$=\displaystyle2\left(\sum_{n=1}^{2N-1}\frac1{n^2}-\frac14\sum_{n=1}^{N-1}\frac1{n^2}\right)-\frac{2N}{\left(2N+1\right)^2}\,.$
Hence ,
$\displaystyle\sum_{n=1}^{\infty}\frac{16n^2}{\left(4n^2-1\right)^2}=$
$=\displaystyle\lim_{N\to\infty}\left[\sum_{n=1}^N\frac{16n^2}{\left(4n^2-1\right)^2}\right]=$
$=\displaystyle\lim_{N\to\infty}\left[2\left(\sum_{n=1}^{2N-1}\frac1{n^2}-\frac14\sum_{n=1}^{N-1}\frac1{n^2}\right)-\frac{2N}{\left(2N+1\right)^2}\right]=$
$=\displaystyle2\left(\sum_{n=1}^{\infty}\frac1{n^2}-\frac14\sum_{n=1}^{\infty}\frac1{n^2}\right)=$
$=\displaystyle2\left(\frac{\pi^2}6-\frac14\!\cdot\!\frac{\pi^2}6\right)=\displaystyle2\left(1-\frac14\right)\frac{\pi^2}6=$
$\displaystyle=2\!\cdot\!\frac34\!\cdot\!\frac{\pi^2}6=\frac{\pi^2}4\,.$
A: An alternate solution:
$$
\begin{align}
\int_{0}^{2}x\operatorname{round}\left(\frac{1}{x}\right)dx &= \int_0^2 x\Biggl\lfloor{\frac{1}{x}+\frac{1}{2}\Biggr\rfloor}dx \tag{1}\\
&= 8\int_{1}^{\infty}\frac{\lfloor{x\rfloor}}{\left(2x-1\right)^{3}}dx \tag{2}\\
&= 8\sum_{n=1}^{\infty}n\int_{n}^{n+1}\frac{dx}{\left(2x-1\right)^{3}} \\
&= 16\sum_{n=1}^{\infty}\frac{n^{2}}{\left(1-4n^{2}\right)^{2}} \\
\end{align}
$$
where in $(1)$ we used the Desmos interpretation $\displaystyle \operatorname{round}\left(\frac{1}{x}\right) := \Biggl\lfloor{\frac{1}{x}+\frac{1}{2}\Biggr\rfloor}$ and in $(2)$ we used the mapping $\displaystyle \frac{1}{x}+\frac{1}{2} \mapsto x$.
Next, let $f$ be a piecewise smooth function on $[0,L]$. Then the Fourier sine expansion is given by
$$f\left(x\right)\ =\ \sum_{n=1}^{\infty}b_{n}\sin\left(\frac{\pi nx}{L}\right)$$
where we have the sequence
$$b_{n}=\frac{2}{L}\int_{0}^{L}f\left(x\right)\sin\left(\frac{\pi nx}{L}\right)dx.$$
Let $f(x) = \cos(x)$ and $L = \dfrac{\pi}{2}$. Then using some basic integration, we can prove that
$$b_{n}=\frac{4}{\pi}\int_{0}^{\frac{\pi}{2}}\cos\left(x\right)\sin\left(2nx\right)dx\ =\ \frac{4}{\pi}\cdot\frac{2n}{4n^{2}-1}.$$
This means
$$
\begin{align}
\cos\left(x\right) &= \frac{4}{\pi}\sum_{n=1}^{\infty}\frac{2n}{4n^{2}-1}\sin\left(2nx\right) \\
\implies \cos^2(x) &=  \frac{8}{\pi}\sum_{n=1}^{\infty}\frac{n\cos\left(x\right)\sin\left(2nx\right)}{4n^{2}-1} \\
\implies \int_{0}^{\frac{\pi}{2}}\cos^{2}\left(x\right)dx &= \frac{8}{\pi}\sum_{n=1}^{\infty}\frac{n}{4n^{2}-1}\int_{0}^{\frac{\pi}{2}}\cos\left(x\right)\sin\left(2nx\right)dx \\
&= \frac{8}{\pi}\sum_{n=1}^{\infty}\frac{n}{4n^{2}-1}\cdot\frac{2n}{4n^{2}-1}. \\
&= \frac{16}{\pi}\sum_{n=1}^{\infty}\frac{n^{2}}{\left(4n^{2}-1\right)^{2}} \\
\end{align}
$$
But $\displaystyle \int_{0}^{\frac{\pi}{2}}\cos^{2}\left(x\right)dx=\frac{\pi}{4}$. By transitivity, we get
$$\frac{\pi}{4}=\frac{16}{\pi}\sum_{n=1}^{\infty}\frac{n^{2}}{\left(4n^{2}-1\right)^{2}}.$$
Therefore,
$$\int_{0}^{2}x\operatorname{round}\left(\frac{1}{x}\right)dx = \frac{\pi^{2}}{4}.$$
A: $$\frac{16 n^2}{\left(4 n^2-1\right)^2}=-\frac{1}{2 n+1}+\frac{1}{(2 n+1)^2}+\frac{1}{2 n-1}+\frac{1}{(2 n-1)^2}$$
$$\sum_{n=1}^p\frac{16 n^2}{\left(4 n^2-1\right)^2}=\frac{1}{2} \left(\psi ^{(0)}\left(\frac{3}{2}\right)-\psi
   ^{(0)}\left(p+\frac{3}{2}\right)\right)+$$
$$\frac{1}{8} \left(-2 \psi ^{(1)}\left(p+\frac{3}{2}\right)+\pi
   ^2-8\right)+$$ $$\frac{1}{2} \left(\psi ^{(0)}\left(p+\frac{1}{2}\right)-\psi
   ^{(0)}\left(\frac{1}{2}\right)\right)+
\frac{1}{8} \left(\pi ^2-2 \psi
   ^{(1)}\left(p+\frac{1}{2}\right)\right)$$
Using the asymptotics
$$\sum_{n=1}^p\frac{16 n^2}{\left(4 n^2-1\right)^2}=\frac{\pi ^2}{4}-\frac{1}{p}+\frac{1}{2
   p^2}+O\left(\frac{1}{p^3}\right)$$
