# `icontent`

Content of a polynomial with rational coefficients

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```icontent(`p`)
```

## Description

`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.

## Examples

### 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)```
` `

The result of `icontent` is always nonnegative:

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

The content of a constant polynomial is its absolute value:

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

### 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)```
` `

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

`q/icontent(q)`
` `
`icontent(%)`
` `

## Parameters

 `p` A polynomial or polynomial expression with integer or rational number coefficients

## Return Values

Nonnegative integer or rational number, or `FAIL`

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos