# How to solve this special case of Algebraic Matrix Riccati equations?

I have a particular "Ricatti equation", for $$X \in \mathbb{R}^{2 \times 2}$$, where $$A \in \mathbb{R}^{2 \times 2}$$ is symmetric positive definite:

$$X^T + X + X^T \cdot A \cdot X = \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix}$$

$$X$$ need neither be unique nor symmetric. Any solution will do.

Since it is only in two dimensions and I want to implement it for an embedded target, can someone help me with how to solve it? I know very little about nonlinear matrix equations.

I assume there is a concise iteration formula for $$X$$ that involves factorizations and can be interpreted as a Newton-type (or other rapidly convergent) iteration and is asserted to converge when started from a particular trivial initial guess. ..or at least that's what I am hoping for :)

Rewrite the equation as $$(X+A^{-1})^TA\ (X+A^{-1}) = B:= \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix} + A^{-1}.$$ This is in the form of $$Y^TAY=B$$, where $$Y=X+A^{-1}$$. Since $$A$$ is positive definite, the equation is solvable if and only if $$B$$ is positive semidefinite. In case $$B$$ is really positive semidefinite, one obvious solution is given by $$Y=R_A^{-1}R_B$$, where $$R_A^TR_A=A$$ and $$R_B^TR_B=B$$ are Cholesky decompositions of $$A$$ and $$B$$ respectively. In terms of $$X$$, this means $$X=Y-A^{-1}=R_A^{-1}R_B-A^{-1}=R_A^{-1}\left[R_B-(R_A^{-1})^T\right]$$ is a solution.