Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Usage of #1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96322] Re: Usage of #1
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Wed, 11 Feb 2009 05:23:53 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <gmrmdk$9uk$1@smc.vnet.net>

In article <gmrmdk$9uk$1 at smc.vnet.net>,
 Nandhini <nandhini.gopalan at gmail.com> wrote:

> Im very new to mathematica. I have got a result where im getting
> something like "Root[1+a #1+a^2 #1^5 &,1]. i wud like to know how else
> i can write it. i dont want the #1 to b displayed. is tehre any
> alternative. Plz help me out of this.

A Root[poly, n] object is an exact representation of the nth root of the 
polynomial poly (written as an pure function, that is why you see the # 
character or Slot[]). Note that the polynomial expressed as a pure 
function in the Root[] object is the same as the original polynomial fed 
to the Solve[] function.

To get the corresponding numerical values, one can use the N[] function, 
and, in some cases, one can try to get a representation with radicals by 
applying the ToRadicals[] function. For instance, 

In[1]:= Solve[x^5 + 2 x + 1 == 0, x]

Out[1]= 
                         5                                  5
{{x -> Root[1 + 2 #1 + #1  & , 1]}, {x -> Root[1 + 2 #1 + #1  & , 2]}, 
 
                          5                                  5
  {x -> Root[1 + 2 #1 + #1  & , 3]}, {x -> Root[1 + 2 #1 + #1  & , 4]}, 
 
                          5
  {x -> Root[1 + 2 #1 + #1  & , 5]}}

In[2]:= % // N

Out[2]= {{x -> -0.486389}, {x -> -0.701874 - 0.879697 I}, {x -> 
-0.701874 + 
    0.879697 I}, {x -> 0.945068- 0.854518 I}, {x -> 0.945068+ 0.854518 
I}}

In[3]:= ToRadicals[Root[#^3 + # + 11 &, 1] + Root[#^5 - 2 &, 3]]

Out[3]= 
                                            1                    1/3
                                           (- (-99 + Sqrt[9813]))
    4/5  1/5             2           1/3    2
(-1)    2    - (--------------------)    + -------------------------
                3 (-99 + Sqrt[9813])                  2/3
                                                     3

Regards,
--Jean-Marc


  • Prev by Date: Reposted, Reformatted Re: "mapping" functions over lists, again!
  • Next by Date: Re: LabeledListPlot
  • Previous by thread: Re: Usage of #1
  • Next by thread: linear regression with errors in both variables