# Simplification difficulties with SageMath

Hi edited(I forgot to precise SageMath 9.2 W10)

With the risk of sounding like a boring guy who spends his time splitting hairs ! I do not undestand why the last sagemath instruction Yt.numerator().simplify() succeed to simplify ?? code on SageCell

var('x')
print("mathematica is able to do the simplification")
print("FullSimplify[Sqrt[1 - (-1 + x^2)^2/(1 + x^2)^2], x > 0]=(2 x)/(1 + x^2)")
assume(x>0)
Yt(x)=sqrt(-(x^2 - 1)^2/(x^2 + 1)^2 + 1)

show("################## with various simplify() only #################################")
show("KO : \t ",Yt.simplify())
show("KO : \t ",Yt.simplify_full())
show("KO : \t ",Yt.simplify_rational())
show("KO : \t ",Yt.simplify_rectform())
show("################## with denominator().simplify() #################################")
show("KO : \t ",Yt.denominator().simplify())
show("################## with numerator().simplify() #################################")
show("OK : \t ",Yt.numerator().simplify())

edit retag close merge delete

Sort by ยป oldest newest most voted

Well...

sage: Yt(x)=sqrt(-(x^2 - 1)^2/(x^2 + 1)^2 + 1)
2*x/(x^2 + 1)


whereas

sage: mathematica.FullSimplify(Yt(x),x>0).sage()
(2*x)/(x^2 + 1)


And, BTW :

sage: Yt(x).canonicalize_radical()
2*x/(x^2 + 1)


HTH,

more

Thank you @Emmanuel Charpentier I forgot to try .canonicalize_radical(), sorry

( 2021-10-17 11:11:55 +0200 )edit

But do you know why Yt.numerator().simplify() succseed ?

( 2021-10-18 11:11:37 +0200 )edit