The integral diverges Prove that $\displaystyle \int_{0}^{\pi}\left \lfloor \cot x \right \rfloor\,dx$ diverges.
Proof:(or some part of it anyway)
$$\begin{aligned}
\int_{0}^{\pi} \left \lfloor \cot x \right \rfloor\,dx&\overset{u=\cot x}{=\! =\! =\! =\!}-\int_{-\infty}^{\infty}\frac{\left \lfloor u \right \rfloor}{1+u^2}\,du 
\end{aligned}$$
Now, i want to write the last integral in series that is: $\displaystyle -\sum_{k=-\infty}^{\infty}n\int_{k}^{k+1}\frac{1}{x^2+1}\,dx$ but I don't like that $-\infty$ over there... 
Is there another way to do this?? Or if it works my way (that I doubt) how can I adjust it?
 A: It is rather easy to show that $\cot(x) > \dfrac1x - 1$ for $x \in (0,\pi/2)$. Hence, $$\lfloor \cot(x) \rfloor \geq \dfrac1x - 2$$
Hence,
$$\int_0^{\pi/2} \lfloor \cot(x) \rfloor dx > \int_0^{\pi/2} \left(\dfrac1x-2\right)dx$$
Now conclude what you want.
A: For $x\to 0$, we have $\cot x\sim \frac{1}{x}$ and since $\int_0^{\pi}\frac{1}{x}dx$ diverges, also your integral diverges.
A: Notice for any $x \in (0,\frac{\pi}{2}) \setminus \{ \arctan\left(\frac1n\right) : n \in \mathbb{Z}_{+} \}$, we have
$$
\lfloor \cot x \rfloor + \lfloor \cot (\pi - x) \rfloor 
= \lfloor \cot x \rfloor + \lfloor -\cot x \rfloor
= -1
$$
The integral at hand does exist as an improper Riemann integral (in the symmetric sense).   More precisely,
$$\begin{align}
\int_0^\pi \lfloor \cot x \rfloor dx\;\;
&\stackrel{def}{=}
\lim_{\epsilon\to 0^{+}} \int_{\epsilon}^{\pi - \epsilon} \lfloor \cot x \rfloor dz
= \lim_{\epsilon\to 0^{+}}\int_{\epsilon}^{\pi/2} \big(\lfloor \cot x \rfloor + \lfloor \cot (\pi - x) \rfloor\big) dx\\
&= -\lim_{\epsilon\to 0^{+}}\int_{\epsilon}^{\pi/2} dx
= -\frac{\pi}{2}
\end{align}
$$
A: You could use
\begin{align*}
\cot x - 1 & \leq \lfloor \cot x \rfloor & \leq \cot x \\
\Rightarrow \int_{a}^{b} (\cot x - 1) \mathrm{d} x & \leq \int_{a}^{b} \lfloor \cot x \rfloor \mathrm{d}x & \leq \int_{a}^{b} \cot x \mathrm{d} x
\end{align*}
So $\int_{a}^{b} \cot x \mathrm{d}x - (b - a) \leq \int _{a}^{b} \lfloor \cot x \rfloor \mathrm{d}x \leq \int_{a}^{b} \cot x \mathrm{d}x$. It should follow.
