You are actually looking to solve the continuous [algebraic Riccati equation][1]. For convenience, I will write your $B$ as $X=X^T$. Then the equation you're trying to solve is simply $$ X - XAX + (-C) = 0$$ Or even more explicitly, writing the Cholesky factorization of $A=BB^T$ $$ \left( \frac{1}{2}I \right)^TX + X\left( \frac{1}{2}I \right) - XBB^TX + (-C) = 0$$ The solution of an algebraic Riccati equation using Hamiltonian matrices is a standard topic in control theory. But I would instead refer you to [the "care" command in MATLAB][2]. [1]: https://en.wikipedia.org/wiki/Algebraic_Riccati_equation [2]: http://www.mathworks.com/help/control/ref/care.html