Max

Max[x1,x2,]

yields the numerically largest of the xi.

Max[{x1,x2,},{y1,},]

yields the largest element of any of the lists.

Details

  • Max yields a definite result if all its arguments are real numbers.
  • In other cases, Max carries out some simplifications.
  • Max[] gives -Infinity.
  • Max works on SparseArray objects.

Examples

open allclose all

Basic Examples  (3)

Maximum of two numbers:

Maximum of a list:

Plot over a subset of the reals:

Scope  (23)

Numerical Evaluation  (5)

Evaluate numerically:

Evaluate to high precision:

The precision of the output tracks the precision of the input:

Evaluate efficiently at high precision:

The maximum of all elements of a matrix:

The maxima of all rows:

The maxima of all columns:

Max works with real-valued intervals:

Specific Values  (5)

Values of Max at fixed points:

Values at infinity:

Evaluate symbolically:

Solve equations and inequalities:

Find a value of x for which Max[{Sin[x],Cos[x]}]1:

Visualization  (3)

Plot the Max of several functions:

Plot Max in three dimensions:

Plot Max of two functions in three dimensions:

Function Properties  (5)

Max is only defined for real-valued inputs:

The range of Max is all real numbers:

Max effectively flattens out all lists:

Basic symbolic simplification is done automatically:

Additional simplification can be done using Simplify:

Differentiation and Integration  (5)

First derivative with respect to x:

Higher derivatives with respect to x:

Formula for the ^(th) derivative with respect to x:

Compute the indefinite integral using Integrate:

Verify the anti-derivative:

Definite integrals:

Applications  (5)

Use in bounds of iterator variables:

Cumulative maxima:

Find the highest point of a plotted curve:

Mean of the length ratio of a randomly broken stick:

Rfunction-based solid modeling:

Properties & Relations  (6)

With no arguments, Max returns -Infinity:

Max is Flat and Orderless:

Use PiecewiseExpand to express Max and Min as explicit cases:

Use FullSimplify to simplify Max expressions:

Maximize a function containing Max:

Max can be differentiated:

Possible Issues  (2)

Max flattens lists, rather than being Listable:

The oneargument form evaluates for any argument:

Neat Examples  (2)

Two-dimensional sublevel sets:

Three-dimensional sublevel sets:

Introduced in 1988
 (1.0)
 |
Updated in 2003
 (5.0)