Macaulay2 » Documentation
Packages » Macaulay2Doc » rings » manipulating polynomials » content
next | previous | forward | backward | up | index | toc

# content -- the content of a polynomial

- Usage:
    `content f`
    `content(f, x)`
- Inputs:
  - f, a ring element,
  - x, a ring element, a variable in the ring of f
- Outputs:
  - an ideal, the content of a matrix or polynomial

## Description

The content is the ideal in the base ring generated by the coefficients.

    i1 : R = ZZ[x,y]

    o1 = R

    o1 : PolynomialRing

    i2 : content(4*x + 6*x^5)

    o2 = ideal (6, 4)

    o2 : Ideal of ZZ

    i3 : content(4*x + 6*x^5, x)

    o3 = ideal (6, 4)

    o3 : Ideal of R

    i4 : content(4*x + 6*x^5, y)

                 5
    o4 = ideal(6x  + 4x)

    o4 : Ideal of R

    i5 : generator oo

           5
    o5 = 6x  + 4x

    o5 : R

## Code

    ../../m2/matrix1.m2:674:33-674:66: --source code:
    content(RingElement) := Ideal => (f) -> ideal \\ last \ listForm f
    ../../m2/matrix1.m2:675:46-675:99: --source code:
    content(RingElement, RingElement) := Ideal => (f,x) -> ideal last coefficients(f, Variables => {x})

## See also

- exponents -- the exponents of a polynomial
- coefficients -- get the monomials and coefficients of a polynomial or matrix
- listForm -- convert to list form
- standardForm -- convert to standard form
- monomials -- matrix of monomials in a ring element or matrix

## Ways to use content:

- `content(RingElement)`
- `content(RingElement,RingElement)`

## For the programmer

The object content is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/doc_ringelement.m2:130:0.