companion a comme argument un polynôme P unitaire et le nom
de sa variable.
companion renvoie la matrice qui a pour polynôme caractéristique le
polynôme P.
Si P(x)=xn+an−1xn−1+...+a−1x+a0,
cette matrice est égale à la matrice unité d’ordre n−1 bordée par
[0,0..,0,−a0] comme première ligne, et par
[−a0,−a1,....,−an−1] comme dernière colonne.
On tape :
^
2+5x-7,x)On obtient :
On tape :
^
4+3x^
3+2x^
2+4x-1,x)On obtient :