# Minimization and Maximization

Minimize[expr,{x_{1},x_{2},…}] | minimize expr |

Minimize[{expr,cons},{x_{1},x_{2},…}] | minimize expr subject to the constraints cons |

Maximize[expr,{x_{1},x_{2},…}] | maximize expr |

Maximize[{expr,cons},{x_{1},x_{2},…}] | maximize expr subject to the constraints cons |

Minimization and maximization.

Minimize and Maximize yield lists giving the value attained at the minimum or maximum, together with rules specifying where the minimum or maximum occurs.

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

Minimize[expr,x] minimizes expr allowing x to range over all possible values from to . Minimize[{expr,cons},x] minimizes expr subject to the constraints cons being satisfied. The constraints can consist of any combination of equations and inequalities.

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

Minimize and Maximize can solve any *linear programming* problem in which both the objective function expr and the constraints cons involve the variables only linearly.

In[8]:= |

Out[8]= |

They can also in principle solve any *polynomial programming* problem in which the objective function and the constraints involve arbitrary polynomial functions of the variables. There are many important geometrical and other problems that can be formulated in this way.

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

An important feature of Minimize and Maximize is that they always find *global* minima and maxima. Often functions will have various local minima and maxima at which derivatives vanish. But Minimize and Maximize use global methods to find absolute minima or maxima, not just local extrema.

In[11]:= |

Out[11]= |

In[12]:= |

Out[12]= |

If you give functions that are unbounded, Minimize and Maximize will return and as the minima and maxima. And if you give constraints that can never be satisfied, they will return and as the minima and maxima, and Indeterminate as the values of variables.

One subtle issue is that Minimize and Maximize allow both *nonstrict* inequalities of the form , and *strict* ones of the form . With nonstrict inequalities there is no problem with a minimum or maximum lying exactly on the boundary . But with strict inequalities, a minimum or maximum must in principle be at least infinitesimally inside the boundary.

In[13]:= |

Out[13]= |

Minimize and Maximize normally assume that all variables you give are real. But by giving a constraint such as x∈Integers you can specify that a variable must in fact be an integer.

In[14]:= |

Out[14]= |

Minimize and Maximize can compute maxima and minima of linear functions over the integers in bounded polyhedra. This is known as integer linear programming.

In[15]:= |

Out[15]= |

Minimize and Maximize can produce exact symbolic results for polynomial optimization problems with parameters.

In[16]:= |

Out[16]= |

MinValue[{f,cons},{x,y,…}] | give the minimum value of f subject to the constraints cons |

MaxValue[{f,cons},{x,y,…}] | give the maximum value of f subject to the constraints cons |

ArgMin[{f,cons},{x,y,…}] | give a position at which f is minimized subject to the constraints cons |

ArgMax[{f,cons},{x,y,…}] | give a position at which f is maximized subject to the constraints cons |

Computing values and positions of minima and maxima.

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

In[19]:= |

Out[19]= |

In[20]:= |

Out[20]= |

In[21]:= |

Out[21]= |