# Relation between coefficients of polynomial to get real roots

I am trying to find a relation between coefficients $$a$$ and $$b$$ of the equation $$a x^3 + b x^2 - x + 2 =0$$ so that I get positive real roots of the equation (i.e. $$x\geq0$$). Any help on how to do this on Mathematica 12?

• Check the function Discriminant. Commented Jul 10, 2023 at 13:39
• @DanielLichtblau Thanks I have taken the discriminant, g[a_, b_] := Discriminant[a^2 x^3 + 2 b x^2 - x + 2, x] and done a region plot, RegionPlot[g[a, b] >= 0, {a, -2, 2}, {b, -2, 2}, FrameLabel -> {"a", "b"}]. It solves my problem! Commented Jul 10, 2023 at 14:27

 Solve[a*x^3 + b*x^2 - x + 2 == 0 && x >= 0, x, Reals]

• +1 You could also append //ToRadicals or //ToRadicals//InputForm Commented Jul 10, 2023 at 14:30
• Using ToRadicals will not readily help due to the casus irreducibilis. Commented Jul 10, 2023 at 17:43
• @DanielLichtblau - ToRadicals alleviates the panic that some experience when encountering Root expressions. In this case, the order of the polynomial is low enough that ToRadicals will always work to eliminate the Root representation. Commented Jul 10, 2023 at 18:57
• I realize it will eliminate the Root expressions. The problem is that both cases of one and three real roots will be indistinguishable (ignoring the case where a=0 and there are only two roots). That's the gist of the casus irreducibilis: the radical expressions will have explicit imaginary values even when they are real-valued.... Commented Jul 10, 2023 at 21:23
• ...Example: In[2702]:= rads = ToRadicals[SolveValues[x^3 + -5*x^2 - x + 2 == 0, x]] N[rads] // Chop Out[2702]= {5/3 - (14 (1 + I Sqrt[3]))/( 3 (1/2 (241 + 9 I Sqrt[367]))^(1/3)) - 1/6 (1 - I Sqrt[3]) (1/2 (241 + 9 I Sqrt[367]))^(1/3), 5/3 - (14 (1 - I Sqrt[3]))/(3 (1/2 (241 + 9 I Sqrt[367]))^(1/3)) - 1/6 (1 + I Sqrt[3]) (1/2 (241 + 9 I Sqrt[367]))^(1/3), 1/3 (5 + 28/(1/2 (241 + 9 I Sqrt[367]))^( 1/3) + (1/2 (241 + 9 I Sqrt[367]))^(1/3))} Out[2703]= {-0.6874, 0.568373, 5.11903} Commented Jul 10, 2023 at 21:23