linalg(deprecated)
companion
companion matrix associated with a polynomial
Calling Sequence
Parameters
Description
Examples
companion(p, x)
p
-
monic univariate polynomial in x
x
name (the variable)
Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[CompanionMatrix], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
The call companion(p, x) will return a companion matrix associated with the polynomial p(x).
If C := companion(p, x) and p is a0+a1x+...+xn (a monic univariate polynomial) then Ci,n=−coeffp,x,i−1 (i=1..n), Ci,i−1=1 (i=2..n), and Ci,j=0 for other values of i and j.
The command with(linalg,companion) allows the use of the abbreviated form of this command.
withlinalg:
p≔x4+9x3+2x2+17x+5
companionp,x
000−5100−17010−2001−9
q≔expandz+2z−5z+3
q≔z3−19z−30
companionq,z
00301019010
See Also
linalg(deprecated)[diag]
linalg(deprecated)[JordanBlock]
LinearAlgebra
Download Help Document