# How to solve a quadratic matrix equation with positive semidefinite constraint?

I have the following quadratic matrix equation:

$$XAX+X = B$$

where both $$A$$ and $$B$$ are given positive definite matrices, and $$X$$ is a covariance matrix and, hence, positive definite.

When there is no constraint, the equation can be solved via Bernoulli iteration in the following form:

$$X_{k+1} = -A^{-1}(I-BX_k^{-1})$$

However, this does not seems to preserve positive semidefinite.

Any guidance would be appreciated. Thank you.

• another iteration would be $X_{k+1}=B-X_k A X_k$. This would preserve the symmetry of the matrix and, if you start close enough to a solution, also the positive definiteness. If it converges depends however on $A$ and $B$. – Markus Sprecher Nov 7 '19 at 10:04
• Let $f(X)=XAX+X$ we have $f(X+dX)=f(X)+dX\cdot A\cdot X+X\cdot A\cdot dX+dX+O(|dX|^2)$. We could define an iteration by $X_{k+1}=X_k+dX$ where $dX$ is the solution to $f(X_k)+dX\cdot A\cdot X_k+X_k\cdot A\cdot dX+dX=B$. This is a continuous Lyapunov equation. – Markus Sprecher Nov 7 '19 at 10:09

What you have is an algebraic Riccati equation: indeed, setting $$F=-\frac12 I$$, you get $$F^TX+XF + B = XAX$$. Since $$A$$ and $$B$$ are positive definite, the pairs $$(F,A)$$ and $$(F^T,B)$$ are controllable and observable, so the classical solvability criteria are satisfied and the equation has a unique stabilizing, positive definite solution. You will find solution algorithms implemented in most numerical software; among them, Matlab's care and icare, or scipy.linalg.solve_continuous_are.