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

This question already has an answer here:

Why I have this behaviour?

R /: Greater[R, 0] = True
R > 0
  => True
  => Sqrt[R^2]

I expect R as last result.

share|improve this question

marked as duplicate by Leonid Shifrin, Jens, R. M. Mar 16 '13 at 17:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You have to use assumptions: Simplify[Sqrt[R^2], Assumptions :> R > 0]. – Leonid Shifrin Mar 16 '13 at 15:14
@LeonidShifrin: No way to say that R is positive once for all? – enzotib Mar 16 '13 at 15:26
@LeonidShifrin: thanks for pointing to that question – enzotib Mar 16 '13 at 15:31
It's definitely best to work with $Assumptions, but if for some reason you don't want that, and want to avoid Simplify, then you could also just define R = Abs[r]. – Jens Mar 16 '13 at 15:42

One way to do this would be to keep a list of assumptions for your system, i.e.

assumptions = {R >= 0};
Simplify[Sqrt[R^2], Assumptions -> assumptions]

which returns R as expected.

share|improve this answer
There is no way to attach that information to R, so to avoid to recall the Assumptions option each time? – enzotib Mar 16 '13 at 15:19

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