Re: [sage-support] Simplifying symbolic expression with radicals

2017-10-16 Thread Michael Orlitzky
On 10/16/2017 04:21 PM, Emily G wrote:
> 
> (*2* + sqrt(*2*))/(*1* + sqrt(*2*))
> 
> The above example should simplify to sqrt(2),
> but simplify_full() and canonicalize_radical() don't work. Is there a
> way that I can get Sage to simplify such expressions?
> 

This gets the result that you want,

  sage: f = (2 + sqrt(2))/(1 + sqrt(2))
  sage: f._sympy_().simplify()
  sqrt(2)

by using SymPy's simplification routine instead of the default Maxima
one. I'm not sure how safe that is in general (e.g. it might do weird
things with complex numbers), so I'd read through the SymPy docs before
using it on anything important.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Simplifying symbolic expression with radicals

2017-10-16 Thread Emily G
Hello,

I am trying to find out whether I can get Sage to simplify expressions such 
as these (and other radicals that are not square root):

(*2* + sqrt(*2*))/(*1* + sqrt(*2*))


The above example should simplify to sqrt(2), but simplify_full() and 
canonicalize_radical() don't work. Is there a way that I can get Sage to 
simplify such expressions?


Note: a work-around would be to replace the symbolic expression with a real 
number by writing 2^0.5, but that's not ideal.


Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.