Function Repository Resource:

# GlobalExtrema

Compute the global extrema of an expression with respect to the given variables

Contributed by: Wolfram|Alpha Math Team
 ResourceFunction["GlobalExtrema"][expr,x] computes the global maxima and minima of expr with respect to x. ResourceFunction["GlobalExtrema"][expr,{x,y,…}] computes the global maxima and minima of expr with respect to multiple variables. ResourceFunction["GlobalExtrema"][{expr,const},{x,y,…}] computes the global maxima and minima of expr subject to the constraint const.

## Details and Options

ResourceFunction["GlobalExtrema"] returns an association of the form <|"Maxima"{fmax,{xxmax,yymax,}},"Minima"{fmin,{xxmin,yymin,}}|>.
The const can contain equations, inequalities or logical combinations of these.
ResourceFunction["GlobalExtrema"] only returns results when there is a bounded extremum.

## Examples

### Basic Examples (2)

Compute the global extrema of a curve:

 In[1]:=
 Out[1]=

Plot the result:

 In[2]:=
 Out[2]=

Use a constraint in order to reduce the domain upon which extrema can be found:

 In[3]:=
 Out[3]=

### Scope (2)

Compute the extrema of a function of two variables:

 In[4]:=
 Out[4]=

Compute the extrema of a piecewise function:

 In[5]:=
 Out[5]=

Plot the result:

 In[6]:=
 Out[6]=

### Possible Issues (1)

GlobalExtrema may return duplicate results for periodic functions:

 In[7]:=
 Out[7]=

## Publisher

Wolfram|Alpha Math Team

## Version History

• 2.0.0 – 23 March 2023
• 1.0.0 – 22 September 2020

## Author Notes

To view the full source code for GlobalMaxima, run the following code:

 In[1]:=