       RE: Problems with Solve

• To: mathgroup at smc.vnet.net
• Subject: [mg17028] RE: [mg17010] Problems with Solve
• From: "Krautschik, Chris G" <krautschikc at intel.co.jp>
• Date: Wed, 14 Apr 1999 02:11:47 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Tanveer,

While I am quite new to Mathematica myself try  the following lines of code.
There may be better and more elegant ways of capturing the results from
solve, but the code below seem to work.

Good luck!
Chris

==============================================================
eq1=3*x^2 +2*x -1
result=Solve[eq1==0,x]
-1 + 2xx + 3x^2
{{x->-1}, {x->1/3}}

assign  the first and second root solutions  of eq1 to x1, x2 , respetively:
x1=x/. result[]
x2=x/. result[]
-1
1/3

check and see if results of x1, x2 indeed reduce to zero (when inserted into
eq1):
eq1/.x->x1
eq1/.x->x2
0
0

CONCLUSION: x1, x2 are the correct roots for eq1!

-----Original Message-----
From: Tanveer Choudhury [mailto:tanveer at wam.umd.edu]
To: mathgroup at smc.vnet.net
Subject: [mg17028] [mg17010] Problems with Solve

I have an equation
eqn == rhs

Solving in the following way

Solve[eqn,x]

the output is something like

x->2.11

how do I save the value for x to someother variable...

u can mail to tanveer at wam.umd.edu

thanx

```

• Prev by Date: Re:PoissonDistribution
• Next by Date: Border on Tables
• Previous by thread: Re: Problems with Solve
• Next by thread: Re: Problems with Solve