Answer
Show that
$$
|\sin x-\cos x| \leq \sqrt{2}, \text { for all } x
$$
Let
$$
f(x)=\sin x-\cos x, \text { on }[0,2 \pi]
$$
since $f$ has period $2 \pi $
$$
f^{\prime}(x)=\cos x+\sin x=0
$$
$ \Leftrightarrow $
$$
\cos x=-\sin x, \Leftrightarrow \tan x=-1
$$
$ \Leftrightarrow $
$$
x=\frac{3 \pi}{4} \text { or } \frac{7 \pi}{4}
$$
Evaluating $f $ at its critical numbers and endpoints, we get
$$
f(0)=-1, f\left(\frac{3 \pi}{4}\right)=\sqrt{2} \\
f\left(\frac{7 \pi}{4}\right)=-\sqrt{2} \text { and } f(2 \pi)=-1
$$
So $f$ has absolute maximum value $ \sqrt{2} $ and absolute minimum value $-\sqrt{2}$.
Thus,
$$
-\sqrt{2} \leq \sin x-\cos x \leq \sqrt{2} \Rightarrow|\sin x-\cos x| \leq \sqrt{2} .
$$
Work Step by Step
Show that
$$
|\sin x-\cos x| \leq \sqrt{2}, \text { for all } x
$$
Let
$$
f(x)=\sin x-\cos x, \text { on }[0,2 \pi]
$$
since $f$ has period $2 \pi $
$$
f^{\prime}(x)=\cos x+\sin x=0
$$
$ \Leftrightarrow $
$$
\cos x=-\sin x, \Leftrightarrow \tan x=-1
$$
$ \Leftrightarrow $
$$
x=\frac{3 \pi}{4} \text { or } \frac{7 \pi}{4}
$$
Evaluating $f $ at its critical numbers and endpoints, we get
$$
f(0)=-1, f\left(\frac{3 \pi}{4}\right)=\sqrt{2} \\
f\left(\frac{7 \pi}{4}\right)=-\sqrt{2} \text { and } f(2 \pi)=-1
$$
So $f$ has absolute maximum value $ \sqrt{2} $ and absolute minimum value $-\sqrt{2}$.
Thus,
$$
-\sqrt{2} \leq \sin x-\cos x \leq \sqrt{2} \Rightarrow|\sin x-\cos x| \leq \sqrt{2} .
$$