Graphing inequality on a number line?
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?
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(t)) for i in s]))
and then plot it to see the solution set:
sage: plot(f,-10,10, fill='axis')
Asked: 2014-08-18 15:11:18 -0500
Seen: 184 times
Last updated: Aug 18 '14