I have come across the following equation but not sure how to solve it for matrix $D$. Let matrices $E$, $M$ and $D$ are three symmetric, $2\times 2$ and semi p.d. matrices. How to solve the equation $M = ED + DE$ for D, where $M$ and $E$ are known?
I tried the following, \begin{equation} M = ED + DE = E^{1/2}DE^{1/2}+E^{1/2}DE^{1/2} = E^{1/2}(D+D) E^{1/2} \end{equation} Then, we get $D = \frac{1}{2}E^{-1/2}ME^{-1/2}$. But I do not think it is correct as I found a counterexample, and also it shows $ED=DE$ which is not always true.
I appreciate any help in this regard.