Formula for the floor function I found the following formula for the floor function:

$$\lfloor x \rfloor = -\frac12+x+\frac{\arctan(\cot\pi x)}{\pi}$$

for all $x$ not an integer.

My question is where I can find the proof of this formula.
It is well-known that the cotangent function has period $\pi$, so that the cotangent of $\pi x$ has period $1$.

With the usual definition of the arc tangent, you get a number between $-\frac\pi2$ and $\frac\pi2$, or, after division by $\pi$, a number between $-\frac12$ and $\frac12$.

Hence,

$$\frac{\arctan\cot\pi x}\pi=\frac{\arctan\tan\left(\dfrac\pi2-\pi x\right)}\pi=\frac12-x\bmod1$$

Now,

$$-\frac12+\frac12+x-x\bmod1=x-\{x\}=\lfloor x\rfloor.$$



Anyway, the formula is virtually useless, as it is undefined for integer $x$.
The arctangent function is multivalued - when thought of as a function of a complex variable, its domain is a Riemann surface with multiple sheets joined at branch cuts in the complex plane. So your formula is not well-defined unless you specify which branch you are considering to be the principal branch. The most natural way to specify the usual principal branch of the arctangent function basically uses the idea of the floor function anyway, so your formula "for" the floor function is correct but somewhat circular.