Forcing Mathematica to Output $1/\sqrt2$ as $\sqrt2/2$

If you really insist on getting exactly this output within a standard evaluation, you can do the following:

Unprotect[Power];
Format[Power[2, Rational[-1, 2]]] := HoldForm[Sqrt[2]/2];
Protect[Power];

This leads to the desired output:

1/Sqrt[2]

$$\frac{\sqrt{2}}{2}$$

Sin[1/Sqrt[2]]

$$\sin\left(\frac{\sqrt{2}}{2}\right)$$

N[%]

0.649637

I would only do this if you're sure this is the one and only form in which you wish to display this number.


So long as it is only for output purposes, there is probably no real harm in doing this, and so it does not seem to be a matter of "force" in this case--defining an output form is a perfectly reasonable thing to do. The situation here is rather like in this recent question, and so I propose a similar solution.

The most sensible (and least intrusive) way to accomplish it, in my opinion, would be the following:

MakeBoxes[1/Sqrt[2] | Power[2, Rational[-1, 2]], form_] :=
 MakeBoxes[Sqrt[2]/2, form];

Please let me know if this fails to cover any use cases.


A slight variation of garej's comment:

Divide @@@ HoldForm[{Sqrt[2], 2}]

enter image description here