ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 15 Mar 2017 14:36:52 +0100How to keep 1/sqrt(2) as 1/sqrt(2) ? [the canonical form is not canonical]https://ask.sagemath.org/question/36944/how-to-keep-1sqrt2-as-1sqrt2-the-canonical-form-is-not-canonical/ Hi all
Using sagetex to make computaion, I would like it to keep radical in the denominator (though I remember my 8 th grade course viewing the canonical form today in a pdf file seems odd )
so something like
1/sqrt(2) would not be written as
sqrt(2)/2 as it is normally.
I saw this related link : https://ask.sagemath.org/question/35236/simplify-an-expression-of-square-roots/
but for me the command
1/sqrt(2).maxima_methods().rootscontract().simplify()
gives also a "canonical" result.
Cheers,
Tue, 14 Mar 2017 18:20:00 +0100https://ask.sagemath.org/question/36944/how-to-keep-1sqrt2-as-1sqrt2-the-canonical-form-is-not-canonical/Answer by ndomes for <p>Hi all
Using sagetex to make computaion, I would like it to keep radical in the denominator (though I remember my 8 th grade course viewing the canonical form today in a pdf file seems odd )
so something like
1/sqrt(2) would not be written as
sqrt(2)/2 as it is normally.
I saw this related link : <a href="https://ask.sagemath.org/question/35236/simplify-an-expression-of-square-roots/">https://ask.sagemath.org/question/352...</a>
but for me the command
1/sqrt(2).maxima_methods().rootscontract().simplify()
gives also a "canonical" result.
Cheers,</p>
https://ask.sagemath.org/question/36944/how-to-keep-1sqrt2-as-1sqrt2-the-canonical-form-is-not-canonical/?answer=36946#post-id-36946
expr = sqrt(2).power(-1,hold=True)
expr
Unfortunately this is not consistent . `3*expr` is evaluated to `3/2*sqrt(2)`
We can keep `expr` untouched with an effort:
SR(3).mul(expr,hold=True)
Wed, 15 Mar 2017 14:36:52 +0100https://ask.sagemath.org/question/36944/how-to-keep-1sqrt2-as-1sqrt2-the-canonical-form-is-not-canonical/?answer=36946#post-id-36946