Dear all,
there is another way, using SOLUTIONS instead of SOLVE
(which you might already know):
SOLUTIONS(x^2 - 4·x - 12 = 0, x) delivers the vector (list) [-2,6]
so you can easily extract the first solution with
SOLUTIONS(x^2 - 4·x - 12 = 0, x) sub 1
and the second one accordingly
SOLUTIONS(x^2 - 4·x - 12 = 0, x) sub 2.
Best regards
Josef
-----Ursprüngliche Nachricht-----
Von: DERIVE computer algebra system
[mailto:[log in to unmask]]Im Auftrag von Ignacio Larrosa
Caņestro
Gesendet: Donnerstag, 20. November 2003 17:34
An: [log in to unmask]
Betreff: Re: selecting one of two solutions of a quadratic equation
----- Original Message -----
From: "Volker Loose" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Thursday, November 20, 2003 4:53 PM
Subject: selecting one of two solutions of a quadratic equation
> Hello Derivers,
>
> is it possible to select one of two solutions of a
> quadratic equation?
> Example: With L:=solve(x^2-4x-12=0,x) I get
> L=(x=6 v x= - 2).
> With sub 1 I get the first element of a vector. I'm
> looking for something like that in this context.
>
>
> Meanwhile I found out LHS and RHS does what I
> want: LHS(L)=(x=6).
With
RHS(LHS(SOLVE(x^2 - 4·x - 12 = 0, x)))
you get directly the first solution: 6
And with
RHS(RHS(SOLVE(x^2 - 4·x - 12 = 0, x)))
the second one: -2
Saludos,
Ignacio Larrosa Caņestro
A Coruņa (Espaņa)
[log in to unmask]
|