We can write an nth order linear ODE as an ODE system of n variables. The matrix describing the system is called the companion matrix to the original nth order ODE.
Consider the ODE
anx(n)+an−1x(n−1)+⋯+a0x=r.
We define variables x0=x, x1=x˙, xi=x(i). Then we can express the above ODE equivalently as