MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Help with Root function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79489] Re: Help with Root function
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 27 Jul 2007 06:07:19 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f89q55$5nu$1@smc.vnet.net>

jeremito wrote:
> I am trying to find the eigenvalues of a 3x3 matrix with non-numeric
> elements.  This requires finding the roots of cubic polynomials.
> Mathematica can do this, but I know how to interpret its output.  For
> example
> 
> In[1]:= B = {{a, 1, 1}, {1, b, 1}, {1, 1, c}}
> 
> Out[1]= {{a, 1, 1}, {1, b, 1}, {1, 1, c}}
> 
> In[2]:= Eigenvalues[B]
> 
> Out[2]= {Root[-2 + a + b + c -
>     a b c + (-3 + a b + a c + b c) #1 + (-a - b - c) #1^2 + #1^3 &,
>   1], Root[-2 + a + b + c -
>     a b c + (-3 + a b + a c + b c) #1 + (-a - b - c) #1^2 + #1^3 &,
>   2], Root[-2 + a + b + c -
>     a b c + (-3 + a b + a c + b c) #1 + (-a - b - c) #1^2 + #1^3 &,
>   3]}
> 
> 
> How can I get Mathematica to give me the full answer?  I know it is
> long and ugly, but at least I can do something with it.  I can't do
> anything with what it gives me now.  Does that make sense?
> Thanks,
> Jeremy

First, you should have a look at the page about *Root* object in the 
documentation center. See 
http://reference.wolfram.com/mathematica/ref/Root.html?q=Root

Second, I believe that you would prefer to get some radical expressions. 
You can convert *Root* objects into radicals by using the function 
*ToRadicals* as in

In[1]:= B = {{a, 1, 1}, {1, b, 1}, {1, 1, c}};
ToRadicals[Eigenvalues[B]]

Out[2]= {(1/3)*(a + b +
      c) - (2^(1/3)*(-9 - a^2 + a*b - b^2 + a*c + b*c -

        c^2))/(3*(54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 - 3*a^2*c +
                12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 + 2*c^3 +
                Sqrt[4*(-9 - a^2 + a*b - b^2 + a*c + b*c - c^2)^3 +
                    (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 -
              3*a^2*c +
                         12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 +
              2*c^3)^2])^
             (1/3)) + (1/(3*2^(1/3)))*(54 + 2*a^3 - 3*a^2*b -
       3*a*b^2 +
             2*b^3 - 3*a^2*c + 12*a*b*c - 3*b^2*c - 3*a*c^2 -
       3*b*c^2 +
             2*c^3 +
       Sqrt[4*(-9 - a^2 + a*b - b^2 + a*c + b*c - c^2)^3 +
                 (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 - 3*a^2*c +
            12*a*b*c -
                      3*b^2*c - 3*a*c^2 - 3*b*c^2 + 2*c^3)^2])^(1/3),
    (1/3)*(a + b +
      c) + ((1 + I*Sqrt[3])*(-9 - a^2 + a*b - b^2 + a*c +
              b*c -
        c^2))/(3*2^(2/3)*(54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 -
                3*a^2*c + 12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 +
         2*c^3 +
                Sqrt[4*(-9 - a^2 + a*b - b^2 + a*c + b*c - c^2)^3 +
                    (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 -
              3*a^2*c +
                         12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 +
              2*c^3)^2])^
             (1/3)) - (1/(6*2^(1/3)))*((1 - I*Sqrt[3])*
           (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 - 3*a^2*c +
         12*a*b*c -
                3*b^2*c - 3*a*c^2 - 3*b*c^2 + 2*c^3 +
                Sqrt[4*(-9 - a^2 + a*b - b^2 + a*c + b*c - c^2)^3 +
                    (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 -
              3*a^2*c +
                         12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 +
              2*c^3)^2])^(1/3)),
    (1/3)*(a + b +
      c) + ((1 - I*Sqrt[3])*(-9 - a^2 + a*b - b^2 + a*c +
              b*c -
        c^2))/(3*2^(2/3)*(54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 -
                3*a^2*c + 12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 +
         2*c^3 +
                Sqrt[4*(-9 - a^2 + a*b - b^2 + a*c + b*c - c^2)^3 +
                    (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 -
              3*a^2*c +
                         12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 +
              2*c^3)^2])^
             (1/3)) - (1/(6*2^(1/3)))*((1 + I*Sqrt[3])*
           (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 - 3*a^2*c +
         12*a*b*c -
                3*b^2*c - 3*a*c^2 - 3*b*c^2 + 2*c^3 +
                Sqrt[4*(-9 - a^2 + a*b - b^2 + a*c + b*c - c^2)^3 +
                    (54 + 2*a^3 - 3*a^2*b - 3*a*b^2 + 2*b^3 -
              3*a^2*c +
                         12*a*b*c - 3*b^2*c - 3*a*c^2 - 3*b*c^2 +
              2*c^3)^2])^(1/3))}

Regards,
Jean-Marc



  • Prev by Date: Re: Re: Mathematica to .NET compiler
  • Next by Date: Re: Help with Root function
  • Previous by thread: Re: Re: Help with Root function
  • Next by thread: Re: Help with Root function