# Matrix pencil

In linear algebra, if ${\displaystyle A_{0},A_{1},\dots ,A_{l}}$ are ${\displaystyle n\times n}$ complex matrices for some nonnegative integer ${\displaystyle l}$, and ${\displaystyle A_{l}\neq 0}$ (the zero matrix), then the matrix pencil of degree ${\displaystyle l}$ is the matrix-valued function defined on the complex numbers ${\displaystyle L(\lambda )=\sum _{i=0}^{l}\lambda ^{i}A_{i}.}$

A particular case is a linear matrix pencil ${\displaystyle A-\lambda B\,}$ with ${\displaystyle \lambda \in \mathbb {C} {\text{ (or }}\mathbb {R} {\text{),}}}$ where ${\displaystyle A}$ and ${\displaystyle B}$ are complex (or real) ${\displaystyle n\times n}$ matrices.[1] We denote it briefly with the notation ${\displaystyle (A,B)}$.

A pencil is called regular if there is at least one value of ${\displaystyle \lambda }$ such that ${\displaystyle \det(A-\lambda B)\neq 0}$. We call eigenvalues of a matrix pencil ${\displaystyle (A,B)}$ all complex numbers ${\displaystyle \lambda }$ for which ${\displaystyle \det(A-\lambda B)=0}$ (see eigenvalue for comparison). The set of the eigenvalues is called the spectrum of the pencil and is written ${\displaystyle \sigma (A,B)}$. Moreover, the pencil is said to have one or more eigenvalues at infinity if ${\displaystyle B}$ has one or more 0 eigenvalues.

## Applications

Matrix pencils play an important role in numerical linear algebra. The problem of finding the eigenvalues of a pencil is called the generalized eigenvalue problem. The most popular algorithm for this task is the QZ algorithm, which is an implicit version of the QR algorithm to solve the associated eigenvalue problem ${\displaystyle B^{-1}Ax=\lambda x}$ without forming explicitly the matrix ${\displaystyle B^{-1}A}$ (which could be impossible or ill-conditioned if ${\displaystyle B}$ is singular or near-singular)

## Pencil generated by commuting matrices

If ${\displaystyle AB=BA}$, then the pencil generated by ${\displaystyle A}$ and ${\displaystyle B}$:[2]

1. consists only of matrices similar to a diagonal matrix, or
2. has no matrices in it similar to a diagonal matrix, or
3. has exactly one matrix in it similar to a diagonal matrix.