ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 15 Aug 2021 17:32:22 +0200simplify rational expressionhttps://ask.sagemath.org/question/58434/simplify-rational-expression/Hi
W10,SageMath 9.2
I wanted to answer this [question](https://www.maths-forum.com/cafe-mathematique/sagemath-t235617.html), 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())Fri, 13 Aug 2021 10:24:20 +0200https://ask.sagemath.org/question/58434/simplify-rational-expression/Comment by ortollj for <p>Hi</p>
<p>W10,SageMath 9.2</p>
<p>I wanted to answer this <a href="https://www.maths-forum.com/cafe-mathematique/sagemath-t235617.html">question</a>, but I realized that myself, I was not able to answer it ! ;-( </p>
<p>how to simplify eq below ?</p>
<pre><code>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())
</code></pre>
https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58435#post-id-58435any assume missing ?Fri, 13 Aug 2021 10:27:55 +0200https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58435#post-id-58435Answer by tmonteil for <p>Hi</p>
<p>W10,SageMath 9.2</p>
<p>I wanted to answer this <a href="https://www.maths-forum.com/cafe-mathematique/sagemath-t235617.html">question</a>, but I realized that myself, I was not able to answer it ! ;-( </p>
<p>how to simplify eq below ?</p>
<pre><code>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())
</code></pre>
https://ask.sagemath.org/question/58434/simplify-rational-expression/?answer=58439#post-id-58439Regarding the original question, note that you can do:
sage: eq * d
(a + b)/c == 3
Fri, 13 Aug 2021 18:06:59 +0200https://ask.sagemath.org/question/58434/simplify-rational-expression/?answer=58439#post-id-58439Comment by tmonteil for <p>Regarding the original question, note that you can do:</p>
<pre><code>sage: eq * d
(a + b)/c == 3
</code></pre>
https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58477#post-id-58477Indeed, the first sentence of the original question https://www.maths-forum.com/cafe-mathematique/sagemath-t235617.html 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.Sun, 15 Aug 2021 17:32:22 +0200https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58477#post-id-58477Comment by ortollj for <p>Regarding the original question, note that you can do:</p>
<pre><code>sage: eq * d
(a + b)/c == 3
</code></pre>
https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58446#post-id-58446I 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?Fri, 13 Aug 2021 20:34:31 +0200https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58446#post-id-58446Comment by ortollj for <p>Regarding the original question, note that you can do:</p>
<pre><code>sage: eq * d
(a + b)/c == 3
</code></pre>
https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58444#post-id-58444so 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.Fri, 13 Aug 2021 20:19:37 +0200https://ask.sagemath.org/question/58434/simplify-rational-expression/?comment=58444#post-id-58444Answer by Emmanuel Charpentier for <p>Hi</p>
<p>W10,SageMath 9.2</p>
<p>I wanted to answer this <a href="https://www.maths-forum.com/cafe-mathematique/sagemath-t235617.html">question</a>, but I realized that myself, I was not able to answer it ! ;-( </p>
<p>how to simplify eq below ?</p>
<pre><code>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())
</code></pre>
https://ask.sagemath.org/question/58434/simplify-rational-expression/?answer=58456#post-id-58456Why simplify ?
sage: (eq.lhs()-eq.rhs()).factor()
(a + b - 3*c)/(c*d)
Sat, 14 Aug 2021 11:09:36 +0200https://ask.sagemath.org/question/58434/simplify-rational-expression/?answer=58456#post-id-58456