       Re: Utilizing the Result From Solve[]

• To: mathgroup at smc.vnet.net
• Subject: [mg64133] Re: Utilizing the Result From Solve[]
• From: Helen Read <hpr at together.net>
• Date: Thu, 2 Feb 2006 00:06:16 -0500 (EST)
• References: <drq0gm\$mr6\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Shyam Guthikonda wrote:
> If I am solving a simple equation, such as: Solve[z+2 = = 3,z], this
> returns {{z->1}}. How can I easily get the result, 1? Solve[] returns
> the solution in rule form.
>
> The current method I use to just get the result looks very ugly. Is
> there an easier way to do this?
>
> Here is my current method:
>
> ReplaceAll[z, First[ First[ Solve[ z + 2 = = 3, z ]]]];
> z = %;
>
> Now I can use z as a normal variable.

z = z /. Solve[z + 2 == 3, z][]

Though personally, I would name the specific result something like z1

z1= z /. Solve[z + 2 == 3, z][]

This way you can go on to solve *other* equations involving the variable
z (giving the solutions different names) without having to Clear[z].

--