Multiply the expression by sqrt of 2 and it's reciprocal (which is really multiplying by 1):

\(\displaystyle cos x - sin x \\

= \sqrt{2} \cdot \frac{1}{\sqrt{2}} \left( cos x - sin x \right)\)

Distribute just the fraction (1 over sqrt 2):

\(\displaystyle = \sqrt{2} \left( (cos x)\left(\frac{1}{\sqrt{2}}\right) - (sin x)\left(\frac{1}{\sqrt{2}}\right) \right)\)

I know that cos (pi/4) = sin (pi/4) = 1/sqrt(2):

\(\displaystyle = \sqrt{2} \left( (cos x)\left(cos \frac{\pi}{4}\right) - (sin x)\left(sin \frac{\pi}{4}\right) \right)\)

Use the cosine of a sum identity:

\(\displaystyle = \sqrt{2} cos \left( x + \frac{\pi}{4} \right)\)