Re: Re: Question about Reduce
- To: mathgroup at smc.vnet.net
- Subject: [mg71305] Re: [mg71294] Re: [mg71272] Question about Reduce
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Tue, 14 Nov 2006 05:06:24 -0500 (EST)
- References: <200611121148.GAA18697@smc.vnet.net> <200611130534.AAA18444@smc.vnet.net>
On 13 Nov 2006, at 14:34, Andrzej Kozlowski wrote: > > *This message was transferred with a trial version of CommuniGate > (tm) Pro* > > On 12 Nov 2006, at 20:48, dimitris wrote: > >> Consider the following simple quadratic equation >> >> eq = a*x^2 + b*x + c == 0; >> >> Solve[eq, x] >> {{x -> (-b - Sqrt[b^2 - 4*a*c])/(2*a)}, {x -> (-b + Sqrt[b^2 - >> 4*a*c])/(2*a)}} >> >> For the complete set of solutions we use Reduce >> >> Reduce[eq, x] >> (a != 0 && (x == (-b - Sqrt[b^2 - 4*a*c])/(2*a) || x == (-b + Sqrt >> [b^2 >> - 4*a*c])/(2*a))) || (a == 0 && b != 0 && x == -(c/b)) || (c == 0 >> && b >> == 0 && a == 0) >> >> The following commnds give the desired results >> >> Reduce[eq && b^2 - 4*a*c < 0, x, Reals] >> False >> >> Reduce[eq && a == 0, x] >> (a == 0 && b != 0 && x == -(c/b)) || (c == 0 && b == 0 && a == 0) >> >> Reduce[eq && c == 0 && a == 0, x] >> (c == 0 && b == 0 && a == 0) || (c == 0 && a == 0 && b != 0 && x >> == 0) >> >> Howver why the following don't simplify to the double root? >> >> Reduce[a*x^2 + b*x + c == 0 && b^2 - 4*ac == 0 && a != 0, x] >> ac == b^2/4 && a != 0 && (x == (-b - Sqrt[b^2 - 4*a*c])/(2*a) || x == >> (-b + Sqrt[b^2 - 4*a*c])/(2*a)) >> >> Reduce[a*x^2 + b*x + c == 0 && ac == b^2/4 && a != 0, x] >> ac == b^2/4 && a != 0 && (x == (-b - Sqrt[b^2 - 4*a*c])/(2*a) || x == >> (-b + Sqrt[b^2 - 4*a*c])/(2*a)) >> >> Thanks in advance for any help! >> > > First of all, there is a mistake in your input; you have "ac" > instead of "a*c". Secondly, Reduce will not do what you expect to > because for reasons of performance it does not try to simplify its > output by using the input as a set of assumptions. Or, to put in in > another way, it does not do this: > > > Simplify[Reduce[a*x^2 + b*x + c == 0, x], b^2 - 4*a*c == 0 && a != 0] > > b + 2*a*x == 0 > > Andrzej Kozlowski > It may be interesting to note that instead of using Simplify as in this example, one can in effect "pass the assumption" b^2 - 4*a*c=0 to Reduce by using GroebnerBasis, e.g. as follows: Reduce[GroebnerBasis[{a*x^2 + b*x + c, b^2 - 4*a*c}, {c, b, a, x}] == 0, x] (c == 0 && b == 0 && a == 0) || (c == 0 && b == 0 && a != 0 && x == 0) || (c != 0 && a == b^2/(4*c) && a != 0 && x == -(b/(2*a))) Andrzej Kozlowski
- References:
- Question about Reduce
- From: "dimitris" <dimmechan@yahoo.com>
- Question about Reduce