Ask Your Question

simplify rational expression

asked 2021-08-13 10:24:20 +0100

ortollj gravatar image


W10,SageMath 9.2

I wanted to answer this question, but I realized that myself, I was not able to answer it ! ;-(

how to simplify eq below ?

assume (d!=0)
print (eq.simplify())
edit retag flag offensive close merge delete


any assume missing ?

ortollj gravatar imageortollj ( 2021-08-13 10:27:55 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2021-08-14 11:09:36 +0100

Emmanuel Charpentier gravatar image

Why simplify ?

sage: (eq.lhs()-eq.rhs()).factor()
(a + b - 3*c)/(c*d)
edit flag offensive delete link more

answered 2021-08-13 18:06:59 +0100

tmonteil gravatar image

Regarding the original question, note that you can do:

sage: eq * d
(a + b)/c == 3
edit flag offensive delete link more


so what you propose as a rough solution is to look in an equation what are the common divisors and to multiply by these divisors, as we do by hand ??. the question is why SageMath does not know how to simplify this very simple equation . I minus your solution. moreover we do not know the initial equation alphax does not want to share his code.

ortollj gravatar imageortollj ( 2021-08-13 20:19:37 +0100 )edit

I remove the minus because by re-reading the initial question, this is indeed what alphax was simply asking. But the fact that SageMath cannot simplify my very simple test equation using simplify_rational () is a problem, right?

ortollj gravatar imageortollj ( 2021-08-13 20:34:31 +0100 )edit

Indeed, the first sentence of the original question is asking about multiplying by the denominator. The non-simplification of such a simple case is of course not satisfying. Another missing feature of the symbolic ring would be to hold everything and let the user suggest the operations one by one.

tmonteil gravatar imagetmonteil ( 2021-08-15 17:32:22 +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


Asked: 2021-08-13 10:24:20 +0100

Seen: 402 times

Last updated: Aug 14 '21