Student[LinearAlgebra] - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Education : Student Package : Linear Algebra : Computation : Constructors : Student/LinearAlgebra/CompanionMatrix

Student[LinearAlgebra]

 CompanionMatrix
 construct the companion Matrix of a monic polynomial

 Calling Sequence CompanionMatrix(P, options)

Parameters

 P - monic polynomial options - (optional) parameters; for a complete list, see LinearAlgebra[CompanionMatrix]

Description

 • The CompanionMatrix(P) command returns the companion Matrix associated with the univariate polynomial $P\left(x\right)$.
 • If C := CompanionMatrix(P) and P is $\mathrm{a0}+\mathrm{a1}x+...+{x}^{n}$ (a monic univariate polynomial), then  C is an $nxn$ Matrix where n is the degree of polynomial P, ${C}_{i,n}=-\mathrm{coeff}\left(P,x,i-1\right)\left(i=1..n\right)$, ${C}_{i,i-1}=1\left(i=2..n\right)$, and ${C}_{i,j}=0$ for all other values of i and j.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{LinearAlgebra}]\right):$
 > $p≔{x}^{4}+{x}^{3}+2{x}^{2}+3x$
 ${p}{≔}{{x}}^{{4}}{+}{{x}}^{{3}}{+}{2}{}{{x}}^{{2}}{+}{3}{}{x}$ (1)
 > $\mathrm{CompanionMatrix}\left(p\right)$
 $\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {1}& {0}& {0}& {-}{3}\\ {0}& {1}& {0}& {-}{2}\\ {0}& {0}& {1}& {-}{1}\end{array}\right]$ (2)
 > $q≔\left(z+2\right)\left(z-5\right)\left(z+3\right)$
 ${q}{≔}\left({z}{+}{2}\right){}\left({z}{-}{5}\right){}\left({z}{+}{3}\right)$ (3)
 > $\mathrm{CompanionMatrix}\left(q\right)$
 $\left[\begin{array}{rrr}{0}& {0}& {30}\\ {1}& {0}& {19}\\ {0}& {1}& {0}\end{array}\right]$ (4)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam