$[\cos x+\sin x]=[\cos x]+[\sin x]$,where [.] is the greatest integer function. Solve the equation in interval $[0,\pi]:[\cos x+\sin x]=[\cos x]+[\sin x]$,where [.] is the greatest integer function.
How should i start this question,breaking it into intervals is difficult.Please guide me.
 A: Key facts: (1) For $0\lt x\lt\pi/2$, we have $\sin x+\cos x\gt 1$, so we do not have equality.
(2) For $\pi/2\lt x\le 3\pi/4$, we have $\lfloor \cos x\rfloor=-1$ but $\lfloor \cos x+\sin x\rfloor=0$.
(3) For $3\pi/4\lt x\le \pi$ we have $\lfloor \cos x\rfloor=-1$ and $\lfloor \cos x+\sin x\rfloor=-1$ so the equality holds.
It remains to check $0$ and  $\pi/2$.
A: Clearly the equality holds true if one of $\sin x,\cos x=0$
This $\implies x=0,\dfrac\pi2,\pi$
$[\sin x]=\begin{cases} 1 &\mbox{if } x=\dfrac\pi2 \\
0 &  \text{otherwise}  \end{cases} $ 
$[\cos x]=\begin{cases} 1 &\mbox{if } x=0 \\
0 & \mbox{if } 0<x<\dfrac\pi2\\
 -1 & \mbox{if } \dfrac\pi2<x\le\pi\\
 \end{cases} $ 
For $0<x<\dfrac\pi2,[\cos x+\sin x]=0\implies0\le\cos x+\sin x<1$
But $\cos x+\sin x=\sqrt2\sin\left(\dfrac\pi4+x\right)$
$\implies0\le\sin\left(\dfrac\pi4+x\right)<\dfrac1{\sqrt2}$
In $0\le x\le\pi$ we need $\dfrac\pi2<x\le\dfrac{3\pi}4$
For $\dfrac\pi2<x<\pi,[\cos x+\sin x]=-1\implies-1\le\cos x+\sin x<0$
$\implies-\dfrac1{\sqrt2}\le\sin\left(\dfrac\pi4+x\right)<0$
In $0\le x\le\pi$ we need $\dfrac{3\pi}4<x\le\pi$
A: Here $x\in \left[0,\pi\right]\;,$ Then $0\leq \sin x\leq 1$. So we get $\displaystyle \lfloor \sin x\rfloor = 0,1$
Similarly $x\in \left[0,\pi\right]\;,$ Then $-1 \leq \cos x\leq 1$. So we get $\displaystyle \lfloor \cos x\rfloor = -1, 0,1$ 
Similarly $x\in \left[0,\pi\right]\;,$ Then $-1 \leq \sin x+ \cos x\leq \sqrt{2}$. So we get $\displaystyle \lfloor \sin x+\cos x\rfloor =-1, 0,1$ 
$\bullet \; $ If $\displaystyle \lfloor \sin x+\cos x\rfloor=0\;,$ Then $\lfloor \sin x \rfloor =0 $ and $\lfloor \cos x \rfloor  =0$
$\bullet \; $ If $\displaystyle \lfloor \sin x+\cos x\rfloor=0\;,$ Then $\lfloor \sin x \rfloor =1 $ and $\lfloor \cos x \rfloor  =-1$
$\bullet \; $ If $\displaystyle \lfloor \sin x+\cos x\rfloor=1\;,$ Then $\lfloor \sin x \rfloor =0 $ and $\lfloor \cos x \rfloor  =1$
$\bullet \; $ If $\displaystyle \lfloor \sin x+\cos x\rfloor=1\;,$ Then $\lfloor \sin x \rfloor =1$ and $\lfloor \cos x \rfloor  =0$
$\bullet \; $ If $\displaystyle \lfloor \sin x+\cos x\rfloor=-1\;,$ Then $\lfloor \sin x \rfloor =0$ and $\lfloor \cos x \rfloor  =-1$
