10
$\begingroup$

If I ask Mathematica to find the eigenvectors and eigenvalues of the matrix:

mat := {{a, b, c}, {b, d, e}, {c, e, f}}
Assuming[{a > 0, b > 0, c > 0, d > 0, e > 0, f > 0}, Eigenvalues[mat]]
Assuming[{a > 0, b > 0, c > 0, d > 0, e > 0, f > 0}, Eigenvectors[mat]]

If returns stuff like

{Root[c^2 d - 2 b c e + a e^2 + b^2 f - 
a d f + (-b^2 - c^2 + a d - e^2 + a f + d f) #1 + (-a - d - 
   f) #1^2 + #1^3 &, 1], 
Root[c^2 d - 2 b c e + a e^2 + b^2 f - 
a d f + (-b^2 - c^2 + a d - e^2 + a f + d f) #1 + (-a - d - 
   f) #1^2 + #1^3 &, 2], 
Root[c^2 d - 2 b c e + a e^2 + b^2 f - 
a d f + (-b^2 - c^2 + a d - e^2 + a f + d f) #1 + (-a - d - 
   f) #1^2 + #1^3 &, 3]}

But if I ask Wolfram Alpha:

enter image description here

It does it. What am I doing wrong in Mathematica?

$\endgroup$
19
$\begingroup$

Use

Eigenvalues[mat, Cubics -> True]
Eigenvectors[mat, Cubics -> True]

sometimes Quartics -> Truecan be needed.

or

ToRadicals @ Eigenvalues[ mat]
ToRadicals @ Eigenvectors[ mat]

In general one cannot find roots (of higher order) polynomials in terms of radicals. The reason that Mathematica allows this option is that in general it is convenient to decide whether output (sometimes very large) is needed. For a matrix 2 x 2 it yields automatically the result in terms of radicals :

Eigenvalues[{{a, b}, {c, d}}]
{1/2 (a + d - Sqrt[a^2 + 4 b c - 2 a d + d^2]), 1/2 (a + d + Sqrt[a^2 + 4 b c - 2 a d + d^2])}

because it is quite simple, but the first eigenvalue of your matrix is slightly more involved :

Eigenvalues[ mat, Cubics -> True][[1]]

enter image description here

So these options are certainly convenient to choose whether one prefers the results in terms of Root objects or it terms of radicals.

$\endgroup$
  • $\begingroup$ Thank you very much. First of all, +1 for the help. Just wondering though - is the Cubics -> True making assumptions about something, or just forcing Mathematica to give me an analytical expression? Thanks again. $\endgroup$ – DJBunk Oct 3 '12 at 17:44
  • 1
    $\begingroup$ @DJ, Cubics -> True just means that the routine should give explicit solutions to cubic equations as opposed to producing Root[] objects. Similarly for Quartics -> True. $\endgroup$ – J. M. will be back soon Oct 3 '12 at 17:46
  • 2
    $\begingroup$ Artes, you might want to talk about Eigensystem[] as well. :) $\endgroup$ – J. M. will be back soon Oct 3 '12 at 17:47
  • 2
    $\begingroup$ This option exists because Quartics can be huge and you might not want to see the explicit representation of the result fill your pages. The root object represent the same solutions, but much more compactly. $\endgroup$ – Sjoerd C. de Vries Oct 3 '12 at 18:09
  • $\begingroup$ @DJBunk You are welcome. I edited my answer to elaborate a bit why these options are convenient. Try for example to solve a fourth order polynomial with Quartics -> True with Reduce. @J.M True indeed, but there is also an argument to mention about Reduce, Resolve etc. $\endgroup$ – Artes Oct 3 '12 at 18:22

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.