# charpoly -- Characteristic and minimal polynomials over the prime field

## Synopsis

• Usage:
charpoly a
minpoly a
• Inputs:
• a, an element of a field
• Optional inputs:
• Variable => , default value x, the variable to use for the polynomial
• Outputs:
• the characteristic / minimal polynomial of a over its prime field

## Description

Obtain the characteristic / minimal polynomial of an element over its prime field.

 i1 : QQ[x]; F = splittingField((x^2+1)*(x^2-2)); i3 : minpoly a 4 2 o3 = x - 2x + 9 o3 : QQ[x] i4 : charpoly(a^2+1, Variable=>y) 4 3 2 o4 = y - 8y + 40y - 96y + 144 o4 : QQ[y] i5 : minpoly(a^2+1, Variable=>y) 2 o5 = y - 4y + 12 o5 : QQ[y] i6 : GF 81; minpoly(a+1) 4 3 o7 = x + x - x + 1 ZZ o7 : --[x] 3

The method minpoly can also be used on a field to recover the polynomial used in its definition.

 i8 : minpoly F 4 2 o8 = a - 2a + 9 o8 : QQ[a]

## Ways to use charpoly :

• "charpoly(Number)"
• "charpoly(RingElement)"

## For the programmer

The object charpoly is .