Skip to content

Maximize ​

The global maximum of f over the real line (or a simple interval constraint), as {value, {x -> point}} -- an exact, provably global answer, not a local one.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageMaximize!
Maximize(f, x)the global maximum of f, a real expression in the single variable x, over f's own natural domain.
Maximize(f, {x})same as Maximize(f, x) -- Wolfram accepts the variable either bare or wrapped in a one-element list.
Maximize({f, cons}, x)the global maximum of f restricted to cons, a simple interval constraint (x >= a, a <= x <= b, an And of two one-sided bounds, ...).
Typed signatures
TypePackageApplies
(expression, list<symbol> | symbol) -> expressionanalyticalways

Domain: Calculus

Details
  • Minimize's exact mirror image -- same scope, same machinery (D/Factor/Solve/Limit on the ORIGINAL expression), same declines. See its details for the full account; this entry only lists Maximize's own examples.

Examples

Basic #

A downward parabola's vertex is its global maximum

live ↗
InMaximize(−x2+4x−1,x)\mathrm{Maximize}(-x^2+4x-1, x)Out[3,[Rule(x,2)]]\bigl\lbrack3, \bigl\lbrack\mathrm{Rule}(x, 2)\bigr\rbrack\bigr\rbrack

An odd-degree polynomial is unbounded above

live ↗
InMaximize(x3,x)\mathrm{Maximize}(x^3, x)Out[∞,[Rule(x,∞)]]\bigl\lbrack∞, \bigl\lbrack\mathrm{Rule}(x, ∞)\bigr\rbrack\bigr\rbrack

With 0 <= x <= 1, the unconstrained vertex (x = 2) is out of range -- the boundary wins

live ↗
InMaximize([−x2+4x−1,x≥0∧x≤1],x)\mathrm{Maximize}(\bigl\lbrack-x^2+4x-1, x≥0∧x≤1\bigr\rbrack, x)Out[2,[Rule(x,1)]]\bigl\lbrack2, \bigl\lbrack\mathrm{Rule}(x, 1)\bigr\rbrack\bigr\rbrack

Returns the maximum 498\frac{49}{8} and where it occurs, x=−34x=-\frac34

live ↗
InMaximize(−2x2−3x+5,x)\mathrm{Maximize}(-2x^2-3x+5, x)Out[498,[Rule(x,−34)]]\bigl\lbrack\frac{49}{8}, \bigl\lbrack\mathrm{Rule}(x, -\frac{3}{4})\bigr\rbrack\bigr\rbrack
Scope #

Exp(-x) grows without bound as x -> -Infinity

live ↗
InMaximize(exp⁡(−x),x)\mathrm{Maximize}(\exp(-x), x)Out[∞,[Rule(x,−∞)]]\bigl\lbrack∞, \bigl\lbrack\mathrm{Rule}(x, -∞)\bigr\rbrack\bigr\rbrack

Sqrt(4 - x^2)'s domain is exactly [-2, 2] -- its vertex (x = 0) is the max

live ↗
InMaximize(4−x2,x)\mathrm{Maximize}(\sqrt{4-x^2}, x)Out[2,[Rule(x,0)]]\bigl\lbrack2, \bigl\lbrack\mathrm{Rule}(x, 0)\bigr\rbrack\bigr\rbrack
Possible issues #

Declines -- multivariate optimization is out of scope

live ↗
InMaximize(−(x2+y2),[x,y])\mathrm{Maximize}(-(x^2+y^2), \bigl\lbrack x, y\bigr\rbrack)OutMaximize(−(x2+y2),[x,y])\mathrm{Maximize}(-(x^2+y^2), \bigl\lbrack x, y\bigr\rbrack)
About
Examples7
Checked againstWolfram Language 6 agree1 differ
CrosswalkWolfram Language

See also: Minimize, MinValue, MaxValue, NMaximize, Solve, Limit