Why range of $\sin(x) - \cos(x)$ is not [-2,2] If I want to calculate range of
$$f(x)=\sin(x) - \cos(x) $$
Watching solution I got to know that we have to change this in a single trigonometric ratio (that is whole equation in form of sine or cosine)
And then range will be $[-\sqrt2,\sqrt2]$
But my doubt is that why can't we use method like below
As we know
$$  -1\le \sin(x) \le1$$
$$ -1\le \cos(x) \le1$$
Then   $$ -2 \le \sin(x) - \cos(x) \le 2$$
But it is wrong

I want explaination  that why using this method I am getting wrong

 A: Here is a way to derive the real bounds of $\sin x - \cos x.$ Using some basic physics knowledge, we can see that adding two states of simple harmonic motion gives another state of simple harmonic motion, so adding (or subtracting) two sine waves gives another sine wave. (Don't worry if you didn't get the physics. The point that I'm trying to make is that we can easily guess that it is a sine wave.) We can start by attempting to write it as $c\sin(x+y)$ for fixed $y.$ Since $\sin(x+y) = \sin x \cos y + \cos x \sin y, c\sin(x+y) = c\sin x \cos y + c\cos x \sin y.$  We would therefore try to make the first term of this new expression match $\sin x$ and the second term match $\cos x.$  Therefore, $c \cos y = 1$ and $c \sin y = -1.$ Therefore, $-1 =\frac{\sin y}{\cos y} = \tan y.$ We can easily take an inverse tangent to get that we can set $y = -\pi/4.$ Evaluating $c$ by using $c \cos y = 1$ gives $c = \sqrt{2}.$ This is the amplitude of our sine wave, so the bounds would be $[-\sqrt{2},\sqrt{2}].$
A: Your statement and the logic leading to $-2 \le \sin x - \cos x \le 2$ are correct.  The error is assuming that the outer bounds cannot be compressed, that the range of $\sin x - \cos x$ is all the way from $-2$ to $2$.  There is no $x$ where $\sin x=1$ and simultaneously $\cos x=-1$, so the difference cannot attain $2$ and similarly for $-2$
