Ask Your Question
0

Incomplete answer to inequality

asked 2020-02-29 15:30:57 +0100

gg gravatar image

updated 2020-02-29 15:41:31 +0100

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 16:14:12 +0100

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-03-01 05:57:43 +0100 )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 15:30:57 +0100

Seen: 230 times

Last updated: Feb 29 '20