Minimize
The global minimum 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 Language
Minimize!Minimize(f, x)the global minimum of f, a real expression in the single variable x, over f's own natural domain.Minimize(f, {x})same as Minimize(f, x) -- Wolfram accepts the variable either bare or wrapped in a one-element list.Minimize({f, cons}, x)the global minimum of f restricted to cons, a simple interval constraint (x >= a, a <= x <= b, an And of two one-sided bounds, ...).Typed signatures
| Type | Package | Applies |
|---|---|---|
(expression, list<symbol> | symbol) -> expression | analytic | always |
Details
- An EXACT core, never a numerical search (see NMinimize for that): a polynomial (any degree), a rational function with no real pole splitting its domain in two, Sqrt/Ln of an affine-or-quadratic argument, and Exp of an affine argument, each on the whole real line or a simple interval. Every critical point comes from compute-engine's own D (the derivative) on the ORIGINAL expression, Factored and then solved piece by piece -- a linear or quadratic factor by our own exact formula, anything else via compute-engine's own Solve -- and every boundary/limit behaviour from compute-engine's own Limit. A factor is trusted only when its roots come back exact (no numeric fallback, from either route); one inexact factor declines the whole call rather than risk missing the real global minimum -- an irreducible cubic-or-higher factor
Solveitself can't do exactly is the usual reason. - Sin/Cos of an affine argument are supported only through MinValue/MaxValue (the exact amplitude, +-1) -- Minimize itself declines them even when a point exists, because Wolfram's own choice of WHICH of the infinitely many minimizers to report (verified against wolframscript) comes from an internal search this package has no way to reproduce or verify, and a wrong "the" point is worse than no point.
- A rational function's real pole sitting strictly inside the interval being optimized over (given or implied) declines, as does a Sqrt whose domain splits into two disjoint rays under the interval in force -- either would need comparing across more than one connected piece, which this file does not attempt.
- More than one variable declines outright; multivariate optimization isn't attempted.
- A constant f declines: every real x is an equally valid minimizer, and Wolfram's own choice of WHICH one to print (verified against wolframscript --
Minimize[5, x]names an arbitrary-looking rational) isn't reproducible or verifiable here. - Matches Wolfram's output shape,
{value, {x -> point}}, via Rule -- including for an unbounded minimum,{-Infinity, {x -> point}}, where point is whichever end (or domain edge) the limit is taken at.
Examples
Basic #
Scope #
The derivative 4x^3-8x factors into 4x(x^2-2): the quadratic piece's roots are exact, even though Solve alone can't produce them for the quartic directly
live ↗InOut
Two tied global minimizers (x = -1 and x = 1); the leftmost is reported, matching Wolfram
live ↗InOut
Possible issues #
Declines: the derivative x^3-x-1 is an irreducible cubic (Wolfram itself needs an implicit Root object here)
live ↗InOut
Declines: infinitely many x minimize Sin(x), and Wolfram's own choice isn't reproducible -- see MinValue
live ↗InOut
About
| Examples | 14 |
|---|---|
| Checked against | Wolfram Language 11 agree3 differ |
| Crosswalk | Wolfram Language |
See also: Maximize, MinValue, MaxValue, NMinimize, Solve, Limit