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.Wed, 20 Aug 2014 14:50:12 +0200Wrong Answer?https://ask.sagemath.org/question/23837/wrong-answer/
When I ask Sage to solve a simple rational inequality it occasionally gives a wrong answer. For example,
$$ \frac{x^2 - 9 }{x-3} \geq 0$$
is satisfied when $x \geq -3$ except at $x=3$, but Sage just gives $x \geq -3$. Here's the code I am using:
sage: solve((x^2-9)/(x-3) >= 0,x)Tue, 19 Aug 2014 23:46:36 +0200https://ask.sagemath.org/question/23837/wrong-answer/Answer by kcrisman for <p>When I ask Sage to solve a simple rational inequality it occasionally gives a wrong answer. For example,
$$ \frac{x^2 - 9 }{x-3} \geq 0$$
is satisfied when $x \geq -3$ except at $x=3$, but Sage just gives $x \geq -3$. Here's the code I am using:</p>
<pre><code>sage: solve((x^2-9)/(x-3) >= 0,x)
</code></pre>
https://ask.sagemath.org/question/23837/wrong-answer/?answer=23850#post-id-23850This is in Maxima.
Maxima 5.33.0 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) load("solve_rat_ineq");
(%o1) /Users/.../sage/local/share/maxima/5.33.0/share/solve\
_rat_ineq/solve_rat_ineq.mac
(%i2) solve_rat_ineq((x^2-9)/(x-3) >= 0);
(%o2) [[x >= - 3]]
That said, Maxima (and Sage and lots of other things) do simplify `x^2/x` to be just `x`, so I am not 100% sure it's not intended behavior. Anyway, I agree it would be better to not have the 3, so I've reported it [at Maxima bug 2804](https://sourceforge.net/p/maxima/bugs/2804/).Wed, 20 Aug 2014 14:50:12 +0200https://ask.sagemath.org/question/23837/wrong-answer/?answer=23850#post-id-23850