MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Solve question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57466] Re: [mg57457] Solve question
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 29 May 2005 01:03:25 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

eqn=a*x^2+b*x+c==0;

soln=Solve[eqn,x]

{{x -> (-b - Sqrt[b^2 - 4*a*c])/(2*a)}, 
  {x -> (Sqrt[b^2 - 4*a*c] - b)/(2*a)}}

The result is a set of rules, {lhs -> rhs}.  Rules are used with Replace, 
ReplaceAll ( /. ), or ReplaceRepeated ( //. ).  For example, verifying that the 
solutions satisfy the original equation:

eqn/.soln //Simplify

{True,True}


Bob Hanlon

> 
> From: "Sterritt, Lanny" <lanny.sterritt at lmco.com>
To: mathgroup at smc.vnet.net
> Date: 2005/05/28 Sat AM 05:39:41 EDT
> Subject: [mg57466] [mg57457] Solve question
> 
> When the Solve command is used to obtain the value of a variable in an 
equation, something like  {x -> value}  is returned.  How does one get 
Mathematica  to automatically apply this value to following  expressions in a 
notebook?
> 
> L.W.Sterritt
> 
> 


  • Prev by Date: Re: Re: Re: Applying a list of functions to a list of arguments
  • Next by Date: Re: Limit of list
  • Previous by thread: Re: Solve question
  • Next by thread: Re: Solve question