Knowing that cos(45°) = 1/√2 is the way forward.
[tex]\frac{1-\frac{1}{\sqrt{2}} }{1+\frac{1}{\sqrt{2}}} = \frac{\sqrt{2}-1}{\sqrt{2}+1} = 3 - 2\sqrt{2}[/tex]
The last step in the equation may not be obious, but the trick here is to multiple numerator and denominator with (1-√2), then the denominator has the special product (a+b)(a-b) = a²-b².