NMaximize

NMaximize[f, x]
maximizes f numerically with respect to x.

NMaximize[f, {x, y, ...}]
maximizes f numerically with respect to x, y, ....

NMaximize[{f, cons}, {x, y, ...}]
maximizes f numerically subject to the constraints cons.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Find the global maximum of an unconstrained problem:

In[1]:=
Click for copyable input
Out[1]=

Extract the maximizing argument:

In[2]:=
Click for copyable input
Out[2]=

Find the global maximum of problems with constraints:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 5 | Last modified in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »