Find the value of $$\int_{0}^{x} \lfloor \cot(t)\rfloor\,dt$$ where $x \in [(4n+1)\frac {\pi}{2},(4n+3)\frac {\pi}{2}]$ and $n\in N $ Also $\lfloor\cdot \rfloor$ represnts the greatest integer function.
I tried this by graphical method but i am unable to obtain the general solution. I succeed only in to obtain the area in period. That is the signed area of given integrand in $ (0,\pi) $ is $-\frac {\pi}{2} $.
I am giving my solution . Please see the image
The exact answer of this question is $(2n+1)\frac {\pi}{2}-x$
Any one can explain. How to obtain it

