# simplify rational expression

Hi

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 ?

var('a,b,c,d',domain='real')
assume (d!=0)
eq=(a+b)/(c*d)==3/d
print(eq)
print (eq.simplify())
print(eq.simplify_full())
print(eq.simplify_rational())
print(eq.simplify_rational())

edit retag close merge delete

Sort by » oldest newest most voted

Why simplify ?

sage: (eq.lhs()-eq.rhs()).factor()
(a + b - 3*c)/(c*d)

more

Regarding the original question, note that you can do:

sage: eq * d
(a + b)/c == 3

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.

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?

Indeed, the first sentence of the original question https://www.maths-forum.com/cafe-math... 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.