7
$\begingroup$

In the help document of function SolveAlways, I saw the condition that a polynomial has a triple root.

(*Find a condition for a cubic polynomial to have a triple root:*)
f[x_] := x^3 + a x^2 + b x + c;
SolveAlways[Implies[f[x] == 0 && f[y] == 0, x == y], {x, y}]

Now I want to imitate this example to find a condition that a polynomial has only a double root (there aren't any multiple roots higher than quadratic).

A = {{1, 2, -3}, {-1, 4, -3}, {1, a, 5}};
f[λ_] := CharacteristicPolynomial[A, λ]
Reduce[Exists[{x, y}, Implies[f[x] == 0 && f[y] == 0, x == y]], {a}]
Solve[(f[x] /. a -> -2) == 0, x]

SolveAlways[Implies[(f[x] == f'[x] == 0), f''[x] != 0], x]

But the output of the above code is not a judgment condition. What can I do to solve this problem?

$\endgroup$
4
  • $\begingroup$ A = {{1, 2, -3}, {-1, 4, -3}, {1, a, 5}}; f[\[Lambda]_] := CharacteristicPolynomial[A, \[Lambda]] SolveAlways[Implies[f[x] == 0 && f[y] == 0, x == y], {x, y}] produces {}. $\endgroup$
    – user64494
    Aug 19, 2020 at 6:50
  • $\begingroup$ @user64494 Obviously, a = -2 satisfies the condition, but this conclusion is not obtained. $\endgroup$ Aug 19, 2020 at 6:52
  • 2
    $\begingroup$ Your code is simply incorrect. A right code Reduce[Exists[{x}, f[x] == 0 && f'[x] == 0], a, Reals] produces a == -2 || a == -(2/3). $\endgroup$
    – user64494
    Aug 19, 2020 at 7:16
  • $\begingroup$ @user64494u Thank you for your answer. $\endgroup$ Aug 19, 2020 at 7:18

3 Answers 3

8
$\begingroup$

You want to have the discriminant vanish and the discriminant of the derivative not vanish.

mat = {{1, 2, -3}, {-1, 4, -3}, {1, a, 5}};
cpoly = CharacteristicPolynomial[mat, x];
disc1 = Discriminant[cpoly, x]
disc2 = Discriminant[D[cpoly, x], x]

(* Out[616]= -288 - 720 a - 504 a^2 - 108 a^3

Out[617]= -4 (2 + 9 a) *)

Now sort these out.

Reduce[disc1 == 0 && disc2 != 0]

(* Out[618]= a == -2 || a == -(2/3) *)
$\endgroup$
8
$\begingroup$

Making use of the definition of a root of multiplicity 2, one obtains

A = {{1, 2, -3},{-1, 4, -3},{1, a, 5}};f[\[Lambda]_]:= CharacteristicPolynomial[A,\[Lambda]]
Reduce[Exists[x, f[x] == 0 && f'[x] == 0 && f''[x] != 0], a, Reals]
(*a == -2 || a == -(2/3)*)

That approach works not only for polynomials.

$\endgroup$
7
$\begingroup$

This is what the discriminant is usable for:

Reduce[Discriminant[CharacteristicPolynomial[{{1, 2, -3},
                                              {-1, 4, -3},
                                              {1, a, 5}}, x], x] == 0, a]
   a == -2 || a == -2/3

Check:

With[{a = -2/3}, Eigenvalues[{{1, 2, -3}, {-1, 4, -3}, {1, a, 5}}]]
   {4, 4, 2}

With[{a = -2}, Eigenvalues[{{1, 2, -3}, {-1, 4, -3}, {1, a, 5}}]]
   {6, 2, 2}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.