Post · 8 min read· pp. 615–619

What Is the Sylvester Equation?

The Sylvester equation is the linear matrix equation

AX−XB=C,AX - XB = C,

where A∈Cm×mA\in\mathbb{C}^{m\times m}, B∈Cn×nB\in\mathbb{C}^{n\times n}, and X,C∈Cm×nX,C\in\mathbb{C}^{m\times n}. It is named after James Joseph Sylvester (1814–1897), who considered the homogeneous version of the equation, AX−XB=0AX - XB = 0 in 1884. Special cases of the equation are Ax=bAx = b (a standard linear system), AX=XAAX = XA (matrix commutativity), Ax=λxAx = \lambda x (an eigenvalue–eigenvector equation), and AX=IAX = I (matrix inversion).

In the case where B=AB = A, taking the trace of both sides of the equation gives

trace(C)=trace(AX−XA)=trace(AX)−trace(XA)=0,\mathrm{trace}(C) = \mathrm{trace}(AX - XA) = \mathrm{trace}(AX) - \mathrm{trace} (XA) = 0,

so a solution can exist only when CC has zero trace. Hence AX−XA=IAX - XA = I, for example, has no solution.

To determine when the Sylvester equation has a solution we will transform it into a simpler form. Let A=URU∗A = URU^* and B=VSV∗B = VSV^* be Schur decompositions, where UU and VV are unitary and RR and SS are upper triangular. Premultiplying the Sylvester equation by U∗U^*, postmultiplying by VV, and setting Y=U∗XVY = U^*XV and D=U∗CVD = U^*CV, we obtain

RY−YS=D,RY - YS = D,

which is a Sylvester equation with upper triangular coefficient matrices. Equating the jjth columns on both sides leads to

(R−sjjI)yj=dj−∑k=1j−1skjyk,j=1 ⁣:n.(R - s_{jj}I) y_j = d_j - \displaystyle\sum_{k=1}^{j-1} s_{kj} y_k, \quad j = 1\colon n.

As long as the triangular matrices R−sjjIR - s_{jj}I are nonsingular for all jj we can uniquely solve for y1y_1, y2y_2, …, yny_n in turn. Hence the Sylvester equation has a unique solution if rii≠sjjr_{ii} \ne s_{jj} for all ii and jj, that is, if AA and BB have no eigenvalue in common.

Since the Sylvester is a linear equation it must be possible to express it in the standard form “Ax=bAx = b”. This can be done by applying the vec operator, which yields

(In⊗A−BT⊗Im)vec(X)=vec(C),(∗)\qquad\qquad\qquad\qquad\qquad (I_n \otimes A - B^T \otimes I_m) \mathrm{vec}(X) = \mathrm{vec}(C), \qquad\qquad\qquad\qquad\qquad(*)

where ⊗\otimes is the Kronecker product. Using the Schur transformations above it is easy to show that the eigenvalues of the coefficient matrix are given in terms of those of AA and BB by

λij(In⊗A−BT⊗Im)=λi(A)−λj(B),i=1 ⁣:m,j=1 ⁣:n,\lambda_{ij} (I_n\otimes A - B^T\otimes I_m) = \lambda_i(A) - \lambda_j(B), \quad i=1\colon m, \quad j=1\colon n,

so the coefficient matrix is nonsingular when λi(A)≠λj(B)\lambda_i(A) \ne \lambda_j(B) for all ii and jj.

By considering the derivative of Z(t)=eAtCe−BtZ(t) = \mathrm{e}^{At}C\mathrm{e}^{-Bt}, it can be shown that if the eigenvalues of AA and −B-B have negative real parts (that is, AA and −B-B are stable matrices) then

X=−∫0∞eAtCe−Bt dtX = -\displaystyle\int_0^{\infty} \mathrm{e}^{At} C \mathrm{e}^{-Bt} \, \mathrm{d}t

is the unique solution of AX−XB=CAX - XB = C.

Applications

An important application of the Sylvester equation is in block diagonalization. Consider the block upper triangular matrix

