First time here? Check out the FAQ!

Ask Your Question
0

Incomplete answer to inequality

asked 5 years ago

gg gravatar image

updated 5 years ago

Consider the following inequality:

Q - 1 < (2*x + 3) < 9

Ans - x lies between (-1, 3)

But sagemath is only returning x > -1 as the answer, which is incomplete. Why is that?

sage: 
sage: solve([ 1  < 2*x + 3 < 9 ], x)
[[x > -1]]
sage:
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 5 years ago

Juanjo gravatar image

You need to provide a list of inequalities:

sage: solve([1 < 2*x + 3, 2*x + 3 < 9], x)
[[-1 < x, x < 3]]
Preview: (hide)
link

Comments

Thanks its working now!

gg gravatar imagegg ( 5 years ago )

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 5 years ago

Seen: 252 times

Last updated: Feb 29 '20