Re: inequalities ... HELP!
- To: mathgroup at smc.vnet.net
- Subject: [mg17461] Re: [mg17431] inequalities ... HELP!
- From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
- Date: Sun, 9 May 1999 04:43:58 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Actually Mathematica has some very powerful tools for dealing with inequalities, which range in sophistication from High School to Graduate School. At the lowest level you have the Graphics`FilledPlot` package. It can be used to plot the area between the graphs of two functions, which you can use to display the points in the plane for which an inequality holds. In the case of algebraic inequalities it is often useful to combine this with the package Algebra`InequalitySolve` which can tell you for which values a given (algebraic) inequality in one variable holds.Let me illustrate this with a simple example. Suppose we want to find the solutions of the algebraic inequality: Problem: Find the pairs (x,y) for which 3x^3+7x^2+2 <y<x^3-x^2+11 First we load the InequalitySolve package In[1]:= <<Algebra`InequalitySolve` Next, we solve the inequality 3x^3+7x^2+2 <x^3-x^2+11, i.e. we find out for which values of x it holds: In[2]:= N[InequalitySolve[x^3-x^2+11>3x^3+7x^2+2,x]] Out[2]= x < -3.66498 || -1.28818 < x < 0.953159 This tells us that either x < -3.66498 or x must be between -1.28818 and 0.953159. We now load the FilledPlot package: In[3]:= << Graphics`FilledPlot` We can see the pairs (x,y) for which the inequality holds by using In[4]:= FilledPlot[{x^3-x^2+11,3x^3+7x^2+2},{x,-1.28818, 0.953159}] and In[5]:= FilledPlot[{x^3-x^2+11,3x^3+7x^2+2},{x,-6, -3.66498 }] (in this second case you can take for the lower limit any number < -3.66498) Mathematica also has a much more sophisticated package for solving algebraic inequalities. This is the Algebra`AlgebraicInequalities` package. It can solve simultaneous algebraic inequalities in anynumber of variables. The idea is roughly this. Suppose you have several polynomials in sevral variables. For simplicity lets assume that there are only two variables x and y and th epolynomials are p(x,y) and q(x,y). The pairs (x,y) which satisfy p(x,y)==0 lie on a curve, similarly for q(x,y). These curves divide the x-y plane into regions such that withing each region the sign of p(x,y) and q(x,y) is constant. If you remove the curves from the plane what remains is called a semi-algebraic set. The areas where the sign of p(x,y) and q(x,y) is constant are called the semi-algebraic components of this semi-algebraic set. So, for example to solve the inequalities p(x,y)>0, q(x,y) <0 we need to find just one point in each component where these inequalities hold. We can solve the previous problem using this method. First, we load in the package: In[7]:= <<Algebra`AlgebraicInequalities` Now, we find the semialgebraic components: In[8]:= SemialgebraicComponents[{3x^3+7x^2+2 <y,y<x^3-x^2+11},{x,y}] Out[8]= 21 {{-5, -192}, {0, --}} 8 We see that there are two, which agrees with the previous solution. This is all the package does for you. Yet this is really enough. We can display the answer to our question by telling Mathematica to draw the curves together with the two points in the semi-algebraic components: In[9]:= Plot[{3*x^3 + 7*x^2 + 2, x^3 - x^2 + 11}, {x, -6, 2}, PlotRange -> {-200, 40}, Epilog -> {PointSize[0.02], Point[{-5, -192}], Point[{0, 21/8}]}] You can clearly see the two components where the inequalities are satisfied (the areas enclosed by the curves and containing the two points). In this case this is of course the more complicated way to solve the problem but in general this method is far more powerful than the first one. -- Andrzej Kozlowski Toyama International University JAPAN http://sigma.tuins.ac.jp http://eri2.tuins.ac.jp ---------- >From: "alessandro" <sfdyv at tin.it> To: mathgroup at smc.vnet.net >To: mathgroup at smc.vnet.net >Subject: [mg17461] [mg17431] inequalities ... HELP! >Date: Thu, May 6, 1999, 3:44 PM > > Hi from Italy ! :) > > I'm a student and new to Mathematica. > I'm in trouble with inequalities, it's seems that you can do little thing > with them and it's seems strange to me that. > > So could you give me some example of doing inequalities in MATHEMATICA?! > > Thanx in advance :) > > Bye from Italy > > Alessandro > > sfdyv at tin.it > > >