11
$\begingroup$

How to solve this matrix equation

Solve[MatrixRank[( {
     {1, x, 3},
     {2, 4, 5},
     {2, 4, x}
    } )] == 2, x, Reals]
$\endgroup$
9
$\begingroup$

A not so good answer

Cases[Table[{x, MatrixRank[({{1, x, 3}, {2, 4, 5}, {2, 4, x}})]}, {x, -10, 10, 1/10}], {_, 2}]

gives out

{{2, 2}, {5, 2}}

So answer is 2 or 5.

$\endgroup$
16
$\begingroup$
mat = ({{1, x, 3}, {2, 4, 5}, {2, 4, x}});
Select[MatrixRank[mat /. #] == 2 &][Solve[Det[mat] == 0, x, Reals]]

{{x -> 2}, {x -> 5}}

$\endgroup$
9
$\begingroup$

Solutions force exactly one eigenvalue to be zero. So we solve for the condition that an eigenvalue vanish, and check that rank is two.

mat = {{1, x, 3}, {2, 4, 5}, {2, 4, x}};
candidateSols = Flatten[Map[Solve[# == 0, x] &, Eigenvalues[(mat)]]]

(* Out[997]= {x -> 2, x -> 5} *)

Both pass the test:

Map[MatrixRank[mat /. #] &, candidateSols]

(* Out[995]= {2, 2} *)
$\endgroup$
  • $\begingroup$ I should have read the @kglr answer more carefully. It avoids, or at least postpones, working in an algebraic extension. $\endgroup$ – Daniel Lichtblau Jan 19 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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