Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can i prevent Mathematica from automatically simplifying the expression Sqrt[a/b]?

In case a=1 and b=2, Mathematica will print 1/Sqrt[2], whereas case a=3 and b=4, Mathematica will print Sqrt[3/4].

The output of my program would be better readable, if the fractions stayed unsimplified under the square-root symbol.

share|improve this question

You can use Format and a custom head, e.g. mySqrt, along with HoldForm:

Format[mySqrt[body_]] := Sqrt @ HoldForm @ body


mySqrt /@ {1/2, 3/4}

enter image description here

If you want to use these expressions as live input (where this holding behavior will not be preserved) you should use Interpretation:

Format[mySqrt[body_]] := Interpretation[Sqrt @ HoldForm @ body, Sqrt @ body]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.