Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following computational problem. Let $N$ be a positive integer and $A\in \mathbb{C}^{2N\times 2N}$, $X\in \mathbb{C}^{2N\times 4}$ and $B\in \mathbb{C}^{4\times 4}$. I want to solve the following equation for the matrix $X$ $$ A\cdot X= X\cdot B. $$ I found the following paper online ( but I haven't been able to implement it in Maple or Magma and I don't know what I should be looking for. Does someone know if it is implemented somewhere already?

share|cite|improve this question
Looks kinda like a Sylvester equation. SylvesterSolve in Maple. – Calle May 18 '11 at 17:54
up vote 3 down vote accepted

This is a Sylvester equation, $AX-XB = 0$. This can be solved in Maple by SylvesterSolve and in Matlab by lyap and in Mathematica by LyapunovSolve.

In general, you can get $X$ in a vectorized form by solving $$((I_4 \otimes A) - (B^T \otimes I_{2n})) \operatorname{vec} X = 0$$ for example by Gaussian elimination. $\otimes$ is the Kronecker product and $\operatorname{vec} X$ is the columns of $X$ put on top of each other in a vector.

share|cite|improve this answer
Hello @Calle I have a question with respect to this, how should be the solution if i have to solve $AXH+AXH-BH=0$?, in my case all matrices are square and A,B,H are constant matrices, as well I need X matrix. – Gina Torres Oct 10 '13 at 10:29
Hello Gina, I have given an answer to the question you asked at… . – Calle Oct 14 '13 at 19:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.