First time here? Check out the FAQ!

Ask Your Question
0

Simplification difficulties with SageMath

asked 3 years ago

ortollj gravatar image

updated 3 years ago

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())
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 3 years ago

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,

Preview: (hide)
link

Comments

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

ortollj gravatar imageortollj ( 3 years ago )

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

ortollj gravatar imageortollj ( 3 years ago )

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: 3 years ago

Seen: 771 times

Last updated: Oct 17 '21