Ask Your Question
1

simplify rational expression

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

ortollj gravatar image

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

Comments

any assume missing ?

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

2 Answers

Sort by ยป oldest newest most voted
1

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
0

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

Comments

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 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.

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

Stats

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

Seen: 402 times

Last updated: Aug 14 '21