Working with Inequalities



*Thomas D. Dean* tomdean at speakeasy.org
<maxima%40math.utexas.edu?Subject=Re%3A%20%5BMaxima%5D%20Working%20with%20Inequalities&In-Reply-To=%3C4F23B343.4090408%40speakeasy.org%3E>
*Sat Jan 28 02:35:15 CST 2012   *wrote:


 How do I solve this?


   x^2 + 2*x=3 and 7*x+2<-x-3

I found solve_rat_ineq.  That handles the inequality OK.

(%i1) solve(x^2 + 2*x=3,x);
(%o1) [x = - 3, x = 1]
(%i2) solve_rat_ineq(7*x+2<-x-3);
                                          5
(%o2)                            [[x < - -]]
                                          8

The solution is x = -3

Tom Dean
 *******************************************
 first method:
(%i1) eq:x^2 + 2*x=3$
(%i2) ineq:7*x+2<-x-3$
(%i3) sol:solve(eq);
(%o3) [x=-3,x=1]
(%i4) sublist(sol,lambda([e],ev(ineq,e)));
(%o4) [x=-3]

 second method:
(%i5) to_poly_solve([eq,ineq], [x]);
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
(%o5) %union([x=-3])
(%i6) first(%);
(%o6) [x=-3]

Aleksas D