Skip to content

NMinimize ​

A numeric global minimum of f over a BOUNDED interval, as {value, {x -> point}} -- dense sampling plus a golden-section refinement, not an exact answer.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageNMinimize!
NMinimize({f, cons}, x)the numeric global minimum of f over the bounded interval cons implies, for any real-valued f (not just the exact core Minimize covers).
Typed signatures
TypePackageApplies
(tuple<expression, expression>, list<symbol> | symbol) -> expressionanalyticalways

Domain: Calculus

Details
  • Method: sample f at 201 points across the interval (endpoints included), then refine the best sample with a golden-section search bracketed by its two neighbours (or use it as-is when the best sample IS an endpoint, with no interior bracket to refine into). Converges to a bracket width under 1e-11 (relative to the interval).
  • Always numeric -- unlike Minimize, never returns an exact closed form, and works on any real-valued f, not just a recognized shape.
  • Requires an explicit BOUNDED constraint: NMinimize(f, x) alone declines, since an unconstrained numeric search has no principled starting box to invent. A constraint with an unbounded side (x >= a with no upper bound) also declines.
  • Declines on more than one variable.
  • A function that packs more variation into the interval than the 201-point grid resolves (many tightly-spaced local minima, or a spike narrower than the grid) can still be missed -- a real limitation of a sampling-based search, not hidden here.

Examples

Basic #

x^4 - x^2 has two symmetric global minima on [-2, 2] -- one is found

live ↗
InNMinimize([x4−x2,x≥−2∧x≤2],x)\mathrm{NMinimize}(\bigl\lbrack x^4-x^2, x≥-2∧x≤2\bigr\rbrack, x)Out[−0.25,[Rule(x,−0.707 106 778 558 382)]]\bigl\lbrack-0.25, \bigl\lbrack\mathrm{Rule}(x, -0.707\,106\,778\,558\,382)\bigr\rbrack\bigr\rbrack
Possible issues #

Declines -- no bounded interval to search

live ↗
InNMinimize(x2,x)\mathrm{NMinimize}(x^2, x)OutNMinimize(x2,x)\mathrm{NMinimize}(x^2, x)
About
Examples2
Checked againstWolfram Language 2 differ
CrosswalkWolfram Language

See also: NMaximize, Minimize, MinValue