Solutions of $X+X^t=tr(X).A$ in $M_n(K)$, where $A\in M_n(K)$ is given I recently stumbled upon the following equation in $M_n(K)$, with $K=\mathbb{R}$ or $\mathbb{C}$, where $X$ is an unknown matrix in $M_n(K)$:
$$X+X^t=Tr(X).A$$
Of course, if $X$ is antisymmetric, the equation holds for any given $A$. But if one supposes that $Tr(X)\neq 0$, and if $A$ is symmetric with $Tr(A)=2$, what are the solutions of this equation?
 A: Let $X_0$ be any solution with nonzero trace. Assume that $Y$ is another solution. Then, there exists some $\lambda$ such that $\lambda X_0$ and $Y$ have the same trace. As a consequence, $\lambda X_0-Y$ is skew-symmetric. 
Thus, every solution is $\lambda X_0+B$ for some scalar $\lambda$ and some skew-symmetric matrix $B$. 
Now, assuming there is a solution with nonzero trace, we get that $A$ is symmetric with trace $2$: as a consequence, $X_0=A$ fits the constraints! 
Therefore, the solutions are $\lambda A+B$, where $\lambda$ is a scalar and $B$ is skew-symmetric. 
A: If $X$ and $Y$ solve the equation, then so does $X + Y$.
Now let $K$ be any skew-symmetric matrix. Then if $B = A+K$, $B + B^t = A + A^t = 2A = Tr(B) A$. 
Now say $S$ is symmetric. Clearly if $S + S^t = 2S$ is proportional to $A$ then $S$ is proportional to $A$: $A = \lambda S$. A computation then shows that this is a solution for any $\lambda$ if trace $A = 2$. 
Every matrix can be decomposed as a sum of a skew-symmetric and a symmetric-matrix. So this completes the problem. 
A: When reading Mindlack's solution, I had the following thoughts:
When taking the trace in the equation, one obtains $2 Tr(S)=Tr(S)\cdot Tr(A)$, hence, if $Tr(A)\neq 2$, one has $Tr(S)=0$ for any symmetric solution of the equation. As any symmetric solution is proportional to $A$, one must have $Tr(A)=0$.
But if $S$ is a symmetric solution, on has $2S=tr(S)\cdot A$, hence, if $A$ is a solution, $A$ is necessarily zero. Therefore, the only way to have solutions when $A$ is symmetric is either $A=0$ (and the solutions are all skew-symmetric matrices), or $tr(A)=0$ (and the solutions are $\lambda A+B$ with $B$ skew-symmetric).
