1
$\begingroup$

This code:

Eigenvectors[{{Cos[t], Sin[t]}, {Sin[t], -Cos[t]}}]

returns this output:

{{Cot[t] - Csc[t], 1}, {Cot[t] + Csc[t], 1}}

which is not correct for $t = 0$.

Is there a way to get Mathematica to return the "most general" eigenvectors for a symbolic matrix that works for all values of the parameters, instead of making it so that the last component is 1?

$\endgroup$
3
  • 1
    $\begingroup$ "...which is not correct for $t=0$." - this is once more the issue of a generically correct answer, where the answer returned is correct except at a countable number of values. $\endgroup$ – J. M.'s ennui Jan 11 at 19:07
  • 1
    $\begingroup$ @J.M. explained it very nicely. All I would like to add as a comment, is the potential use of the With command for the special. With[{t = 0}, Eigenvectors[....]] returns {{0, 1}, {1, 0}} $\endgroup$ – DiSp0sablE_H3r0 Jan 11 at 19:15
  • 1
    $\begingroup$ One can compute the discriminant of the characteristic polynomial and set it to zero to find potential bad values, then substitute those in and compute eigenvectors for the explicit cases of interest. $\endgroup$ – Daniel Lichtblau Jan 12 at 15:05
2
$\begingroup$

Maybe FactorList with Trig -> True can help as it does in the given example:

evs = Eigenvectors[{{Cos[t], Sin[t]}, {Sin[t], -Cos[t]}}];
With[{lcd = 
   Apply@PolynomialLCM /@ 
    Map[1/Times @@ Power @@@
       Select[Negative@*Last]@ (* selects denominator *)
        FactorList[#, Trig -> True] &,
     evs,
     {2}]
  },
 evs*lcd // Simplify
 ]

(*  {{-Sin[t/2], Cos[t/2]}, {Cos[t/2], Sin[t/2]}}  *)

That expr == Times @@ Power @@@ FactorList[expr] is from the docs.

$\endgroup$

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.