I am trying to find minimizer X for which
$$ \arg \min_{X} {\left\|| A X + X B - Y \right\||}_{F} $$
when all matrices are square. I know to use the pseudoinverse of A for
$$ \arg \min_{X} {\left\|| A X - Y \right\||}_{F} $$
but don't understand how to rewrite the argument of the first equation to a solvable form.
Since $\left\|A X + X B - Y \right\|_F=\|(I\otimes A+B^T\otimes I)\operatorname{vec}(X)-\operatorname{vec}(Y)\|_2$ (see Wikipedia for the meaning of the $\operatorname{vec}$ operator), this is just an ordinary least-square problem and a global minimiser is given by $\operatorname{vec}(X)=(I\otimes A+B^T\otimes I)^+\operatorname{vec}(Y)$.