# Conditions for real roots of a cubic polynomial with complicated, yet constant, parameter values

Can anyone find conditions on the following parameters $\sigma_{\ell}$, $\mu_{\ell}$, $d_{\ell}$ and $\sigma_M$ such that the cubic: $$(d_{\ell}-d_{\ell}\sigma_M)\ell^3 + (2d_{\ell}+\mu_{\ell}-\sigma_{\ell}-d_{\ell}\sigma_M+\sigma_{\ell}\sigma_M)\ell^2 + (d_{\ell}-2\sigma_{\ell}+\sigma_{\ell}\mu_{\ell})\ell - \sigma_{\ell}=0$$ has more than one real root? Note: as I am trying to model a biological system all the parameters must be positive.

I have tried working with the cubic discriminant (Roots of a cubic function) but I just don't know how to best find conditions on the parameters. I.e. for $$ax^3+bx^2+cx+d=0$$ the cubic discriminant is $$\Delta = 18abcd-4b^3d+b^2c^2-4ac^3-27a^2d^2$$ where

• $\Delta>0$: 3 real roots
• $\Delta=0$: 3 real roots with 2 roots being a multiple root
• $\Delta=0$: 1 real root and a pair of conjugate complex roots

I tried applying 'Reduce' to $\Delta \geq 0$ in Mathematica but it just spat the conditions out that I provided.

Input:

AA = dl (1 - sM);
BB = -((sl - dl) (1 - sM) - dl - ml);
CC = -(sl (2 - sM) - dl);
DD = -sl;
Delta = 18*AA*BB*CC*DD - 4*BB^3*DD + BB^2*CC^2 - 4*AA*CC^3 - 27*AA^2*DD^2;
Reduce[Delta >= 0 && dl > 0 && sl > 0 && ml > 0 && sM > 0, {dl, sl, ml, sM}, Reals]


Output:

dl > 0 && sl > 0 && ml > 0 && sM > 0


I am wondering if there is a cleverer way of solving this problem.

P.S. I don't know how to upload a Mathematica Notebook to stackexchange or github etc. but if you could show me how I will upload the work I have done so far.

• (You're using awkward names for the parameters and especially the variable; I've changed the parameter names so as to avoid Greek and subscripts) Use: Reduce[(dl - dl sl) l^3 + (2 dl + ml - sl - dl sM + slsM) l^2 + (dl - 2 sl + sl ml) l - sl == 0 && dl > 0 && sl > 0 && ml > 0 && sM > 0, l, Reals]. Wait a while; you'll get a LOT of conditions! – murray Nov 17 '15 at 1:31
• @murray This is basically what I did (and the parameter names are exactly the ones I used for my Mathematica implementation) but I'm wondering if there is a cleverer way to do this besides plugging this into 'Reduce' as you have done. There are just way too many conditions otherwise. – boschbird Nov 17 '15 at 4:32
• Psst, Discriminant[] is built-in… – J. M. will be back soon Nov 17 '15 at 5:24
• @murray Also you have a typo: slsM should be sl*sM. Not that the change will make things faster. – Daniel Lichtblau Nov 17 '15 at 18:32
• Yep, caught that type in my own notebook, but too late to edit my comment. – murray Nov 17 '15 at 23:21

This can be set up as a quantifier elimination problem, for which cylindrical decomposition can be used.

Clear[poly]
poly[
l_] := (dl - dl sl) l^3 + (2 dl + ml - sl - dl sM +
sl*sM) l^2 + (dl - 2 sl + sl ml) l - sl

CylindricalDecomposition[
Exists[{l1, l2, l3},
poly[l1] == 0 && poly[l2] == 0 && poly[l3] == 0], {sl, dl, ml, sM}]

