# characteristicPolynomial -- the characteristic polynomial of a matrix or the characteristic polynomial of the regular representation of a polynomial

## Synopsis

• Usage:
characteristicPolynomial(M)
characteristicPolynomial(f)
characteristicPolynomial(g,I)
• Inputs:
• M, , a square matrix
• f, , an element of an Artinian ring
• g, , a polynomial
• I, an ideal, a zero-dimensional ideal
• Optional inputs:
• Variable => ..., default value "Z"
• Outputs:
• , the desired characteristic polynomial. See description.

## Description

This computes the characteristic polynomial of the matrix M, or the characteristic polynomial of the regular representation of f on the Artinian ring ring f, or the characteristic polynomial of the regular representation of g on the Artinian ring (ring g)/I.

 i1 : R = QQ[x,y] o1 = R o1 : PolynomialRing i2 : M = matrix{{2,1},{1,-1}} o2 = | 2 1 | | 1 -1 | 2 2 o2 : Matrix ZZ <--- ZZ i3 : characteristicPolynomial(M) 2 o3 = Z - Z - 3 o3 : ZZ[Z]

We can also change the variable name, as we show below.

 i4 : characteristicPolynomial(M,Variable => "x") 2 o4 = x - x - 3 o4 : ZZ[x]

We show the last two methods.

 i5 : I = ideal(y^2 - x^2 - 1,x - y^2 + 4*y - 2) 2 2 2 o5 = ideal (- x + y - 1, - y + x + 4y - 2) o5 : Ideal of R i6 : characteristicPolynomial(y,I) 4 3 2 o6 = Z - 8Z + 19Z - 16Z + 5 o6 : QQ[Z] i7 : S = R/I o7 = S o7 : QuotientRing i8 : characteristicPolynomial(y) 4 3 2 o8 = Z - 8Z + 19Z - 16Z + 5 o8 : QQ[Z]

## Ways to use characteristicPolynomial :

• "characteristicPolynomial(Matrix)"
• "characteristicPolynomial(RingElement)"
• "characteristicPolynomial(RingElement,Ideal)"

## For the programmer

The object characteristicPolynomial is .