Using one of the roots of a polynomial



On Thu, Mar 8, 2012 at 11:06 AM, Vishnu Rajasekharan <vishraj at gmail.com>wrote:

> Greetings,
>
> I obtained three roots for a cubic equation. I want to use one of the
> roots later on in my calculation. Is there a way in maxima where I can pick
> and choose one of the roots for later use.
>
>
You mean something like this:

 (%i1) solve((x-1)*(x^2+x+1),x);

(%o1) [x = -(sqrt(3)*%i+1)/2,x = (sqrt(3)*%i-1)/2,x = 1]
(%i2) rhs(%o1[3]);

(%o2) 1

For the second root, you can use rhs(%o1[2]).

Ray