Ask Your Question
0

Incomplete answer to inequality

asked 2020-02-29 08:30:57 -0500

gg gravatar image

updated 2020-02-29 08:41:31 -0500

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:
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-02-29 09:14:12 -0500

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]]
edit flag offensive delete link more

Comments

Thanks its working now!

gg gravatar imagegg ( 2020-02-29 22:57:43 -0500 )edit

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: 2020-02-29 08:30:57 -0500

Seen: 35 times

Last updated: Feb 29