# Sylvester equation

In mathematics, in the field of control theory, the Sylvester equation is a matrix equation of the form

${\displaystyle AX+XB=C,}$

## Existence and uniqueness of the solutions

Using the Kronecker product notation and the vectorization operator ${\displaystyle \operatorname {vec} }$, we can rewrite the equation in the form

${\displaystyle (I_{n}\otimes A+B^{T}\otimes I_{n})\operatorname {vec} X=\operatorname {vec} C,}$

where ${\displaystyle I_{n}}$ is the ${\displaystyle n\times n}$ identity matrix. In this form, the Sylvester equation can be seen as a linear system of dimension ${\displaystyle n^{2}\times n^{2}}$.[1]

${\displaystyle I_{n}\otimes A+B^{T}\otimes I_{n}=(V\otimes U)(I_{n}\otimes L+M\otimes I_{n})(V\otimes U)^{-1}.}$

Since ${\displaystyle (I_{n}\otimes L+M\otimes I_{n})}$ is upper triangular with diagonal elements ${\displaystyle \lambda _{i}+\mu _{j}}$, the matrix on the left hand side is singular if and only if there exist ${\displaystyle i}$ and ${\displaystyle j}$ such that ${\displaystyle \lambda _{i}=-\mu _{j}}$.

Therefore, we have proved that the Sylvester equation has a unique solution if and only if ${\displaystyle A}$ and ${\displaystyle -B}$ have no common eigenvalues.

## Numerical solutions

A classical algorithm for the numerical solution of the Sylvester equation is the Bartels–Stewart algorithm, which consists of transforming ${\displaystyle A}$ and ${\displaystyle B}$ into Schur form by a QR algorithm, and then solving the resulting triangular system via back-substitution. This algorithm, whose computational cost is O${\displaystyle (n^{3})}$ arithmetical operations, is used, among others, by LAPACK and the lyap function in GNU Octave. See also the syl function in that language.