Problem solving equations

48 views
Skip to first unread message

Aaron Tresham

unread,
Mar 21, 2017, 6:35:42 PM3/21/17
to sage-cloud
Does anyone know if there is a similar group to discuss issues with Maxima? (I think that's where my problem lies).

When I do something like:

solve(x^2/x==0,x)

I expect no solutions, but Sage gives me one solution, x==0. I'm assuming Sage uses Maxima here, and Maxima simplifies the fraction before solving (and fails to check afterwards). I can catch things like this myself, but I'm not sure my students would notice (especially if a hole is hidden inside a complicated rational function).

Thanks,
Aaron

William Stein

unread,
Mar 21, 2017, 6:52:07 PM3/21/17
to sage-...@googlegroups.com
What happens if you just type x^2/x ?

--
You received this message because you are subscribed to the Google Groups "sage-cloud" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/57f370bf-76ba-4bf5-8a20-8e1c0ba1201e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Best Regards,
William Stein

CEO, SageMath, Inc.

Aaron Tresham

unread,
Mar 21, 2017, 7:28:01 PM3/21/17
to sage-cloud
If I run x^2/x in SMC, the output is x.

That is fine in some contexts (although the user should mentally add "x not equal to 0").

I'm dealing with rational functions with holes, and Sage is eliminating the hole. Of course, it would be very nice if my students would notice the hole themselves.

Aaron

William Stein

unread,
Mar 21, 2017, 7:29:25 PM3/21/17
to sage-...@googlegroups.com
On Tue, Mar 21, 2017 at 4:28 PM Aaron Tresham <atre...@gmail.com> wrote:
If I run x^2/x in SMC, the output is x.

That is what is really going on here. Maxima isn't relevant at all. By the time maxima sees your input, x^2/x has already beeb simplified to c. 




For more options, visit https://groups.google.com/d/optout.

Aaron Tresham

unread,
Mar 21, 2017, 7:42:30 PM3/21/17
to sage-cloud
OK, so Sage is doing this before calling Maxima.

It's probably more important that Sage simplify in general, so I will just have to watch out for this (and warn my students). 

Thank you,
Aaron

William Stein

unread,
Mar 21, 2017, 7:52:42 PM3/21/17
to sage-cloud
On Tue, Mar 21, 2017 at 4:42 PM, Aaron Tresham <atre...@gmail.com> wrote:
> OK, so Sage is doing this before calling Maxima.

Yes. More precisely, probably http://www.ginac.de/
> https://groups.google.com/d/msgid/sage-cloud/3ce2881f-e90c-45a0-9843-fab47dfde0bf%40googlegroups.com.

Aaron Tresham

unread,
Mar 22, 2017, 12:38:12 AM3/22/17
to sage-cloud
Here's another curious test:

If I run this in Sage:

(x^2+2*x+1)/(x+1)

then the output is itself.

If I run:

(x+1)^2/(x+1)

then the output is x+1.

The interesting thing is that feeding either of the above to the solve command results in the "solution" x==-1. So merely "running" does not always do the same simplifying that the solve command does.

Harald Schilly

unread,
Mar 22, 2017, 7:03:56 AM3/22/17
to sage-cloud
Hello Aaron, there are different philosophies how symbolics are handled. One goes towards structure-transformations to get a quick answer, the other towards being more expressive about the problem itself. However, I think maxima doesn't help you much here. I've typed up a short SymPy worksheet that shows you a few computations. In particular, note that simplifications of expressions are disabled and solveset "correctly" shows you that there is no solution. In other instances, it gives you all solutions as a set.

Key elements:

sympify('x^2 / x', evaluate=False)

 → x²/x

solveset(x²/x)

→ ø

solveset(sympify('(x^3 - x^2 - 6*x) / x', evaluate=False))

 → {-2, 3} but not "0"


-- Harald

Aaron Tresham

unread,
Mar 22, 2017, 1:01:38 PM3/22/17
to sage-cloud
As someone who is completely ignorant as to how this stuff is actually implemented on the computer, I find this very interesting.

My philosophy is that a CAS should not be used independent of human thought, and this is a good example of the need for the user to evaluate the results.

Thank you for helping me to understand.

Aaron
Reply all
Reply to author
Forward
0 new messages