MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: no message from Minimize[] on a weird function(x^x)

  • To: mathgroup at
  • Subject: [mg96743] Re: [mg96724] no message from Minimize[] on a weird function(x^x)
  • From: Bob Hanlon <hanlonr at>
  • Date: Mon, 23 Feb 2009 05:03:51 -0500 (EST)
  • Reply-to: hanlonr at

f[x_] := x^x

Minimize[f[x], x]


Minimize returns unevaluated because it is trying to provide a symbolic result and cannot solve the problem. You need to simplify the problem by providing the appropriate constraint.

Minimize[{f[x], x > 0}, x]

{E^(-E^(-1)), {x -> 1/E}}

% // N


As with Minimize, MinValue and ArgMin also need the constraint

{MinValue[f[x], x], ArgMin[f[x], x]}


{MinValue[{f[x], x > 0}, x], ArgMin[{f[x], x > 0}, x]}

{E^(-E^(-1)), 1/E}

Numerical techniques do not need the constraint presumably because their search starts with x > 0

FindMinimum[f[x], x]


FindArgMin[f[x], x]


FindMinValue[f[x], x]


NMinimize[f[x], x]


NMinValue[f[x], x]


Bob Hanlon

---- congruentialuminaire at wrote: 

Hello MathGroup:

I have:


What makes this a weird function is that when x<0, the function is
discontinuous and non-differentiable and has a global minimum at -1.

To answer the question: "what is the minimum of this function", I

FindMinimum[f[x],{x,2}] (* this appears correct *)
> {0.692201, {x -> 0.367879}}
FindMinimum[f[x],{x,2}] (* this complains about the gradient, but
appears correct *)
> FindMinimum::nrgnum: The gradient is not a vector of real numbers at {x} = {-1.}. >>
> {-1., {x -> -1.}}
NMinimize[f[x], x] (* this gives the minimum in the positive domain *)
> {0.692201, {x -> 0.367879}}
Minimize[f[x], x] (* this gives no answer and no error message *)
> Minimize[x^x, x]

Is this expected behavior?


Roger Williams
Franklin Laboratory

  • Prev by Date: Re: What is "Depth of Atomic Objects" ?
  • Next by Date: Re: Precise bitmaps
  • Previous by thread: Re: ListVectorPlot3D with VectorPoints->All
  • Next by thread: Error using Manpulate that is NOT obvious (to me)