TITLE: Is there any inverse-commutator for matrices
QUESTION [8 upvotes]: My question is very simple. Given a symmetric real matrix $A$, and a square real matrix $C$, how can one solve the equation $[A,X]=C$, where $[A,B]$ is commutator of $A$ and $B$, i.e., $[A,B]=AB-BA$. We are more interested in symmetric matrices for $X$.
Thanks.
Update: Uranix' approach in his last edit is a great solution. Since it is closed-form enough, it can be used to prove any properties of interest for your application as it was the case for me. Tnx

REPLY [5 votes]: Let $\operatorname{spectrum}(A)=(\lambda_i)_i$ and $f:A\rightarrow I\otimes A-A^T\otimes I$. Then $\operatorname{spectrum}(f)=\{\lambda_i-\lambda_j\mid i,j\}$. Assume that we are in the generic case, which implies that the $(\lambda_i)_i$ are pairwise distinct. Thus $\dim(\ker(f))=n$ and $\dim(\operatorname{im}(f))=n^2-n$. Thus there are solutions in $X$ if $C$ is in the orthogonal of $\ker(f)$ (in a sense to be defined); in particular, a necessary condition is $\operatorname{tr}(C)=0$.