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+a1⁢x+...+xn (a monic univariate polynomial) then Ci,n=−coeff⁡p,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.
with⁡linalg:
p≔x4+9⁢x3+2⁢x2+17⁢x+5
companion⁡p,x
000−5100−17010−2001−9
q≔expand⁡z+2⁢z−5⁢z+3
q≔z3−19⁢z−30
companion⁡q,z
00301019010
See Also
linalg(deprecated)[diag]
linalg(deprecated)[JordanBlock]
LinearAlgebra
Download Help Document