TITLE: General Sylvester's linear matrix equation
QUESTION [8 upvotes]: For what conditions on $A$, $B$ and $C$ (square matrices of size $n$) would there be a unique solution to
$$
ABX + AXC + XBC = D,
$$
for any $D$? Can one expect a characterization similar to the Sylvester Theorem, which states that there always exists a unique solution to $AX + XB = C$, for any $C$, if and only if $A$ and $-B$ do not share an eigenvalue? And then, can this be extended to equations of the form $ABCX + ABXD + AXCD + XBCD = E$, and beyond?

REPLY [5 votes]: Can one expect a characterization similar to the Sylvester Theorem

As far as I know, no, apart from very special cases where the coefficients can be triangularized simultaneously. There is a big gap in difficulty between the 2-term case (where there is a canonical form for pairs of matrices, an $O(n^3)$ algorithm, etc.) and the 3-term case, when there is basically nothing apart from turning it into a $n^2 \times n^2$ linear system.
Even in your case where your coefficients have a special form no particular simplifications spring to mind. As far as I know, a nice characterization is an unsolved (and very likely unsolvable) problem.