Hi,
First, from the documentation for Maximize
("Details and Options"):
If the constraints cannot be satisfied, Maximize
returns {-Infinity, {x->Indeterminate,...}}
.
Why would -Infinity
be an appropriate choice? A real-valued function cannot have -Infinity
as a maximum (or least upper bound), so it would seem ridiculous. Maybe just for that reason, to indicate a problem. But actually, it follows from a certain definition: An upper bound for
$f(x)$ over a domain is a number
$B$ such that for all
$x$ in the domain,
$f(x) \le B$. If the domain is empty, then by standard logic the proposition "for all
$x$ in the domain,
$f(x) \le B$" is true (sometimes said to be vacuously true). If the constraint cannot be satisfied, the domain is empty; therefore any real number
$B$ is an upper bound for
$f(x)$ and the least upper bound in some sense is -Infinity
. (It would be more proper to say the least upper bound does not exist. If we allow some latitude, -Infinity
does capture the idea in a way, and it can be dealt with programmatically in an unambiguous way. To me it seems a reasonable choice for the result.)
Second, the constraint a > 0
is not treated the same as an assumption. The answer that is produced consists of two parts, one for when the constraint is satisfied (maximum b
, x -> 1
), and the other for when the constraint is not satisfied (in which case the answer agrees with the documentation above).
If you wish to consider only the case a > 0
, then use Simplify
or FullSimplify
to apply the assumption:
Simplify[Maximize[{-a (x - 1)^2 + b, a > 0}, x], a > 0]
(* {b, {x -> 1}} *)