Something changed with Solve
between versions 12.1 and 12.2.
12.1:
Solve[n == n E^(r (1 - n)), n] (* Solve::ifun -- Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. *) (* {{n -> 0}, {n -> 1}} *) $ Assumptions = {n >= 0}; Solve[n == n E^(r (1 - n)), n] (* Solve::ifun -- Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. *) (* {{n -> 0}, {n -> 1}} *)
12.2:
Solve[n == n E^(r (1 - n)), n] (* Solve::ifun -- Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. *) (* {{n -> 0}, {n -> 1}} *) $ Assumptions = {n >= 0}; Solve[n == n E^(r (1 - n)), n]
Is this an improvement or a bug? It seems hard for the condition ConditionalExpression[1, Re[r] == 0 || Re[r] > 0 || Re[r] < 0]
not to hold, but maybe I’m overlooking something.
Two work-arounds:
$ Assumptions = {n >= 0, r \[Element] Reals}; Solve[n == n E^(r (1 - n)), n] Solve[n == n E^(r (1 - n)), n, Reals]
both give {{n -> 0}, {n -> 1}}
(no Solve::ifun
either).
Another example, not fixable by including Reals
:
$ Assumptions = {n1 >= 0, n2 >= 0}; Solve[0 == n1 (1 - n1 - 0.5 n2), n1]