Previous Page Next Page Contents

RootOf -- the set of roots of a polynomial

Introduction

RootOf(f, x) represents the symbolic set of roots of the polynomial f(x) with respect to the indeterminate x.

Call(s)

RootOf(f, x)
RootOf(f)

Parameters

f - a polynomial, an arithmetical expression representing a polynomial in x, or a polynomial equation in x
x - the indeterminate: typically, an identifier or indexed identifier

Returns

a symbolic RootOf call, i.e., an expression of type "RootOf".

Related Functions

numeric::polyroots, poly, solve

Details

Example 1

Each of the following calls represents the roots of the polynomial x^3-x^2 with respect to x, i.e., the set {0, 1}:

>> RootOf(x^3 - x^2, x), RootOf(x^3 = x^2, x)
                          3    2              3    2
                  RootOf(x  - x , x), RootOf(x  = x , x)
>> RootOf(x^3 - x^2), RootOf(x^3 = x^2)
                          3    2              3    2
                  RootOf(x  - x , x), RootOf(x  = x , x)
>> RootOf(poly(x^3 - x^2, [x]), x)
                                    3    2
                            RootOf(x  - x , x)

In general, however, RootOf is only used when no explicit symbolic representation of the roots is possible.

Example 2

The first argument of RootOf may contain parameters:

>> RootOf(y*x^2 - x + y^2, x)
                                 2        2
                         RootOf(y  - x + x  y, x)

The set of roots of a polynomial is treated like an expression. For example, it may be differentiated with respect to a free parameter. The result is the set of derivatives of the roots; it is expressed in terms of RootOf, by giving a minimal polynomial:

>> diff(%, y)
                             4      3       2   2      5   2
          RootOf(2 y - x1 + y  + 4 y  x1 - y  x1  + 4 y  x1 , x1)

For reducible polynomials, the result may be a multiple of the correct minimal polynomial.

Example 3

solve returns RootOf objects when the roots of a polynomial cannot be expressed in terms of radicals:

>> solve(x^5 + x + 7, x)
                                       5
                         RootOf(X1 + X1  + 7, X1)

You can apply the function float to obtain floating-point approximations of all roots:

>> float(%)
      {-1.410813851, - 0.5084694089 + 1.368616488 I,
      
         - 0.5084694089 - 1.368616488 I,
      
         1.213876335 + 0.9241881109 I, 1.213876335 - 0.9241881108 I}

Example 4

The function sum is able to compute sums over all roots of a given polynomial:

>> sum(i^2, i = RootOf(x^3 + a*x^2 + b*x + c, x))
                                  2
                                 a  - 2 b
>> sum(1/(z + i), i = RootOf(x^4 - y*x + 1, x))
                                        3
                                 y + 4 z
                               ------------
                                      4
                               y z + z  + 1

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000