This might be a well-known problem but I am having trouble to find this. For square matrices $X, A, B,$ how to obtain the general solution for $X$, for the quadratic matrix equation $X A X^{T} = B$ ? What are the existence and uniqueness conditions for such solution? 



Solving a quadratic matrix equation
This relationship is called congruence, and for symmetric (or hermitian) matrices $A, B$ such an $X$ exists if and only if the matrices have the same inertia (the same number of positive, negative, zero eigenvalues). Fro general matrices congruence is much less well known, but it *is* quite well understood, see:


<https://gauss.uc3m.es/fteran/papers/2010-1.pdf>


