<s>[INST] How to show this fraction is equal to 1/2? I have the fraction:
$$\frac{\left(2 \left(\frac {a}{\sqrt{2}}\right) + a \right) a} {2(1 + \sqrt{2})a^2}$$
Using Mathematica, I've found that this simplifies to $\frac{1}{2}$, but how did it achieve the result? How can I simplify that fraction to $\frac12$?
 [/INST] Assume $a\neq 0$, we have \begin{align*}
\frac{\left(2\left(\frac {a}{\sqrt{2}}\right)+a\right)a} {2(1+\sqrt{2})a^2}&=\frac{\left(\frac{2a}{\sqrt 2}+a\right)}{2(1+\sqrt 2)a}\tag 1\\
&=\frac{\left(\frac{2}{\sqrt2}+1\right)a}{2(1+\sqrt 2)a}\tag2\\
&=\frac{\left(\frac{2}{\sqrt2}+1\right)}{(2+2\sqrt 2)}\\
&=\frac{\sqrt 2}{\sqrt 2}\cdot \frac{\left(\frac{2}{\sqrt2}+1\right)}{(2+2\sqrt 2)}\\
&=\frac{2+\sqrt 2}{2\sqrt 2+2\cdot 2}\\
&=\frac{2+\sqrt 2}{2\sqrt 2+4}\\
&=\frac{(2+\sqrt 2)}{2(2+\sqrt 2)}\\
&=\frac{1}{2}
\end{align*}
where in $(1)$ I cancelled the first $a$ and in $(2)$ I factored out the second $a$ to cancel it also.
</s>