## `icontent` -- the content of a polynomial with rational coefficients

#### Introduction

`icontent(`p`)` computes the content of the polynomial `p` with integer or rational number coefficients, i.e., the gcd of its coefficients.

#### Call(s)

`icontent(p)`

#### Parameters

`p` | - | a polynomial or polynomial expression with integer or rational number coefficients

#### Returns

a nonnegative integer or rational number, or `FAIL`

#### Related Functions

`coeff`, `content`, `factor`, `gcd`, `ifactor`, `igcd`, `ilcm`, `lcm`, `poly`, `polylib::primpart`

#### Details

- `icontent(`p`)` calculates the content of a polynomial or polynomial expression with integer or rational coefficients, i.e., the greatest common divisor of the coefficients, such that `p/`icontent(p`)` has integral coefficients whose greatest common divisor is `1`. In particular, if `p` is itself an integer or a rational number, then `icontent` returns `abs(p)` (see example 1).
- If `p` is a polynomial or polynomial expression with integer coefficients, then the content is the greatest common divisor of the coefficients. If `p` is a polynomial or polynomial expression with rational coefficients, then the content is the greatest common divisor of the numerators of the coefficients divided by the least common multiple of the denominators (see example 2).
- If `p` is a polynomial expression, then it is first converted into a polynomial of domain type `DOM_POLY` using `poly`. If this conversion is not possible, then `icontent` returns `FAIL`.
- `icontent` returns an error message if not all coefficients of `p` are integers or rational numbers.

- `icontent` is a function of the system kernel.

#### Example 1

The first argument can be a polynomial or a polynomial expression. The following two calls of `icontent` are equivalent:

    >> p := 6*x*y - 9*y^2 + 21:
       icontent(poly(p)), icontent(p)

                                       3, 3

The result of `icontent` is always nonnegative:

    >> icontent(2*x - 4), icontent(-2*x + 4)

                                       2, 2

The content of a constant polynomial is its absolute value:

    >> icontent(0), icontent(-2), icontent(poly(-2, [x]))

                                      0, 2, 2

#### Example 2

The content of a polynomial with rational coefficients is a rational number in general:

    >> q := 6/7*x*y - 9/4*y + 12:
       icontent(poly(q)), icontent(q)

                                    3/28, 3/28

The polynomial divided by its content has integral coefficients whose greatest common divisor is `1`:

    >> q/icontent(q)

                                8 x y - 21 y + 112

    >> icontent(%)

                                         1

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000