Show that $|\sin x−\cos x|≤ 2$ for all $x.$ Please help me out in answering this:
Show that $|\sin x−\cos x|≤ 2$ for all $x.$
I don't know where to start and I think we have to use the mean value theorem to show this.

I have another method for you if you want to use some straight-up calculus optimization. Let us first determine the extrema of $\sin(x)-\cos(x)$. To do this, we take the derivative and set it equal to $0$. In this case, the derivative is $\cos(x) +\sin(x)$, so we want to solve $\cos(x) + \sin(x) = 0$, or $\cos(x) = -\sin(x)$. 
So when are $\sin(x)$ and $\cos(x)$ negatives of each other? This occurs precisely when $x = \frac{3\pi}{4}$ or $x= -\frac{\pi}{4}$. This means our extrema are at these values of $x$.
Let's now classify these extrema. First plug in $x = \frac{3\pi}{4}$ to $\sin(x)-\cos(x)$:
$$\sin\bigg(\frac{3\pi}{4}\bigg) -\cos\bigg(\frac{\pi}{4}\bigg) = \frac{\sqrt{2}}{2} + \frac{\sqrt{2}}{2} = \sqrt{2}.$$
Now plug in $x= -\frac{\pi}{4}$:
$$\sin\bigg(-\frac{\pi}{4}\bigg) -\cos\bigg(-\frac{\pi}{4}\bigg) = -\frac{\sqrt{2}}{2} - \frac{\sqrt{2}}{2} = -\sqrt{2}.$$
Thus, we have found that $\sqrt{2}$ is a maxiumum of $\sin(x) -\cos(x)$ and $-\sqrt{2}$ is a minimum. That is to say
$$ -\sqrt{2} \leq \sin(x) -\cos(x) \leq \sqrt{2},$$
for all $x$. But by the definition of the absolute value, this means that
$$ |\sin(x) -\cos(x)| \leq \sqrt{2},$$
and $\sqrt{2} < 2$, so we have
$$ |\sin(x) -\cos(x)| \leq \sqrt{2} < 2.$$
And then we are done.
