Previous Page Next Page Contents

multcoeffs -- multiply the coefficients of a polynomial with a factor

Introduction

multcoeffs(p, c) multiplies all coefficients of the polynomial p with the factor c.

Call(s)

multcoeffs(p, c)
multcoeffs(f, <vars,> c)

Parameters

p - a polynomial of type DOM_POLY
c - an arithmetical expression or an element of the coefficient ring of p
f - a polynomial expression
vars - a list of indeterminates of the polynomial: typically, identifiers or indexed identifiers

Returns

a polynomial of type DOM_POLY, or a polynomial expression, or FAIL.

Overloadable:

p, f

Related Functions

coeff, degree, degreevec, lcoeff, ldegree, lterm, nterms, nthcoeff, nthmonomial, nthterm, poly, tcoeff

Details

Example 1

Some simple examples:

>> multcoeffs(3*x^3 + x^2*y^2 + 2, 5)
                               3      2  2
                           15 x  + 5 x  y  + 10
>> multcoeffs(3*x^3 + x^2*y^2 + 2, c)
                                     3      2  2
                          2 c + 3 c x  + c x  y
>> multcoeffs(poly(x^3 + 2, [x]), sin(y))
                                   3
                      poly(sin(y) x  + 2 sin(y), [x])

Example 2

Mathematically, multcoeffs(f, c) is the same as f*c. However, multcoeffs produces an expanded form of the product which depends on the indeterminates:

>> f := 3*x^3 + x^2*y^2 + 2:
   multcoeffs(f, [x], c), multcoeffs(f, [y], c),
   multcoeffs(f, [z], c)
                 3      2  2     2  2         3
      2 c + 3 c x  + c x  y , c x  y  + c (3 x  + 2),
      
               3    2  2
         c (3 x  + x  y  + 2)
>> delete f:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000