Bug introduced in 12.0. Fixed in 13.2 or earlier
In 12.0.0 for Microsoft Windows (64-bit) (April 6, 2019) writing:
Maximize[{Sqrt[1 - x^2], -1 <= x <= 1}, x] Minimize[{Sqrt[1 - x^2], -1 <= x <= 1}, x] NMinimize[{Sqrt[1 - x^2], -1 <= x <= 1}, x] the following outputs are obtained immediately:
{1, {x -> 0}}
{0, {x -> -1}}
{0., {x -> -1.}}
while writing:
NMaximize[{Sqrt[1 - x^2], -1 <= x <= 1}, x] the software enters an infinite loop without giving any warning.
Am I missing something or is something wrong?
EDIT: through the email address [email protected] I contacted Wolfram Technical Support who in less than eight hours have confirmed that it is a bug and have already proceeded to report to their developers.
StepMonitor :> Print[x], it never prints anything. It seems like it's unable to even take a single step. However, if you specify anyMethod(other thanAutomaticI suppose) it seems to start working. I wonder if it can't decide whichMethodto use on this problem? UsingNMinimize[{-Sqrt[1 - x^2],...]also fails. Specifying a search interval,MaxIterations, orPrecisionGoaldon't seem to help. Definitely seems like a bug to me. $\endgroup$Surdinstead ofSqrt, i.e.,NMaximize[{Surd[1 - x^2, 2], -1 <= x <= 1}, x]$\endgroup$f(x, y) = x^2 + y^2 + 6x + 9 = (x+3)^2 + y^2 >= 0 for all x and y? This kind of syntax is somewhat uncommon in programming languages (because there these symbols are typically binary operators returning booleans), but that's another story. $\endgroup$