Ask Your Question
0

Simplification difficulties with SageMath

asked 2021-10-17 09:11:39 +0100

ortollj gravatar image

updated 2021-10-17 10:34:04 +0100

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-17 11:01:33 +0100

Emmanuel Charpentier gravatar image

Well...

sage: Yt(x)=sqrt(-(x^2 - 1)^2/(x^2 + 1)^2 + 1)
sage: with assuming(x>0): Yt(x).canonicalize_radical()
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,

edit flag offensive delete link more

Comments

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

ortollj gravatar imageortollj ( 2021-10-17 11:11:55 +0100 )edit

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

ortollj gravatar imageortollj ( 2021-10-18 11:11:37 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-10-17 09:11:39 +0100

Seen: 90 times

Last updated: Oct 17 '21