How to properly work with inequalities
- Subject: How to properly work with inequalities
- From: aleksasd at mruni.eu
- Date: Tue, 31 May 2011 23:04:19 +0300
Problem: solve inequation 7*x+2<-x-3
(%i1) S:7*x+2<-x-3$
1 method
(%i2) assume(S);
(%o2) [x<-5/8]
2 method
(%i3) to_poly_solve([S], [x]);
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $
(%o3) %union([x<-5/8])
(%i4) sol:first(%);
(%o4) [x<-5/8]
3 method
(%i5) load(ineq)$
(%i6) S-2;
(%o6) 7*x<-x-5
(%i7) %+x;
(%o7) 8*x<-5
(%i8) %/8;
(%o8) x<-5/8
4 method
(%i9) load(solve_rat_ineq);
(%o9)
"C:/PROGRA~2/MAXIMA~1.0/share/maxima/5.24.0/share/contrib/solve_rat_ineq.mac"
(%i10) solve_rat_ineq(S);
(%o10) [[x<-5/8]]
(%i11) sol:%[1];
(%o11) [x<-5/8]
Aleksas D