Ask Your Question

Revision history [back]

simplifying rational inequality results

The command

solve(abs((2*x-2)/(x-5)) <= 2/3, x)

yields

#0: solve_rat_ineq(ineq=2*abs(x-1)/abs(x-5)-2/3 <= 0)
[[x == -1, -6 != 0, -6 != 0], [x == -1, -6 != 0, -6 != 0, -6 != 0], [x
== -1, -6 != 0, -6 != 0], [x == -1, -6 != 0, -6 != 0, -6 != 0], [x == 2,
-3 != 0, -3 != 0], [x == 2, -3 != 0, -3 != 0, -3 != 0], [x == 2, -3 !=
0, -3 != 0], [x == 2, -3 != 0, -3 != 0, -3 != 0], [x == 1], [1 < x, x
< 2], [-1 < x, x < 1]]

Is there a way to simplify that output to get something like

[[-2 <= x, x <= 1]]

?

click to hide/show revision 2
fixed the expected result :)

simplifying rational inequality results

The command

solve(abs((2*x-2)/(x-5)) <= 2/3, x)

yields

#0: solve_rat_ineq(ineq=2*abs(x-1)/abs(x-5)-2/3 <= 0)
[[x == -1, -6 != 0, -6 != 0], [x == -1, -6 != 0, -6 != 0, -6 != 0], [x
== -1, -6 != 0, -6 != 0], [x == -1, -6 != 0, -6 != 0, -6 != 0], [x == 2,
-3 != 0, -3 != 0], [x == 2, -3 != 0, -3 != 0, -3 != 0], [x == 2, -3 !=
0, -3 != 0], [x == 2, -3 != 0, -3 != 0, -3 != 0], [x == 1], [1 < x, x
< 2], [-1 < x, x < 1]]

Is there a way to simplify that output to get something like

[[-2 [[-1 <= x, x <= 1]]
2]]

?