Re: Why can't Mathematica tell when something is algebraically zero?
- To: mathgroup at smc.vnet.net
- Subject: [mg108174] Re: [mg108074] Why can't Mathematica tell when something is algebraically zero?
- From: "David Park" <djmpark at comcast.net>
- Date: Tue, 9 Mar 2010 06:28:08 -0500 (EST)
- References: <28235257.1268049029506.JavaMail.root@n11>
expr = r^2 Sqrt[(r^3 + r + 2)/r] - Sqrt[r^3 (r^3 + r + 2)]; The expression is undefined for r == 0, and definitely not zero for complex values of r. Mathematica usually assumes a complex domain. The following work: Simplify[expr, r > 0] 0 Simplify[expr /. r -> -r, r > 0] 0 But I don't know why the following doesn't work. FullSimplify[expr, r != 0 \[And] r \[Element] Reals] r^2 Sqrt[(2 + r + r^3)/r] - Sqrt[r^3 (2 + r + r^3)] However, the following does work: Simplify[expr // ComplexExpand, r != 0 \[And] r \[Element] Reals] 0 I don't think it would be very obvious to try that. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: mmdanziger [mailto:mmdanziger at gmail.com] This isn't the first time that I've encountered something like this in Mathematica but in my calculations I got a term like this: r^2 Sqrt[(r^3 + r + 2)/r] - Sqrt[r^3 (r^3 + r + 2)] Which is obviously identically zero. For some reason Simplify or even FullSimplify can't figure this out. Once you get dependent on Mathematica these things are pretty disturbing...you forget about your own knowledge because the program tells you that things are different. Then you sit there like an idiot checking an algebraic identity that any beginning precalc student should be able to solve no problem. Is there any way to get Mathematica to "wake up" to these things? It has such a powerful algebraic engine for most things, why can't it see something simple like the above? Do you really have to manually override and tell the program when things should be zero? For the time being I'll just sift through and test things by hand but I can't believe that there isn't a better way. Best, md