Question: Extracting components of a equation solution

Hi all

I have trouble extracting components from of  equation solutions:

p1 := x^2+y;

e:=solve({p1}, {x});

                                         e := {x = sqrt(-y)}, {x = -sqrt(-y)}

next I used rhs() to extract right component of the first solution

x1 := rhs(e[1]);

but I got the error:

Error, invalid input: rhs received {x = (-y)^(1/2)}, which is not valid for its 1st argument, expr

I don't know how to deal with this problem.

Could someone help me out?  Thanks alot!!

Tain

 

 

Please Wait...