1.5.8 Inequalities
| Reduce[ineqs, {x, y, ... }] | reduce a collection of inequalities | | FindInstance[ineqs, {x, y, ... }] | find an instance that satisfies the ineqs |
Handling inequalities. | This finds a reduced form for the inequalities. | |
In[1]:=
Reduce[x + y < 1 && y > x > 0, {x, y}]
|
Out[1]=
|
|
| These inequalities can never be satisfied. | |
In[2]:=
Reduce[x + y < 1 && y > x > 1, {x, y}]
|
Out[2]=
|
|
| It is easy to end up with rather complicated results. | |
In[3]:=
Reduce[x + y < 1 && y^2 > x > 0, {x, y}]
|
Out[3]=
|
|
Equations can often be solved to give definite values of variables. But inequalities typically just define regions that can only be specified by other inequalities. You can use FindInstance to find definite values of variables that satisfy a particular set of inequalities. | This finds a point in the region specified by the inequalities. | |
In[4]:=
FindInstance[x + y < 1 && y^2 > x > 0, {x, y}]
|
Out[4]=
|
|
| Minimize[{expr, ineq}, {x, y, ... }] | minimize expr while satisfying ineqs | | Maximize[{expr, ineq}, {x, y, ... }] | maximize expr while satisfying ineqs |
Constrained minimization and maximization. | This gives the maximum, together with where it occurs. | |
In[5]:=
Maximize[{x^2 + y, x^2 + y^2 1}, {x, y}]
|
Out[5]=
|
|
|