Re: Solve results

*To*: mathgroup at smc.vnet.net*Subject*: [mg5110] Re: Solve results*From*: danl (Daniel Lichtblau)*Date*: Wed, 30 Oct 1996 22:04:11 -0500*Organization*: Wolfram Research, Inc.*Sender*: owner-wri-mathgroup at wolfram.com

In article <54rsdn$33l at dragonfly.wolfram.com> dwarf at wam.umd.edu (Dwarf) writes: > I recently came upon this and was wondering if it's a Solve bug, some > notation I'm not familiar with, or just an unfortunate happenstance. > > When I give Mathematica the equation x^3-8==0, this is what it returns: > > In[1]:= > Solve[x^3-8==0,x] > Out[1]= > {{x -> 2}, {x -> -2*(-1)^(1/3)}, {x -> 2*(-1)^(2/3)}} > > But if I first factor the polynomial instead: > > In[2]:= > Solve[Factor[x^3-8]==0,x] > Out[2]= > {{x -> 2}, {x -> (-2 - 2*I*3^(1/2))/2},{x -> (-2 + 2*I*3^(1/2))/2}} > > if I use reduce instead of solve > > In[3]:= > Reduce[x^3-8==0,x] > Out[3]= > x == 2 || x == (-2 - 2*I*3^(1/2))/2 || x == (-2 + 2*I*3^(1/2))/2 > > > My question is: why the different behaviors, and how can I tell in advance > which to use? > > +----------------------------+ > | | I understand mine's a risky plan, > | Greg Anderson | and your system can't miss > | dwarf at wam.umd.edu | but is security, after all a cause > | timbwolf at eng.umd.edu | or symptom of happiness. > | | > +----------------------------+ Dream Theater -- A Matter of Time > > Solve recognizes it has one equation in one unknown, and right away calls Roots. Roots tries various methods in the order of likely increasing difficulty. It will thus use special-case binomial code in preference to factorization. Hence the solutions involving roots of unity. Reduce will not take this one-equation/one-unknown shortcut, hence goes through the full fire drill, which involves factorization as a preprocessing step. Factoring x^3 - 8 produces a linear term and a quadratic term, and the results you get from Solve[Factor[x^3-8]==0,x] come from application of the quadratic formula. I should point out that the results are mathematically equivalent to those expressed in terms of roots of unity. Version 3.0 of Mathematica is a trifle smarter in massaging these radical outputs, by the way. In[4]:= Solve[Factor[x^3-8]==0,x] Out[4]= {{x -> 2}, {x -> -1 - I Sqrt[3]}, {x -> -1 + I Sqrt[3]}} Daniel Lichtblau Wolfram Research danl at wolfram.com