This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Maximize

Maximize
maximizes f with respect to x.
Maximize
maximizes f with respect to x, y, ....
Maximize
maximizes f subject to the constraints cons.
Maximize
maximizes with variables over the domain dom, typically Reals or Integers.
  • cons can contain equations, inequalities, or logical combinations of these.
  • If f and cons are linear or polynomial, Maximize will always find a global maximum.
  • Maximize will return exact results if given exact input.
  • If Maximize is given an expression containing approximate numbers, it automatically calls NMaximize.
  • If the maximum is achieved only infinitesimally outside the region defined by the constraints, or only asymptotically, Maximize will return the supremum and the closest specifiable point.
  • If no domain is specified, all variables are assumed to be real.
  • Integers can be used to specify that a particular variable can take on only integer values.
Maximize a univariate function:
Maximize a multivariate function:
Maximize a function subject to constraints:
A maximization problem containing parameters:
Maximize a univariate function:
In[1]:=
Click for copyable input
Out[1]=
 
Maximize a multivariate function:
In[1]:=
Click for copyable input
Out[1]=
 
Maximize a function subject to constraints:
In[1]:=
Click for copyable input
Out[1]=
 
A maximization problem containing parameters:
In[1]:=
Click for copyable input
Out[1]=
Unconstrained univariate polynomial maximization:
Constrained univariate polynomial maximization:
Univariate transcendental maximization:
Univariate piecewise maximization:
Multivariate linear constrained maximization:
Linear-fractional constrained maximization:
Unconstrained polynomial maximization:
Constrained polynomial optimization can always be solved:
The maximum value may not be attained:
The objective function may be unbounded:
There may be no points satisfying the constraints:
Algebraic maximization:
Bounded transcendental maximization:
Piecewise maximization:
Unconstrained parametric maximization:
Constrained parametric maximization:
Integer linear programming:
Polynomial maximization over the integers:
Finding the exact solution takes a long time due to high-degree algebraic number operations:
With WorkingPrecision, you get an exact maximum value, but it might be incorrect:
Find the maximal area among rectangles with a unit perimeter:
Find the maximal area among triangles with a unit perimeter:
Find the maximum height reached by a projectile:
Find the maximum range of a projectile:
Maximize gives an exact global maximum of the objective function:
NMaximize attempts to find a global maximum numerically, but may find a local maximum:
FindMaximum finds local maxima depending on the starting point:
The maximum point satisfies the constraints, unless messages say otherwise:
The given point maximizes the distance from the point .
When the maximum is not attained, Maximize may give a point on the boundary:
Here the objective function tends to the maximum value when y tends to infinity:
Maximize can solve linear programming problems:
LinearProgramming can be used to solve the same problem given in matrix notation:
This computes the maximum value:
Maximize requires that all functions present in the input be real-valued:
Values for which the equation is satisfied but the square roots are not real are disallowed:
New in 5 | Last modified in 6