Let $P, Q$ be a symmetric positive definite real matrices. I have an equation in the real matrix $X$ of the form $$ \Big(\mathrm{trace}(X^TP) I + Q\Big)X = Q. $$ I also know that $\mathrm{trace}(P) = 1$. Above, $I$ denotes the identity matrix of same dimensions as $X$.
I was wondering if this kind of equation can be solved in the indeterminate $X$. In one dimension it is a quadratic equation, and therefore the solvability is easily understood. Is there an analogue in higher dimensions?
Yes, but then what you get is a degree-$(n+1)$ polynomial equation when the matrices are $n\times n$. Let $t=\operatorname{trace}(X^TP)$. Since $Q$ is positive definite, the LHS of the equation must be nonsingular. It follows that $tI+Q$ is nonsingular and $$ X=(tI+Q)^{-1}Q=(tQ^{-1}+I)^{-1}. $$ Therefore $$ t=\operatorname{trace}(X^TP) =\operatorname{trace}\left((tQ^{-1}+I)^{-1}P\right). $$ Let $Q=U\Lambda U^T$ be an orthogonal diagonalisation and let $S=U^TPU$. The above equation can then be rewritten as $t=\operatorname{trace}\left((t\Lambda^{-1}+I)^{-1}S\right)$, i.e., $$ t=\sum_{i=1}^n\frac{s_{ii}}{t\lambda_i^{-1}+1}. $$ Multiply both sides by $\prod_{i=1}^n(t\lambda_i^{-1}+1)$, we obtain a polynomial equation of order $n+1$.