maximize - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


minimize

compute the minimum symbolically

maximize

compute the maximum symbolically

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

minimize(expr, opt1, opt2, ..., optn)

maximize(expr, opt1, opt2, ..., optn)

Parameters

expr

-

algebraic expression

opt1, opt2, ..., optn

-

options -- see below

Description

• 

The minimize(expr, opt1, opt2, ..., optn) function returns the infimum of expr if possible.  If minimize cannot find the infimum, it returns an unevaluated function call.

• 

If the option location or location = true is given then the output is an expression sequence with the first argument being the minimum and the second a set of lists, where the first argument of each list is a set of substitutions that describe a point at or in a neighborhood of where the infimum is either achieved or approached.  If minimize returns unevaluated, the second argument is the empty set {} and the location flag is removed.

• 

If an option is a name equated to a range then minimize finds the infimum of that function over the given range.  If the range is the entire real line -infinity..infinity then range can be omitted.

• 

The variables over which the expression are to be minimized can be given implicitly as options or explicitly as a list containing all such variable ranges.  This second format is necessary if one is minimizing with respect to a variable that appears as an option to minimize.

• 

If no names over which to minimize are given then minimize finds the infimum over all indeterminates of type name.

• 

The function maximize is defined to compute the negative of the result of minimize applied to the negated expr.

• 

The solvers in the Optimization package can also be used for minimization and maximization of expressions.  These solvers allow constraints to be specified and are generally more efficient than the minimize and maximize commands.  However, they perform all computation using floating-point values and return only local solutions to non-convex optimization problems.

Examples

minimizecosx,x=1..3

cos3

(1)

maximizecosx,x=1..3

cos1

(2)

minimizeexptanx,x=0..10

0

(3)

minimizex23x+y2+3y+3

32

(4)

minimizex23x+y2+3y+3,location

32,x=32,y=32,32

(5)

minimizex23x+y2+3y+3,x=2..4,y=4..2,location

−1,x=2,y=−2,−1

(6)

maximizex23x+y2+3y+3,x=2..4,y=4..2,location

11,x=4,y=−4,11

(7)

minimizeabsexpx212,x=4..4,location

0,x=ln2,0,x=ln2,0

(8)

maximizeabsexpx212,x=4..4

12

(9)

minimizex4x2,x=3..3,location=true

14,x=22,14,x=22,14

(10)

minimizex2+cosx,x=0..3

1

(11)

'location' is an option and therefore all variables to be minimized over must be placed in a list

minimizesinlocationy,location=1..1,y=1..1,location

sin1,y=−1,sin1

(12)

Changing the setting for Normalizer environment variable can in some cases simplify the solution.

fx2+y22+1x2+y2+x22x+1+y22+1x22x+1+y2:

aliasr=RootOf2_Z22RootOf2_Z31,index=12_Z+1,1.237360513

r

(13)

minimizef

8r624r5+36r432r3+18r26r+922r22r+1

(14)

Normalizersimplify:

minimizef

3213

(15)

Note that assumptions may be placed on the location of the minima, especially if the function is periodic and contains equally valued minima at multiple locations.

minimizesinx+cosx,x=0..20,location

2,x=54+2_Z16π,2

(16)

aboutindets2,suffixed_Z,integer

{_Z16}:
  is used in the following assumed objects
  [_Z16] assumed AndProp(integer,RealRange(0,2))

The solutions can be made explicit by setting _EnvExplicit to true.

_EnvExplicittrue:

minimizesinx+cosx,x=0..20,location

2,x=5π4,2,x=13π4,2,x=21π4,2

(17)

See Also

envvar

extrema

infnorm

Optimization

simplex