T=[AC0B].T = \begin{bmatrix} A & C\\ 0 & B \end{bmatrix}.

If we can find a nonsingular matrix ZZ such that Z−1TZ=diag(A,B)Z^{-1}TZ = \mathrm{diag}(A,B) then certain computations with TT become much easier. For example, for any function ff,

f(T)=f(Zdiag(A,B)Z−1)=Zf(diag(A,B))Z−1=Zdiag(f(A),f(B))Z−1,f(T) = f(Z \mathrm{diag}(A,B) Z^{-1}) = Zf(\mathrm{diag}(A,B)) Z^{-1} = Z\mathrm{diag}(f(A),f(B)) Z^{-1},

so computing f(T)f(T) reduces to computing f(A)f(A) and f(B)f(B). Setting

Z=[I−X0I].Z = \begin{bmatrix} I & -X\\ 0 & I \end{bmatrix}.

and noting that Z−1Z^{-1} is just ZZ with the sign of the (1,2) block reversed, we find that

Z−1TZ=[A−AX+XB+C0B].Z^{-1} TZ = \begin{bmatrix} A & -AX + XB + C\\ 0 & B \end{bmatrix}.

Hence ZZ block diagonalizes TT if XX satisfies the Sylvester equation AX−XB=CAX - XB = C, which we know is possible if the eigenvalues of AA and BB are distinct. This restriction is unsurprising, as without it we could use this construction to diagonalize a 2×22\times 2 Jordan block, which of course is impossible.

For another way in which Sylvester equations arises consider the expansion (X+E)2=X2+XE+EX+E2(X+E)^2 = X^2 + XE + EX + E^2 for square matrices XX and EE, from which it follows that XE+EXXE + EX is the Fréchet derivative of the function x2x^2 at XX in the direction EE, written Lx2(X,E)L_{x^2}(X,E). Consequently, Newton’s method for the square root requires the solution of Sylvester equations, though in practice certain simplifications can be made to avoid their appearance. We can find the Fréchet derivative of x1/2x^{1/2} by applying the chain rule to (x1/2)2=x\bigl(x^{1/2}\bigr)^2 = x, which gives Lx2(X1/2,Lx1/2(X,E))=EL_{x^2}\left(X^{1/2}, L_{x^{1/2}}(X,E)\right) = E. Therefore Z=Lx1/2(X,E)Z = L_{x^{1/2}}(X,E) is the solution to the Sylvester equation X1/2Z+ZX1/2=EX^{1/2} Z + Z X^{1/2} = E. Consequently, the Sylvester equation plays a role in the perturbation theory for matrix square roots.

Sylvester equations also arise in the Schur–Parlett algorithm for computing matrix functions, which reduces a matrix to triangular Schur form TT and then solves TF−FT=0TF-FT = 0 for F=f(T)F = f(T), blockwise, by a recurrence.

Solution Methods

How can we solve the Sylvester equation? One possibility is to solve (∗)(*) by LU factorization with partial pivoting. However, the coefficient matrix is mn×mnmn\times mn and LU factorization cannot exploit the Kronecker product structure, so this approach is prohibitively expensive unless mm and nn are small. It is more efficient to compute Schur decompositions of AA and BB, transform the problem, and solve a sequence of triangular systems, as described above in our derivation of the conditions for the existence of a unique solution. This method was developed by Bartels and Stewart in 1972 and it is implemented in the MATLAB function sylvester.

In recent years research has focused particularly on solving Sylvester equations in which AA and BB are large and sparse and CC has low rank, which arise in applications in control theory and model reduction, for example. In this case it is usually possible to find good low rank approximations to XX and iterative methods based on Krylov subspaces have been very successful.

Sensitivity and the Separation

Define the separation of AA and BB by

sep(A,B)=min⁡Z≠0∥AZ−ZB∥F∥Z∥F.\mathrm{sep}(A,B) = \displaystyle\min_{Z\ne0} \displaystyle\frac{ \|AZ-ZB\|_F }{ \|Z\|_F }.

