Ask Your Question
1

Get Sage to display the 2nd x value, when function is set to 0?

asked 2013-07-23 13:43:59 +0100

bxdin gravatar image

updated 2015-01-31 20:11:42 +0100

FrédéricC gravatar image

I did the following and only got 3/2 as an answer, instead of getting 3/2 & 8, as an answer:

ans=solve(2*x^2-19*x+24==0,x)
x0=ans[0].rhs()
show(x0)

Doing, factor(2x^2-19x+24), displays, (x - 8)(2x - 3).

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2013-07-23 13:56:51 +0100

calc314 gravatar image

If you print ans, you will see that the result of solve is:

[x == (3/2),x == 8]

When you do ans[0].rhs(), you are grabbing the right hand side of the first statement. To get the second one, do ans[1].rhs().

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-07-23 13:43:59 +0100

Seen: 298 times

Last updated: Jul 23 '13