Ask Your Question

Graphing inequality on a number line?

asked 2014-08-18 15:11:18 -0500

I can certainly get the solution set for $x^2 - 9 \geq 0$, but how do I get this solution set visualized on a number line?

edit retag flag offensive close merge delete


1-d plots are not implemented - see

kcrisman gravatar imagekcrisman ( 2014-08-18 17:14:01 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-18 17:44:46 -0500

tmonteil gravatar image

updated 2014-08-18 17:49:01 -0500

You can get the characteristic function of the solution set (which is a list of lists of symbolic elements) as follows:

sage: s = solve(x^2 - 9 >= 0, x)
sage: f = lambda t : min(1, sum([bool(i[0](t)) for i in s]))

and then plot it to see the solution set:

sage: plot(f,-10,10)

or even:

sage: plot(f,-10,10, fill='axis')
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

1 follower


Asked: 2014-08-18 15:11:18 -0500

Seen: 184 times

Last updated: Aug 18 '14