Re: Re: Re: Reduce/Solve

*To*: mathgroup at smc.vnet.net*Subject*: [mg50119] Re: [mg50078] Re: [mg50060] Re: Reduce/Solve*From*: andrzej <andrzej at akikoz.net>*Date*: Sun, 15 Aug 2004 03:15:20 -0400 (EDT)*References*: <200408090829.EAA03580@smc.vnet.net> <200408101002.GAA19500@smc.vnet.net> <766AE111-EABF-11D8-BBFD-000A95B4967A@mimuw.edu.pl> <opsciyqjd6iz9bcq@monster.cox-internet.com> <395198E8-EB0D-11D8-AA51-000A95B4967A@mimuw.edu.pl> <cfcr2e$475$1@smc.vnet.net> <200408130956.FAA03676@smc.vnet.net> <200408140550.BAA15321@smc.vnet.net> <opscqt1qg8iz9bcq@monster.cox-internet.com>*Sender*: owner-wri-mathgroup at wolfram.com

*This message was transferred with a trial version of CommuniGate(tm) Pro* On 15 Aug 2004, at 00:28, DrBob wrote: > >>> In this type of equations the appearance of "phantom" solutions is a > consequence of the method used for solving them. It is not a feature of > Mathematica or of Solve. > > What does that mean? > > 1) WRI programmers didn't choose to apply that method? > > 2) Solve gets credit for right answers, but can't be blamed for wrong > ones? > > I don't think so. > > EVERYTHING that happens in Mathematica is a feature, bug, or > limitation of Mathematica; that certainly includes any errors that > result from the methods used. > > Bobby Not quite. You are forgetting limitations that are due to mathematics, or algorithms that we know, which is what happens in this case. What I meant in my reply was this: the only algorithms that exist for solving this kind of equations in general lead to phantom solutions as well as "correct solutions. This is a feature of "mathematics" not Mathematica. This happens with both numerical parameters and variable parameters. Solve has the options VerifySolutions but this option works only with numerical parameters. In the cases of variable parameters Mathematica does not try to verify solutions to eliminate the pantoms because it is in general impossible to do so. Even in numerical cases only a rather simple verification is attempted, so that in prinicple you may get phantom solutions even in numerical cases even if you use the setting VerifySolutions->True. ALl this is essentally inevitable, resulting from our knowledge of the mathemtics involved and will work in the same way in systems other than Mathematica. Andrzej P.S. Of course this and anything I write may not be true in partiular cases where bugs are involved, when my memory fails or when some new discovieries have been made of which I am not aware. Fortunately, such cases can be settled by "divine intervention", that is, a response form Daniel Lichtblau ;-) > > On Sat, 14 Aug 2004 01:50:31 -0400 (EDT), Andrzej Kozlowski > <akoz at mimuw.edu.pl> wrote: > >> >> On 13 Aug 2004, at 11:56, Andy Kowar wrote: >> >>> >>> I have a problem that the experts on Solve/Reduce participating in >>> this thread might help me with. >>> >>> I define an ellipse in parametric form: >>> r[t_]:={a*Cos[t],b*Sin[t]} >>> and the tangent >>> dr[t_]:=Evaluate[D[r[t], t]] >>> I define a vector >>> q={k,l}; >>> I want to find points on the ellipse such that the tangent is >>> parallel >>> to a given vector: >>> q={k,l}; >>> I expect two two solutions. >>> >>> I define the equation: >>> eq = dr[t] == lambda q; >>> The following command >>> sol = Simplify[Solve[eq, {t, lambda}], {a > b > 0, k > 0, >>> l\[Element]Reals}] >>> produces the following warning >>> "Solve::ifun: Inverse functions are being used by Solve, >>> so some solutions may not be found; use Reduce for complete >>> solution information" >>> and the following four solutions (here in the InputForm) >>> {{lambda -> -((a*b)/Sqrt[b^2*k^2 + a^2*l^2]), >>> t -> -ArcCos[-((a*l)/Sqrt[b^2*k^2 + a^2*l^2])]}, >>> {{lambda -> -((a*b)/Sqrt[b^2*k^2 + a^2*l^2]), >>> t -> -ArcCos[-((a*l)/Sqrt[b^2*k^2 + a^2*l^2])]}, >>> {lambda -> -((a*b)/Sqrt[b^2*k^2 + a^2*l^2]), >>> t -> ArcCos[-((a*l)/Sqrt[b^2*k^2 + a^2*l^2])]}, >>> {lambda -> (a*b)/Sqrt[b^2*k^2 + a^2*l^2], >>> t -> -ArcCos[(a*l)/Sqrt[b^2*k^2 + a^2*l^2]]}, >>> {lambda -> (a*b)/Sqrt[b^2*k^2 + a^2*l^2], >>> t -> ArcCos[(a*l)/Sqrt[b^2*k^2 + a^2*l^2]]}} >>> >>> The warning suggests that some solutions might be missing. In fact, >>> Solve produces two extra expressions that are not solutions. >>> eq /. sol // Simplify[#, {a > b > 0, k > 0, l\[Element]Reals}] & >>> returns >>> {False,True,True,False} >>> >>> My questions are: >>> >>> 1. Is that a bug or feature that Solve produces expressions that are >>> not solutions for the original equations? >>> >>> 2. How to make Solve to return only 'true' solutions? >>> >>> On a side note, I tried Reduce only once because Mathematica froze my >>> PC. >>> >>> AK >>> >>> >> In this type of equations the appearance of "phantom" solutions is a >> consequence of the method used for solving them. It is not a feature >> of >> Mathematica or of Solve. The only way to eliminate these phantoms is >> to >> perform the sort of verification you have done. Mathematica does not >> do >> it automatically because in most cases of equations with non-numerical >> parameters such a verification is impossible and trying to do so would >> simply mean that Mathematica would appear to hang. In your case >> verification can be accomplished only with the additional information >> about the parameters included in Simplify but Solve cannot use it. >> Reduce, however, can: >> >> >> >> FullSimplify[Reduce[Flatten[{Thread[eq], >> {a > b > 0, k > 0, l $B":(B Reals}}], {t, lambda}], >> {a > b > 0, k > 0, l $B":(B Reals}] >> >> >> C[1] $B":(B Integers && >> ( >> t == 2*(ArcCot[(b*k)/(a*l - Sqrt[b^2*k^2 + >> a^2*l^2])] + Pi*C[1]) && >> lambda == (a*b)/Sqrt[b^2*k^2 + a^2*l^2] || >> t == 2*(ArcCot[(b*k)/(a*l + Sqrt[b^2*k^2 + >> a^2*l^2])] + Pi*C[1]) && >> (a*b)/Sqrt[b^2*k^2 + a^2*l^2] + lambda == 0) >> >> (Mathematica 5.0 under Mac OS X 10.3.5) >> Andrzej Kozlowski Chiba, Japan http://www.mimuw.edu.pl/~akoz/ >> >> >> > > > > -- > DrBob at bigfoot.com > www.eclecticdreams.net >

**References**:**Re: Reduce/Solve***From:*"Dana DeLouis" <delouis@bellsouth.net>

**Re: Re: Reduce/Solve***From:*DrBob <drbob@bigfoot.com>

**Re: Reduce/Solve***From:*ankowar@yahoo.com (Andy Kowar)

**Re: Re: Reduce/Solve***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>