Prove that there exists an $m \times m$ matrix $X$ such that $AX-XA=C.$ Let $A$ be a real symmetric $m \times m$ matrix with $m$ distinct eigenvalues and $v_1,v_2, \cdots , v_m$ be the corresponding eigenvectors. Let $C$ be an $m \times m$ matrix such that $\left \langle Cv_j,v_j \right \rangle = 0$ for all $1 \leq j \leq m.$ Prove that there exists an $m \times m$ matrix $X$ such that $AX-XA=C.$
How do I prove that? Any help will be highly appreciated.
Thank you very much.
 A: Take the equation
$$
AX-XA=C
$$
Pick $v_i, v_j$ and calculate the following:
$$
\langle v_i,(AX-XA)v_j\rangle=\langle v_i,AXv_j\rangle-\langle v_i,XAv_j\rangle
$$
Since $A$ is symmetric, we can move it to $v_i$ in the first term. So we get:
$$
\langle v_i,(AX-XA)v_j\rangle=(\lambda_i-\lambda_j)\langle v_i,Xv_j\rangle
$$
Motivated by this, we define $X$ by
$$
\langle v_i,Xv_j\rangle=\frac{1}{\lambda_i-\lambda_j}\langle v_i,Cv_j\rangle
$$
if $i\neq j$ and $0$ otherwise. This makes $X$ well-defined since $\langle v_i,Xv_j\rangle$ are its components in an orthogonal basis. Now we have:
$$
\langle v_i,(AX-XA)v_j\rangle=(\lambda_i-\lambda_j)\langle v_i,Xv_j\rangle=\langle v_i,Cv_j\rangle
$$
Since $\langle v_i,(AX-XA)v_j\rangle$ are just the components of $AX-XA$ in some orthogonal basis and they are equal to the components of $C$ in this same basis, $AX-XA = C$.
A: In the basis $v_k$ we see that $A$ is diagonal with diagonal elements $\lambda_k$.
In this basis, we see that $[C]_{kk} = 0$.
Consider the operator $L(X) = AX-XA$. It is not hard to see (in the basis $v_i v_j^T$) that
$[L(X)]_{ij} = (\lambda_i - \lambda_j)[X]_{ij}$ and hence
${\cal R} L = \{ B | B \text{ has zero diagonal} \}$.
Returning to the original question, we see that $C \in {\cal R}L$ iff $C$ has a zero diagonal in the basis $v_k$.
A: Hint: We may assume $v_i$ has unit length so $v_1,\dots,v_m$ is an orthonormal basis.  With respect to this orthonormal basis we need to solve $DY-YD=B$ for $Y$ where $B$ has all zeros on the diagonal and $D$ is diagonal with distinct entries.  Now write out the entries of $DY-YD$ to see you can solve this for $Y$.
