Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Solve in inequalities return two separate solutions. Could they be gathered ?

In the following code, I wonder if there is a way to ask solve() to return only one solution with $\leq$ and not one for $<$ and one for $=$.

var('x_1','x_2') eq2=solve(5x_1+6x_2<-8,x_1) eq4=solve(2x_1-3x_2<-8,x_1) l1=solve(eq4[0][0].rhs()>eq2[0][0].rhs(),x_1) l2=solve(eq4[0][0].rhs()>=eq2[0][0].rhs(),x_2) show(l1) show(l2)

Solve in inequalities return two separate solutions. Could they be gathered ?

In the following code, I wonder if there is a way to ask solve() to return only one solution with $\leq$ and not one for $<$ and one for $=$.

var('x_1','x_2')
eq2=solve(5x_1+6x_2<-8,x_1)
eq4=solve(2x_1-3x_2<-8,x_1)
eq2=solve(5*x_1+6*x_2<-8,x_1)
eq4=solve(2*x_1-3*x_2<-8,x_1)
l1=solve(eq4[0][0].rhs()>eq2[0][0].rhs(),x_1)
l2=solve(eq4[0][0].rhs()>=eq2[0][0].rhs(),x_2)
show(l1) 
show(l2)

show(l2)