Find solution to matrix equation Find all solutions to the equation $X^2+        \begin{bmatrix}
        1 & -1  \\
        1 & 1  \\
        \end{bmatrix}X+\begin{bmatrix}
        -7 & 1  \\
        0 & 0  \\
        \end{bmatrix}=\begin{bmatrix}
        0 & 0  \\
        0 & 0  \\
        \end{bmatrix}$
Is there a direct method for solving quadratic matrix equations, without forming a linear system?
 A: A generic Riccati equation can be reduced to an equation of the form $X^2+AX+B=0$ where $A,B$ are generic (the entries of $A,B$ are independent and transcendental over $\mathbb{C}$); when $n=2$, such an equation has always exactly $6$ solutions. Genericity can be simulated by a random choice of $A,B$. Here, it is as if $A,B$ are random.
The solving method is due to Roth, Bell, Potter, Anderson. We consider the $(4\times 4)$ pseudo-hamiltonian matrix: $M=\begin{pmatrix}0&-I_1\\B&A\end{pmatrix}$; note that the graph of a solution $X$ is $M$-invariant.
Step 1. Find the set (with $6$ elements) of $2$-dimensional $M$-invariant subspaces $E$  that satisfy the condition "$E$ is complementary to $\{0_2\}\times \mathbb{C}^2$." Since $M$ has distinct eigenvalues, there are $\binom{4}{2}=6$ such subspaces $E$.
Step 2. Such a subspace $E$ is spanned by $(f_1,f_2)=\begin{pmatrix}U_{2,2}\\V_{2,2}\end{pmatrix}$ where $U$ is invertible. The solution associated to $E$ is $VU^{-1}$.
Now, you can solve by yourself the problem.
