<s>[INST] How to simplify the fraction? How to simplify the fraction  $ \displaystyle \frac{\sqrt{3}+1-\sqrt{6}}{2\sqrt{2}-\sqrt{6}+\sqrt{3}+1} $ to $ (\sqrt{2}-1)(2-\sqrt{3})  $?
I've checked it in the calculator and both give the same value.
I was able to simplify it until $\displaystyle \frac{1+\sqrt2-\sqrt3}{3+\sqrt2+\sqrt3} $ which also gives the same value.
For anyone who is interested, $ (\sqrt{2}-1)(2-\sqrt{3}) =tan\frac{\pi}{8}tan\frac{\pi}{12} $ and I need this as I was trying to use coordinate geometry to solve the following
question.
 [/INST] \begin{align}
\frac {1 + \sqrt 2 - \sqrt 3}{3 + \sqrt 2 + \sqrt 3} &= \frac {1 + \sqrt 2 - \sqrt 3}{3 + \sqrt 2 + \sqrt 3} \times \frac {3 - \sqrt 2 - \sqrt 3}{3 - \sqrt 2 - \sqrt 3}\\
&=\frac {3 - \sqrt 2 -\sqrt 3+3\sqrt 2-2-\sqrt 6-3\sqrt 3+\sqrt 6+3}{9 - (2 + 2\sqrt 6 + 3)}\\
&=\frac {4+2\sqrt 2-4\sqrt 3}{4 -2\sqrt 6}\\
&=\frac {2+\sqrt 2-2\sqrt 3}{2 -\sqrt 6} \times \frac {2 +\sqrt 6}{2 +\sqrt 6}\\
&=\frac {4 + 2\sqrt 2 - 4\sqrt 3 + 2\sqrt 6+2\sqrt 3 - 6\sqrt 2}{4-6}\\
&=\frac {4 -4\sqrt 2 - 2\sqrt 3 + 2\sqrt 6}{-2}\\
&=-2+2\sqrt 2 +\sqrt 3-\sqrt 6\\&=-2(1-\sqrt 2)+\sqrt 3(1-\sqrt 2)\\
&=(2-\sqrt 3)(\sqrt 2-1)
\end{align}
Just bash away.
</s>