Re: Solve vs Reduce
- To: mathgroup at smc.vnet.net
- Subject: [mg94664] Re: [mg94627] Solve vs Reduce
- From: "Jaccard Florian" <Florian.Jaccard at he-arc.ch>
- Date: Fri, 19 Dec 2008 07:24:50 -0500 (EST)
- References: <200812181220.HAA00318@smc.vnet.net> <1EF82055-5EB8-4070-9684-56583245EAB2@mimuw.edu.pl>
Dear Andrzej, Thank you very much for your answer, and the time you take to help me. I'm still surprised with the way Reduce worksâ?¦ In fact, looking at your answer, I understand better why Mathematicaâ??s Output is consistent in this case : In[1]:= equations = {5/(x + y) == 2/y,Dt[5/(x + y) == 2/y, t],Dt[x, t] == 1, x == 5}; In[2] := Reduce[equations, Dt[y, t]] Out[2]= False But why do I obtain the expected answer if I specify more variables to be solved for? In[3]:= Reduce[equations, {Dt[y, t],Dt[x, t], x, y}] Out[3]= Dt[y, t] == 2/3 && Dt[x, t] == 1 && x == 5 && y == 10/3 Here, Mathematica won't express one of the derivatives in terms of the other and y in terms of x... Isn't it strange that Reduce sees a contradiction in In[2], but not in In[3] ? Also funny : If I use Solve in the configuration where Reduce sees a contradiction, Solve doesnâ??t see one: In[4]:= Solve[equations, Dt[y, t]] Out[4]= {{Dt[y, t] -> 2/3}} But if I use Solve where Reduce doesn't see a contradiction, Solve sees one: In[5]:= Solve[equations, {Dt[y, t],Dt[x, t], x, y}] Out[5]= {} Even after a long time using Mathematica, I'm surprised! Best Regards, and Merry Christmas! Florian Jaccard -----Message d'origine----- De : Andrzej Kozlowski [mailto:akoz at mimuw.edu.pl] Envoyé : vendredi, 19. décembre 2008 02:04 Ã? : Jaccard Florian Cc : mathgroup at smc.vnet.net Objet : Re: [mg94627] Solve vs Reduce On 18 Dec 2008, at 21:20, Jaccard Florian wrote: > Hello! > > I have the following system : > > In[1]:= equations = {5/(x + y) == 2/y, Dt[5/(x + y) == 2/y, = > t], Dt[x, t] > == 1, x == 5} > > As you can see, Solve manages very well to find Dt[y,t] : > > In[2]:= Solve[equations, Dt[y, t]] > > Out[2]= {{Dt[y, t] -> 2/3}} > > Why isn't Reduce able to find the solution? > > In[3]:= Reduce[equations, Dt[y, t]] > > Out[3]= False > > Regards, and thanks to all who will answer! > > Florian Jaccard > > The reason is (I am speculating here a bit) that Reduce attempts to solve all kind of equations, not essentially algebraic ones, so it does treat the derivatives in your equations as such rather than as mere names of variables occurring in the equations. Taking this into account your two equations In[42]:= Reduce[{Dt[x, t] == 1, x == 5}] Out[42]= False appear to be inconsistent, since the derivative of a constant can't be one. If you remove the equation Dt[x, t] == 1,the system will be solved: Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) == -((2*Dt[y, t])/y^2), x == 5}, {y, x, Dt[y, t]}] y == 10/3 && x == 5 && Dt[y, t] == 0 Note that this is a consistent solution (y is a constant and hence Dt[y,t]==0). If you include both Dt[x,t] and Dt[y,t] in the list of variables you will get a different looking solution: Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) == -((2*Dt[y, t])/y^2), x == 5}, {y, x, Dt[y, t], Dt[x, t]}] y == 10/3 && x == 5 && Dt[x, t] == (3*Dt[y, t])/2 Note that this is also consistent (even though both Dt[x, t] and Dt[y, t] must actually be zero). Also, note that if you removed from the system the equation x==5 instead of Dt[x,t]==1 you will not get a solution: Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) == -((2*Dt[y, t])/y^2), Dt[x, t] == 1}, Dt[y, t]] During evaluation of In[39]:= Reduce::nsmet:This system cannot be solved with the methods available to Reduce. >> Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) == -((2*Dt[y, t])/y^2), Dt[x, t] == 1}, Dt[y, t]] This is not surprising since in order to compute Dt[y,t], you would need to solve a differential equation, which it does not do. However, if you include both Dt[y,t] and Dt[x,t] among the variables to be solved for the system will be solved, since Reduce will now express one of the derivatives in terms of the other and y in terms of x (so it does not have to express them in terms of t) Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) == -((2*Dt[y, t])/y^2), Dt[x, t] == 1}, {Dt[y, t], Dt[x, t], x, y}] Dt[y, t] == 2/3 && Dt[x, t] == 1 && y == (2*x)/3 && x != 0 Finally, instead of the differential equation Dt[x, t] == 1 you use one of its solutions, for example, x==t, you will get: Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) == -((2*Dt[y, t])/y^2), x == t}, {Dt[y, t], x, y}, Reals] (t < 0 || t > 0) && Dt[y, t] == 2/3 && x == t && y == (2*x)/3 or Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) == -((2*Dt[y, t])/y^2), x == t}, {Dt[y, t], Dt[x, t], x, y}, Reals] (t < 0 || t > 0) && Dt[x, t] == (3*Dt[y, t])/2 && x == t && y == (2*x)/3 All of these look to me like valid and useful answers, demonstrating that Reduce can be used even in contexts in which I would not have tried to use it before I saw your post ;-) Andrzej Kozlowski
- References:
- Solve vs Reduce
- From: "Jaccard Florian" <Florian.Jaccard@he-arc.ch>
- Solve vs Reduce