Range of a function $|\sin x|+|\cos x|$ What is the range of function $Y=[|\sin x|+|\cos x|]$ where $[ ]$ denotes the greatest integer function.
And what is range of function $Y=|\sin x|+|\cos x|$
For the second one, 
I have tried squaring :
I got  $Y^{2}=1+|\sin 2x|$
and range will be between $1$ and $\sqrt{2}$
Please help me with this...!!! 

For any real $x$ there exists $x'\in [0,\pi/2]$ such that $|\sin x|=|\sin x'|$ and $|\cos x|=|\cos x'|.$ Since $\sin x'\ge 0$ and $\cos x'\ge 0$ We have  $$(|\sin x|+|\cos x|)^2=(|\sin x'|+|\cos x'|)^2=$$ $$=(\sin x' +\cos x')^2=$$ $$=(\sin^2 x'+\cos^2 x')+2\sin x' \cos x'=$$ $$=1+\sin 2x'.$$ As $x$ ranges over $\Bbb R,\;$ $\, x'$  takes all, and only, values in $[0,\pi/2],$ so $2x'$ takes all, and only, values in $[0,\pi],$ so $\sqrt {1+\sin 2x'}\,$ takes all, and only, values in $[1,\sqrt 2\,]$.
Now $1<\sqrt 2\,<2,$ so for all real $x$, the greatest integer not exceeding $|\sin x|+|\cos x|$ is $1.$ 
