First time here? Check out the FAQ!

Ask Your Question
1

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

asked 11 years ago

bxdin gravatar image

updated 10 years ago

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).

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 11 years ago

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().

Preview: (hide)
link

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: 11 years ago

Seen: 335 times

Last updated: Jul 23 '13