Re: Strange Behaviour of Solve?
- To: mathgroup at smc.vnet.net
- Subject: [mg79039] Re: Strange Behaviour of Solve?
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Mon, 16 Jul 2007 02:21:55 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f7cash$9ab$1@smc.vnet.net>
Andreas Maier wrote:
> Hi,
>
> i tried (using Mathematica 6.0) to solve a system of equations:
>
> In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, g]
> Out:={}
>
> But when i use
>
> In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, {a, b, g}]
> Out={{g -> -c/Sqrt[c^2 + v^2], b -> -c/Sqrt[c^2 + v^2],
> a -> -v/Sqrt[c^2 + v^2]}, {g -> c/Sqrt[c^2 + v^2],
> b -> c/Sqrt[c^2 + v^2], a -> v/Sqrt[c^2 + v^2]}}
>
> i suddenly get the solution for g. It seems to me, that the number
> of solutions for one variable depends on the number of variables
> i want to solve for. Is this behaviour of Solve to be
> expected?
>
> Andreas Maier
You may have overlooked the second form of the *Solve* function. The
online help tells us that, "Solve[eqns, vars, elims] attempts to solve
the equations for vars, eliminating the variables elims." Therefore,
In[1]:= Solve[{b == g, a == g*(v/c), b^2 + a^2 == 1}, g, {a, b}]
Out[1]=
c c
{{g -> -(-------------)}, {g -> -------------}}
2 2 2 2
Sqrt[c + v ] Sqrt[c + v ]
returns the expected result for g.
Regards,
Jean-Marc