2

I have the following quartic equation:\begin{equation} x^4 + ax^3 + bx^2 + ax + 1 = 0 \end{equation} and I'm trying to find relations for $a$ and $b$ for which we have multiple roots. To this end, I set

x1 = -(a/4)-1/4 Sqrt[8+a^2-4 b]-1/2 Sqrt[-2+a^2/2-b-(-8 a-a^3+4 a b)/(2 Sqrt[8+a^2-4 b])]
x3 = -(a/4)+1/4 Sqrt[8+a^2-4 b]-1/2 Sqrt[-2+a^2/2-b+(-8 a-a^3+4 a b)/(2 Sqrt[8+a^2-4 b])]

and I use Solve to get expressions for $b$ in terms of $a$, which satisfy $x_{1}=x_{3}$:

In[156]:= Solve[x1 == x3, b]
Out[156]= {}

It says that there is no solution. Then, I try to solve for $a$:

In[143]:= Solve[x1 == x3, a]
Out[143]= {{a -> -2 Sqrt[-2 + b]}, {a -> 2 Sqrt[-2 + b]}}

It does produce a solution. Now, I managed to get the solution for $b$ if I allow an extra condition:

In[152]:= Solve[x1 == x3, b, MaxExtraConditions -> 1] 
During evaluation of In[152]:=Solve::useq: The answer found by Solve contains equational condition(s) 
0==Indeterminate,0==Indeterminate,0==Indeterminate,0==Indeterminate}. A likely reason for this is that the 
solution set depends on branch cuts of Wolfram Language functions.
Out[152]= {{b -> ConditionalExpression[1/4 (8 + a^2), Indeterminate == 0 || Indeterminate == 0]}}

which, I believe, is because at $b=\frac{1}{4}\left(8+a^{2}\right)$ $$\frac{-8 a - a^3 + 4 a b}{2\sqrt{8 + a^2 - 4 b}} = \frac{0}{0}$$ However, the same holds for $a = \pm2\sqrt{-2+b}$ and yet, no extra conditions are needed to solve for $a$. Could someone explain to me why that is? Thanks.

  • try Solve[x1 == x3, b, Reals] then it gives solution. Mathematica graphics V 12.3.1 – Nasser Oct 11 '21 at 09:49
  • 1
    You shouldn't treat the output of Solve as always valid, see e.g. What is the difference between Reduce and Solve? Your problem should become clear having read the output of Solve[x1 == x3, b, MaxExtraConditions -> All] or simply Reduce[x1 == x3, b]. – Artes Oct 11 '21 at 10:49
  • @Artes Those give me conditions on Indeterminate == 0. Do you get the same? That should not happen. Looks like a bug? – Szabolcs Oct 11 '21 at 12:17
  • 2
    @Szabolcs Conditions of the form Indeterminate == 0 are not mathematically correct, nonetheless I wouldn't classify any warnings as bugs. However I could say such warnings and conditions point out the source of the problem, i.e. that the reasonning when solving Solve[x1 == x3, a] and Solve[x1 == x3, b] are not quite "symmetric". – Artes Oct 11 '21 at 12:49

1 Answers1

3

Try the code

poly = x^4 + a x^3 + b x^2 + a x + 1;
soln = Solve[Discriminant[poly, x] == 0];
Print[soln // InputForm]
Print[poly /. soln // Factor // InputForm]
(* {{b -> -2 - 2*a}, {b -> -2 + 2*a}, {b -> (8 + a^2)/4}} *)
(* {(-1 + x)^2*(1 + 2*x + a*x + x^2),
    (1 + x)^2*(1 - 2*x + a*x + x^2), 
    (2 + a*x + 2*x^2)^2/4} *)

The reason is that setting the discriminant to zero is precisely the condition to have multiple roots.

Somos
  • 4,897
  • 1
  • 9
  • 15
  • Note that the last polynomial only has complex roots for $|a| < 4$. This may or may not be important depending on the problem the OP wants to solve. – Michael Seifert Oct 12 '21 at 21:11