The separation is positive if AA and BB have no eigenvalue in common, which we now assume. If XX is the solution to AX−XB=CAX - XB = C then

sep(A,B)≤∥AX−XB∥F∥X∥F=∥C∥F∥X∥F,\notag \mathrm{sep}(A,B) \le \displaystyle\frac{ \|AX-XB\|_F }{ \|X\|_F } = \frac{\|C\|_F}{\|X\|_F},

so XX is bounded by

∥X∥F≤∥C∥Fsep(A,B).\notag \|X\|_F \le \displaystyle\frac{\|C\|_F}{\mathrm{sep}(A,B)}.

It is not hard to show that sep(A,B)−1=∥P−1∥2\mathrm{sep}(A,B)^{-1} = \|P^{-1}\|_2, where PP is the matrix in (∗)(*). This bound on ∥X∥F\|X\|_F is a generalization of ∥x∥2≤∥A−1∥2∥b∥2\|x\|_2 \le \|A^{-1}\|_2 \|b\|_2 for Ax=bAx = b.

The separation features in a perturbation bound for the Sylvester equation. If

(A+ΔA)(X+ΔX)−(X+ΔX)(B+ΔB)=C+ΔC,\notag (A+\Delta A)(X+\Delta X) - (X+\Delta X)(B+\Delta B) = C+\Delta C,

then

∥ΔX∥F∥X∥F≤23 sep(A,B)−1(∥A∥F+∥B∥F)ϵ+O(ϵ2),\notag \displaystyle\frac{ \|\Delta X\|_F }{ \|X\|_F } \le 2\sqrt{3}\, \mathrm{sep}(A,B)^{-1} (\|A\|_F + \|B\|_F) \epsilon + O(\epsilon^2),

where

ϵ=max⁡{∥ΔA∥F∥A∥F,∥ΔB∥F∥B∥F,∥ΔC∥F∥C∥F}.\notag \epsilon = \max \left\{ \displaystyle\frac{\|\Delta A\|_F}{\|A\|_F}, \frac{\|\Delta B\|_F}{\|B\|_F}, \frac{\|\Delta C\|_F}{\|C\|_F} \right\}.

While we have the upper bound sep(A,B)≤min⁡i,j∣λi(A)−λj(B)∣\mathrm{sep}(A,B) \le \min_{i,j} |\lambda_i(A) - \lambda_j(B)|, this inequality can be extremely weak for nonnormal matrices, so two matrices can have a small separation even if their eigenvalues are well separated. To illustrate, let T(α)T(\alpha) denote the n×nn\times n upper triangular matrix with α\alpha on the diagonal and −1-1 in all entries above the diagonal. The following table shows the values of sep(T(1),T(1.1))\mathrm{sep}(T(1),T(1.1)) for several values of nn.

sep_table.jpg

Even though the eigenvalues of AA and BB are 0.10.1 apart, the separation is at the level of the unit roundoff for nn as small as 88.

The sep function was originally introduced by Stewart in the 1970s as a tool for studying the sensitivity of invariant subspaces.

Variations and Generalizations

The Sylvester equation has many variations and special cases, including the Lyapunov equation AX+XA∗=CAX + XA^* = C, the discrete Sylvester equation X+AXB=CX + AXB = C, and versions of all these for operators. It has also been generalized to multiple terms and to have coefficient matrices on both sides of XX, yielding

∑i=1kAiXBi=C.\displaystyle\sum_{i=1}^k A_i X B_i = C.

For k≤2k\le 2 and m=nm=n this equation can be solved in O(n3)O(n^3) flops. For k>2k > 2, no O(n3)O(n^3) flops algorithm is known and deriving efficient numerical methods remains an open problem. The equation arises in stochastic finite element discretizations of partial differential equations with random inputs, where the matrices AiA_i and BiB_i are large and sparse and, depending on the statistical properties of the random inputs, kk can be arbitrarily large.

References

This is a minimal set of references, which contain further useful references within.

This article is part of the “What Is” series, available from https://nhigham.com/category/what-is and in PDF form from the GitHub repository https://github.com/higham/what-is.