# Matrix equation with diagonal matrix

Let $$A \in\mathbb{R}^{n\times n}$$ be a given Positive-Semi Definite matrix ,$$\theta\in\mathbb{R}^n$$ a vector, $$x\in\mathbb{R}$$ an unknown variable, and $$a\in\mathbb{R}^+$$ a positive constant. I have the following equation $$\theta^TA(A+xI)^{-1}(A+xI)^{-1}A\theta = a$$ where $$I$$ is the identity matrix.

Is it possible to solve this equation for $$x?$$

What I have tried:

$$\text{trace}(\theta^TA(A+xI)^{-1}(A+xI)^{-1}A\theta) = \text{trace}(a) \\\theta^TAA\theta \cdot\text{trace}((A+xI)^{-1}(A+xI)^{-1}) = a \\ \sum_{i = 1}^n\frac{1}{(x+s_i)^2}=\frac{a}{\|\theta\|_{A^2}^2}$$

where $$s_i$$ are the singular values of the $$A$$. Is it correct? How can i proceed from here?

• Your description and equation doesn't make sense. $A\in\mathbb{R}^n$ is not a psd matrix unless $n$ is a square number, but you are also claiming $\theta\in\mathbb{R}^n$ to be a vector that is compatible with $A$ with both (!) $\theta^TA$ and $\theta A$ appearing, so that doesn't happen unless $n=0$ (trivial) or $n=1$, in which case this is just a usual quadratic equation in $x$. Feb 10 at 8:57
• Sorry there is a typo: $A\in\mathbb{R}^{n\times n}$. Updated Feb 10 at 8:59
• Assuming WLOG $A$ is diagonal. Then the equation is $\sum_i\theta_i^2\frac{a_i^2}{(a_i+x)^2}=a$ which you can solve numerically (I don't think the $2n$-degree polynomial is solvable by radicals for generic $a_i,\theta_i$) Feb 10 at 9:33
• No, you can't pull $A\theta$ out, same as you can't pull $y$ out in $y^TBy\neq y^Ty\operatorname{tr}B$ Feb 10 at 9:47
• Let $A=\operatorname{diag}(a_i)$, so $A+xI=\operatorname{diag}(a_i+x)$ and $A(A+xI)^{-1}(A+xI)^{-1}A=\operatorname{diag}((\frac{a_i}{a_i+x})^2)$ giving $\theta^TA(A+xI)^{-1}(A+xI)^{-1}A\theta=\sum_i\theta_i^2(\frac{a_i}{a_i+x})^2$. Feb 10 at 10:06

## 2 Answers

Because $$A$$ is symetric psd matrix, we can diagonalize $$A$$ as: $$A = UDU^T$$ where $$U$$ is a orthogonal matrix ($$U^T = U^{-1}$$) and $$D$$ is a diagonal matrix. Hence, we have \begin{align} (A+xI)^{-1} &= (UDU^T+xUU^T)^{-1} \\ &= (U(D+xI)U^{-1})^{-1} \\ &= U(D+xI)^{-1}U^{-1} \\ \end{align} Then \begin{align} a & =\theta^TA(A+xI)^{-1}(A+xI)^{-1}A\theta \\ & =\theta^TUDU^T \left(U(D+xI)^{-1}U^{-1}\right) \left(U(D+xI)^{-1}U^{-1}\right)UDU^T\theta \\ & =\theta^TUD \left((D+xI)^{-1}\right)^2DU^T\theta \\ \end{align}

The matrix $$\left((D+xI)^{-1}\right)^2$$ is a diagonal matrix of $$\frac{1}{(d_i+x)^2}$$ with $$(d_1,...,d_n)$$ is the diagonal of the matrix $$D$$. Let's denote $$\eta =(\eta_1,...,\eta_n) = DU^T\theta \in \mathbb{R}^n$$, we have

$$a = \sum_{i=1}^n\frac{\eta_i^2 }{(d_i+x)^2}$$

• Hey, thanks a lot for your answer. Do you have any idea on how to solve the rational equation in the last line? Or at least if $a>0$ can we say something about the positiveness of the solutions? Feb 10 at 11:57
• @Apprentice there is no closed form expression for this equation. And you have from $2n$ real roots. The sole method you can use is numerical method.
– NN2
Feb 10 at 12:01
• what about the positivity of at least one of the solution for $a>0$? Feb 10 at 12:59

$$\def\T#1{\operatorname{tr}(#1)}$$I would suggest using Newton's Method, i.e. \eqalign{ f(x) &= 0, \quad f_k &= f(x_k), \quad f'_k &= f'(x_k) \quad\implies\quad x_{k+1} &= x_k - \frac{f_k}{f'_k} \\ } For typing convenience, define the matrices \eqalign{ B &= A+Ix \quad\implies\quad \frac{dB^n}{dx} = nB^{n-1} \\ M &= A\,\theta\theta^T\!A \\ } Set up an appropriate function and apply Newton's Method \eqalign{ f &= a - \T{MB^{-2}} \\ f' &= +\T{2MB^{-3}} \\ B_k &\doteq A + Ix_k \\ x_0 &= 1, \qquad x_{k+1} = x_k - \frac{a-\T{MB_k^{-2}}}{\T{2MB_k^{-3}}} \\ } NB: The iteration will converge to different roots depending upon the choice of $$x_0$$

Also note that if $$A$$ is diagonal, then $$B$$ is also diagonal and the matrix inversion required by the iteration can be computed very efficiently.