# ArgMax

ArgMax[f,x]

gives a position xmax at which f is maximized.

ArgMax[f,{x,y,}]

gives a position {xmax,ymax,} at which f is maximized.

ArgMax[{f,cons},{x,y,}]

gives a position at which f is maximized subject to the constraints cons.

ArgMax[,xreg]

constrains x to be in the region reg.

ArgMax[,,dom]

constrains variables to the domain dom, typically Reals or Integers.

# Details and Options

• ArgMax[,vars,] is effectively equivalent to vars/.Last[Maximize[,vars,].
• cons can contain equations, inequalities, or logical combinations of these.
• The constraints cons can be any logical combination of:
•  lhs==rhs equations lhs!=rhs inequations lhs>rhs or lhs>=rhs inequalities {x,y,…}∈reg region specification Exists[x,cond,expr] existential quantifiers
• If f and cons are linear or polynomial, ArgMax will always find a global maximum.
• ArgMax[{f,cons},xreg] is effectively equivalent to ArgMax[{f,consxreg},x].
• For xreg, the different coordinates can be referred to using Indexed[x,i].
• ArgMax will return exact results if given exact input.
• If ArgMax is given an expression containing approximate numbers, it automatically calls NArgMax.
• If the maximum is achieved only infinitesimally outside the region defined by the constraints, or only asymptotically, ArgMax will return the closest specifiable point.
• If no domain is specified, all variables are assumed to be real.
• xIntegers can be used to specify that a particular variable can take on only integer values.
• If the constraints cannot be satisfied, ArgMax returns {Indeterminate,Indeterminate,}.
• N[ArgMax[]] calls NArgMax for optimization problems that cannot be solved symbolically.

# Examples

open allclose all

## Basic Examples(5)

Find a maximizer point for a univariate function:

 In[1]:=
 Out[1]=

Find a maximizer point for a multivariate function:

 In[1]:=
 Out[1]=

Find a maximizer point for a function subject to constraints:

 In[1]:=
 Out[1]=

Find a maximizer point as a function of parameters:

 In[1]:=
 Out[1]=

Find a maximizer point for a function over a geometric region:

 In[1]:=
 Out[1]=

Plot it:

 In[2]:=
 Out[2]=