Antiderivative of $\lfloor\frac{2}{1+x^2}\rfloor$ I was supposed to find the definite integral $\int_{0}^{\infty}\lfloor\frac{2}{1+x^2}\rfloor\mathrm dx$ which can done easily by sketching the graph of $y=\frac{2}{1+x^2}$ and comes out to be $1$.

$\int\lfloor\frac{2}{1+x^2}\rfloor\mathrm dx$ where $[.]$ represents the floor function

I was wondering if there is a closed form anti-derivative for the function, by writing the integral as sum of integrals on intervals where the floor function can be removed from the integrand. And if there isn't a closed form, should this be written as a piecewise function with the values in its range being the possible definite integral values it can give on certain intervals. I have no idea how to proceed. Any hints would be appreciated. Thanks
 A: You sketched the graph of $f$ where $f(x)=\left\lfloor\frac{2}{1+x^2}\right\rfloor$. So you can sketch a graph of $F(x)=\int_0^x \left\lfloor\frac{2}{1+t^2}\right\rfloor\, dt$. You will see that it is piecewise linear, sort of like ___/--- if you will allow the ASCII art approximation. One way to express that function without using piecewise function notation happens to be: $$F(x)=\frac{\lvert x+1\rvert-\lvert x-1\rvert}2=\frac{2x}{\lvert x+1\rvert+\lvert x-1\rvert}$$
This is not really an "antiderivative". The derivative of $F$ is not $f$, because of the semi-continuous behaviour of $f$ at $-1$, $0$, and $1$.  The differences are that (a) $F'(0)=1$, whereas $f(0)=2$. And (b), $F'(-1)$ and $F'(1)$ are undefined, where $f(-1)=f(1)=1$. But aside from those three places, $F'(x)=f(x)$.
In fact you can't have a true antiderivative of $f$. That is you cannot have a differentiable-everywhere function $F$ such that $F'=f$. Because if $F$ is differentiable, then $F$ is continuous. $F$ must be linear with slope $1$ in a punctured neighborhood of $0$, so $F'(0)$ must equal $1$. But $f(0)$ is $2$. So it's not really possible. 
