Evaluating the definite integral $\int_{-1}^1 \lfloor \arccos x \rfloor \,dx$ involving the greatest integer function 
Evaluating the definite integral $$\int_{-1}^1 \lfloor \arccos x \rfloor \,dx .$$

I tried it but unable to do as it is discontinuous. Somebody told me that you should do this by drawing graph---how?
Can anybody please give me the start?

 A: Hint:
Use that arccosine is  a decreasing function, and that $\arccos(cos x)=x$ if $0\le x\le \pi$. Hence $f(x)=\lfloor\arccos x\rfloor$ is a step function, defined by:
$$f(x)=\begin{cases}3 &\text{if }\quad\!{-1}\le x\le\cos 3,\\2 &\text{if } \cos 3< x \le \cos 2, \\ 1  &\text{if } \cos 2< x\le \cos 1,\\ 0 &\text{if } \cos 1< x\le 1.\end{cases}$$
You should find $\enspace 3+\cos 1+\cos 2+\cos 3$.
A: In terms of indicator functions, $$\lfloor \arccos(x)\rfloor = 3\Bbb{1}_{[-1,b)} + 2\Bbb{1}_{[b,c)} + \Bbb{1}_{[c,d)}$$ where $b$, $c$ and $d$ are the points at which the $\arccos$ graph hits $3, 2$ and $1$ $$ \implies \int_{-1}^{1} \lfloor \arccos(x) \rfloor \text{ d}x \ = \  3(b+1) \Bbb{1}_{[-1,b)} + 2(c-b)\Bbb{1}_{[b,c)} + (d-c)\Bbb{1}_{[c,d)}$$

 If you haven't yet met the indicator function, $\Bbb{1}_{[a,b]}$ simply means that we take the value $1$ when $a \leqslant x \leqslant b$ and $0$ elsewhere i.e. $$ \Bbb{1}_{[a,b]} = \begin{cases} 1 & a \leqslant x \leqslant b \\ 0 & \text{ else} \end{cases} $$


In more plain English, your integral is simply a sum of the areas of rectangles of widths $b+1$, $c-b$ and $d-c$ with respective heights $3, 2$ and $1$.
All you gotta do is find $b, c$ and $d$. The graph's below if you wanna have a go first and compare afterwards!

 $\hskip1in$ 

A: The floor function creates a step function which can be rewritten as
$$\begin{cases}\begin{align}
[\cos\pi,\cos3]&\to3\\
(\cos3,\cos2]&\to2\\
(\cos2,\cos1]&\to1\\
(\cos1,\cos0]&\to0.\\
\end{align}\end{cases}$$
The the Riemann integral is the sum of the rectangle areas,
$$3(\cos3-\cos\pi)+2(\cos2-\cos3)+(\cos1-\cos2).$$

