I have an equation such as
$$ X^{T}AX + X^{T}B + C = 0 $$
where $X, A, B,$ and $C$ are members of $\mathbb{R}^{n\times n}$. I would like to solve for $X.$ Nothing can be said about the symmetry or invertibility of $A, B,$ or $C$. In fact, $A$ is definitely not invertible.
$X$ has elements $\in \{0, 1\}$ on the diagonal only, so $X = X^{T}$ and $X = X^{n}, \forall n \gt 0$ so if I can get the quadratic terms together, it becomes a linear equation.
I thought to complete the square to get it in the form $$ (X - H)^{T}A(X - H) + K = 0 $$
where $H = -(A + A^{T})^{-1}B$ and $K = C - H^{T}AH$ but this didn't work because $(A + A^{T})$ is not invertible.
Obviously for real numbers, one could use the quadratic formula but I'm not sure how to proceed for the matrix case. I checked other posts for a solution but could not find anything for this type of problem specifically. This post seemed relevant but not relevant enough for me to solve my problem.
EDIT: Added that factorization didn't work, $A$ is not invertible, and $X = X^{2}$
If $X=X^2$ then
$$X^TAXX+X^TBX+CX = X^T(A+B)X+CX = 0$$
and
$$X^TX^T(A+B)X+X^TCX = X^T(A+B+C)X = 0$$
Can you proceed from here?
$\textbf{Edit:}$ What can also help is that $X$ can be written as
$$X = \sum_i c_i \cdot e_ie_i^T$$
where $e_i$ are the standard basis vectors for $\Bbb{R^n}$