Finding the whole solution set
Inspired by @Szabolcs idea, you can let Reduce
solve this problem with the help of existential quantifiers:
Reduce[ ForAll[x, 5 x^3 + z + x z + x^2 (1 + z) == 0 \[And] Im[z] == 0, Re[x] < 0], z]
It immediately affirms your conjecture:
(* z > 4 *)
This problem formulation via ForAll
can be read as:
Reduce
the following statement with respect to z
over the complex numbers:
"For all x
that satisfy the condition that 5 x^3 + z + x z + x^2 (1 + z) == 0
where z
is restricted to the real number line, the real part of x
is negative."
Finding a numeric solution
If you are not so much interested in all possible solutions but just one that meets certain criteria, you can use NMinimize
to help solve that optimization problem. For that to work smoothly it's useful to set up some helper functions first:
PolyRoots[poly_, paramrules : {(_ -> _?NumericQ) ..}] :=
x /. {ToRules@NRoots[poly /. paramrules, x]}
This takes a polynomial and a list of rules which specify the parameters and their values and returns a list of all roots. The big obfuscated looking pattern match has the purpose of making sure that the function definition fires only when the right hand side of all rules (a -> 123
) assumes numeric values.
To make it easier for NMinimize
to get an idea how bad the current set of parameter values is, we introduce a function that assigns a penalty value to a set of parameter values based on the sum of the squares of the real parts of all roots if they are positive and zero if they are negative. That allows NMinimze
to "sense" it's way to better solutions until it hits the promised land, where solutions have penalty value zero.
Penalty[poly_, paramrules : {(_ -> _?NumericQ) ..}] :=
Total[HeavisideTheta[#] #^2 & @ Thread @ Re @ PolyRoots[poly, paramrules]]
The final step is setting up the polynomial (including a cosmetic change of variable names so that the variables in our final solution have the desired names) and letting NMinimize
do the work:
Module[{poly},
poly = -11.8193 + 12.0482 b - 59.0964 x + 12.0482 a x -
11.8193 d x + 12.0482 b d x + 0.320482 x^2 + 12.0482 c x^2 -
59.0964 d x^2 + 12.0482 a d x^2 + 1. x^3 + 0.320482 d x^3 +
1. d x^4 /. {a -> aa, b -> bb, c -> cc, d -> dd};
{penalty, solution} =
NMinimize[
{Penalty[poly, {aa -> a, bb -> b, cc -> c, dd -> d}], a > 0, b > 0, c > 0, d > 0},
{a, b, c, d}]
]
(* {0., {a -> 13.2852, b -> 7.3045, c -> 2.38894, d -> 0.171584}} *)
Reduce
:Reduce[ForAll[x, 5 x^3 + z + x z + x^2 (1 + z) == 0, x < 0], z, Reals]
. This is very fast. If you allow complexz
andx
, it takes longer than I cared to wait. (When you write these expressions, keep in mind that in Mathematicax<0
implicitly implies thatx
is real. This is important if you removeReals
fromReduce
but keepx<0
instead ofRe[x]<0
) $\endgroup$ – Szabolcs Feb 11 '13 at 19:30Reduce[ForAll[x, 5 x^3 + z + x z + x^2 (1 + z) == 0 \[And] Im[z] == 0, Re[x] < 0], z, Complexes]
gives the solution immediately. $\endgroup$ – Thies Heidecke Feb 11 '13 at 20:40