(* Out[66]= (sl <
0 && (dl <
0 || (dl ==
0 && ((ml < 2 &&
sM >= Root[
4 ml^3 - 8 ml^2 sl - 4 ml^3 sl + ml^4 sl + 4 ml sl^2 +
8 ml^2 sl^2 - 2 ml^3 sl^2 - 4 ml sl^3 +
ml^2 sl^3 + (12 ml^2 sl - 16 ml sl^2 - 8 ml^2 sl^2 +
2 ml^3 sl^2 + 4 sl^3 + 8 ml sl^3 -
2 ml^2 sl^3) #1 + (12 ml sl^2 - 8 sl^3 - 4 ml sl^3 +
ml^2 sl^3) #1^2 + 4 sl^3 #1^3 &, 1]) || (ml == 2 &&
sM > Root[
8 - 12 sl + 6 sl^2 -
sl^3 + (12 sl - 12 sl^2 + 3 sl^3) #1 + (6 sl^2 -
3 sl^3) #1^2 + sl^3 #1^3 &, 3]) || (ml > 2 &&
sM >= Root[
4 ml^3 - 8 ml^2 sl - 4 ml^3 sl + ml^4 sl + 4 ml sl^2 +
8 ml^2 sl^2 - 2 ml^3 sl^2 - 4 ml sl^3 +
ml^2 sl^3 + (12 ml^2 sl - 16 ml sl^2 - 8 ml^2 sl^2 +
2 ml^3 sl^2 + 4 sl^3 + 8 ml sl^3 -
2 ml^2 sl^3) #1 + (12 ml sl^2 - 8 sl^3 - 4 ml sl^3 +
ml^2 sl^3) #1^2 + 4 sl^3 #1^3 &, 1]))) ||
dl > 0)) ||
sl == 0 || (0 < sl <
1 && (dl <
0 || (dl ==
0 && ((ml < 2 &&
sM >= Root[
4 ml^3 - 8 ml^2 sl - 4 ml^3 sl + ml^4 sl + 4 ml sl^2 +
8 ml^2 sl^2 - 2 ml^3 sl^2 - 4 ml sl^3 +
ml^2 sl^3 + (12 ml^2 sl - 16 ml sl^2 - 8 ml^2 sl^2 +
2 ml^3 sl^2 + 4 sl^3 + 8 ml sl^3 -
2 ml^2 sl^3) #1 + (12 ml sl^2 - 8 sl^3 - 4 ml sl^3 +
ml^2 sl^3) #1^2 + 4 sl^3 #1^3 &, 1]) || (ml == 2 &&
sM > Root[
8 - 12 sl + 6 sl^2 -
sl^3 + (12 sl - 12 sl^2 + 3 sl^3) #1 + (6 sl^2 -
3 sl^3) #1^2 + sl^3 #1^3 &, 3]) || (ml > 2 &&
sM >= Root[
4 ml^3 - 8 ml^2 sl - 4 ml^3 sl + ml^4 sl + 4 ml sl^2 +
8 ml^2 sl^2 - 2 ml^3 sl^2 - 4 ml sl^3 +
ml^2 sl^3 + (12 ml^2 sl - 16 ml sl^2 - 8 ml^2 sl^2 +
2 ml^3 sl^2 + 4 sl^3 + 8 ml sl^3 -
2 ml^2 sl^3) #1 + (12 ml sl^2 - 8 sl^3 - 4 ml sl^3 +
ml^2 sl^3) #1^2 + 4 sl^3 #1^3 &, 1]))) ||
dl > 0)) || (sl ==
1 && ((dl <
1 && ((ml <
Root[-8 + 12 dl - 6 dl^2 +
dl^3 + (12 - 12 dl + 3 dl^2) #1 + (-6 +
3 dl) #1^2 + #1^3 &, 3] &&
sM >= Root[-4 dl + 15 dl^2 - 12 dl^3 - 4 dl^4 + 6 dl ml -
6 dl^2 ml - 12 dl^3 ml - ml^2 + 4 dl ml^2 -
13 dl^2 ml^2 + 2 ml^3 - 6 dl ml^3 -
ml^4 + (-4 + 28 dl - 54 dl^2 + 26 dl^3 + 4 dl^4 +
8 ml - 28 dl ml + 10 dl^2 ml + 10 dl^3 ml -
2 ml^2 - 6 dl ml^2 + 8 dl^2 ml^2 - 2 ml^3 +
2 dl ml^3) #1 + (8 - 36 dl + 47 dl^2 - 18 dl^3 -
dl^4 - 8 ml + 14 dl ml - 4 dl^2 ml - 2 dl^3 ml -
ml^2 + 2 dl ml^2 - dl^2 ml^2) #1^2 + (-4 + 12 dl -
12 dl^2 + 4 dl^3) #1^3 &, 1]) || (ml ==
Root[-8 + 12 dl - 6 dl^2 +
dl^3 + (12 - 12 dl + 3 dl^2) #1 + (-6 +
3 dl) #1^2 + #1^3 &, 3] &&
sM > Root[-4 dl + 15 dl^2 - 12 dl^3 - 4 dl^4 + 6 dl ml -
6 dl^2 ml - 12 dl^3 ml - ml^2 + 4 dl ml^2 -
13 dl^2 ml^2 + 2 ml^3 - 6 dl ml^3 -
ml^4 + (-4 + 28 dl - 54 dl^2 + 26 dl^3 + 4 dl^4 +
8 ml - 28 dl ml + 10 dl^2 ml + 10 dl^3 ml -
2 ml^2 - 6 dl ml^2 + 8 dl^2 ml^2 - 2 ml^3 +
2 dl ml^3) #1 + (8 - 36 dl + 47 dl^2 - 18 dl^3 -
dl^4 - 8 ml + 14 dl ml - 4 dl^2 ml - 2 dl^3 ml -
ml^2 + 2 dl ml^2 - dl^2 ml^2) #1^2 + (-4 + 12 dl -
12 dl^2 + 4 dl^3) #1^3 &, 3]) || (ml >
Root[-8 + 12 dl - 6 dl^2 +
dl^3 + (12 - 12 dl + 3 dl^2) #1 + (-6 +
3 dl) #1^2 + #1^3 &, 3] &&
sM >= Root[-4 dl + 15 dl^2 - 12 dl^3 - 4 dl^4 + 6 dl ml -
6 dl^2 ml - 12 dl^3 ml - ml^2 + 4 dl ml^2 -
13 dl^2 ml^2 + 2 ml^3 - 6 dl ml^3 -
ml^4 + (-4 + 28 dl - 54 dl^2 + 26 dl^3 + 4 dl^4 +
8 ml - 28 dl ml + 10 dl^2 ml + 10 dl^3 ml -
2 ml^2 - 6 dl ml^2 + 8 dl^2 ml^2 - 2 ml^3 +
2 dl ml^3) #1 + (8 - 36 dl + 47 dl^2 - 18 dl^3 -
dl^4 - 8 ml + 14 dl ml - 4 dl^2 ml - 2 dl^3 ml -
ml^2 + 2 dl ml^2 - dl^2 ml^2) #1^2 + (-4 + 12 dl -
12 dl^2 + 4 dl^3) #1^3 &, 1]))) ||
dl == 1 || (dl >
1 && ((ml <
Root[-8 + 12 dl - 6 dl^2 +
dl^3 + (12 - 12 dl + 3 dl^2) #1 + (-6 +
3 dl) #1^2 + #1^3 &, 3] &&

sM <= Root[-4 dl + 15 dl^2 - 12 dl^3 - 4 dl^4 + 6 dl ml -
6 dl^2 ml - 12 dl^3 ml - ml^2 + 4 dl ml^2 -
13 dl^2 ml^2 + 2 ml^3 - 6 dl ml^3 -
ml^4 + (-4 + 28 dl - 54 dl^2 + 26 dl^3 + 4 dl^4 +
8 ml - 28 dl ml + 10 dl^2 ml + 10 dl^3 ml -
2 ml^2 - 6 dl ml^2 + 8 dl^2 ml^2 - 2 ml^3 +
2 dl ml^3) #1 + (8 - 36 dl + 47 dl^2 - 18 dl^3 -
dl^4 - 8 ml + 14 dl ml - 4 dl^2 ml - 2 dl^3 ml -
ml^2 + 2 dl ml^2 - dl^2 ml^2) #1^2 + (-4 + 12 dl -
12 dl^2 + 4 dl^3) #1^3 &, 3]) || (ml ==
Root[-8 + 12 dl - 6 dl^2 +
dl^3 + (12 - 12 dl + 3 dl^2) #1 + (-6 +
3 dl) #1^2 + #1^3 &, 3] &&
sM < Root[-4 dl + 15 dl^2 - 12 dl^3 - 4 dl^4 + 6 dl ml -
6 dl^2 ml - 12 dl^3 ml - ml^2 + 4 dl ml^2 -
13 dl^2 ml^2 + 2 ml^3 - 6 dl ml^3 -
ml^4 + (-4 + 28 dl - 54 dl^2 + 26 dl^3 + 4 dl^4 +
8 ml - 28 dl ml + 10 dl^2 ml + 10 dl^3 ml -
2 ml^2 - 6 dl ml^2 + 8 dl^2 ml^2 - 2 ml^3 +
2 dl ml^3) #1 + (8 - 36 dl + 47 dl^2 - 18 dl^3 -
dl^4 - 8 ml + 14 dl ml - 4 dl^2 ml - 2 dl^3 ml -
ml^2 + 2 dl ml^2 - dl^2 ml^2) #1^2 + (-4 + 12 dl -
12 dl^2 + 4 dl^3) #1^3 &, 3]) || (ml >
Root[-8 + 12 dl - 6 dl^2 +
dl^3 + (12 - 12 dl + 3 dl^2) #1 + (-6 +
3 dl) #1^2 + #1^3 &, 3] &&
sM <= Root[-4 dl + 15 dl^2 - 12 dl^3 - 4 dl^4 + 6 dl ml -
6 dl^2 ml - 12 dl^3 ml - ml^2 + 4 dl ml^2 -
13 dl^2 ml^2 + 2 ml^3 - 6 dl ml^3 -
ml^4 + (-4 + 28 dl - 54 dl^2 + 26 dl^3 + 4 dl^4 +
8 ml - 28 dl ml + 10 dl^2 ml + 10 dl^3 ml -
2 ml^2 - 6 dl ml^2 + 8 dl^2 ml^2 - 2 ml^3 +
2 dl ml^3) #1 + (8 - 36 dl + 47 dl^2 - 18 dl^3 -
dl^4 - 8 ml + 14 dl ml - 4 dl^2 ml - 2 dl^3 ml -
ml^2 + 2 dl ml^2 - dl^2 ml^2) #1^2 + (-4 + 12 dl -
12 dl^2 + 4 dl^3) #1^3 &, 3]))))) || (sl >
1 && (dl <
0 || (dl ==
0 && ((ml < 2 &&
sM >= Root[
4 ml^3 - 8 ml^2 sl - 4 ml^3 sl + ml^4 sl + 4 ml sl^2 +
8 ml^2 sl^2 - 2 ml^3 sl^2 - 4 ml sl^3 +
ml^2 sl^3 + (12 ml^2 sl - 16 ml sl^2 - 8 ml^2 sl^2 +
2 ml^3 sl^2 + 4 sl^3 + 8 ml sl^3 -
2 ml^2 sl^3) #1 + (12 ml sl^2 - 8 sl^3 - 4 ml sl^3 +
ml^2 sl^3) #1^2 + 4 sl^3 #1^3 &, 1]) || (ml == 2 &&
sM > Root[
8 - 12 sl + 6 sl^2 -
sl^3 + (12 sl - 12 sl^2 + 3 sl^3) #1 + (6 sl^2 -
3 sl^3) #1^2 + sl^3 #1^3 &, 3]) || (ml > 2 &&
sM >= Root[
4 ml^3 - 8 ml^2 sl - 4 ml^3 sl + ml^4 sl + 4 ml sl^2 +
8 ml^2 sl^2 - 2 ml^3 sl^2 - 4 ml sl^3 +
ml^2 sl^3 + (12 ml^2 sl - 16 ml sl^2 - 8 ml^2 sl^2 +
2 ml^3 sl^2 + 4 sl^3 + 8 ml sl^3 -
2 ml^2 sl^3) #1 + (12 ml sl^2 - 8 sl^3 - 4 ml sl^3 +
ml^2 sl^3) #1^2 + 4 sl^3 #1^3 &, 1]))) || dl > 0)) *)


Not the prettiest of sights. Also it might be too complicated to be of much use.

Another possibility, suggested in a comment by @J.M., would be to solve for zeros of Discriminant[poly[l], l].

• Thanks very much. I have looked up a lot of documentation on '#' and I still don't really understand its meaning. Is there a clear way to explain what the hash symbol in this context represents? – boschbird Nov 20 '15 at 23:04
• It is used in the output inside Root objects. These parametrize roots to polynomials and in order to do so one must have a notion of the polynomial "variable". Rather than use some internal name we opted to cast these as "pure functions" (and that has some uses for reconstructing polynomials later if one wants to do that). Anyway, the gist is that pure functions can be written in Mathematica using the # form to get anonymous variables. – Daniel Lichtblau Nov 20 '15 at 23:33
• Great thank you very much – boschbird Nov 21 '15 at 0:41