Solving the problem of decomposing a 2×2 non-symmetric matrix as the product of two symmetric matrices led me to the general problem of finding the square root of a matrix, which is well known and whose solution is shown in wikipedia, and comes from a very important mathematical result called the Cayley-Hamilton theorem.
The Characteristic Polynomial
The characteristic polynomial of a square matrix M is given by
Where det(M) is the determinant of the matrix. The Cayley-Hamilton theorem states that a matrix polynomial with the same coefficients will have matrix
where 0M is the null matrix with the same size as M. Now if you have one matrix S which is the square root of M, so that S2=M, we can start from the Cayley-Hamilton expression for P_S(S) = 0S and separate the odd powers in the left-hand side of the equation, and the even powers on the right-hand side:
where n is the number of rows/columns and ci are the coefficients of the characteristic polynomial of S. We can then take a factor S from the left-hand side, and replace even powers with powers of M:
A Formula for A Square Root of a Matrix
Now, multiplying both sides by the inverse of the matrix sum of the left-hand side, we obtain an expression for
where the minus sign is taken out because
Now, the problem with this expression for
The characteristic polynomial can be written as:
where λi are the eigenvalues of matrix M. The eigenvalues of S are square roots of the eigenvalues of M, so
This means that the characteristic polynomials of S and M are related in the following way:
This means that coefficients for PS(λ) can be found from those in PM(λ) by solving a set of quadratic equations. Since two of the coefficients are trivial: cn = 1 and c0 = √det(M), this will be a set of (n-1) quadratic equations:
m_0 = (s_0)^2 = det(M) \\
m_1 = (s_1)^2 – 2s_0 s_2 \\
m_2 = (s_2)^2 – 2s_1 s_3 \\
\hspace{2cm} \vdots \\
m_{n-1} = (s_{n-1})^2 – 2s_{n-2}s_n \\
m_n = s_n = 1
\]
where si are the (unknown) coefficients of PS(λ) we need for the square root formula, and mi are the coefficients in PM(λ) computed for the known matrix M.
A Couple of Examples
2×2 Matrices
This is a very simple case, since there is only one variable in the quadratic system. The equations are:
det(M) = s_0^2
tr(M) = (s_1)^2 – 2\sqrt{det(M)}
1 = s_2
\]
where
S = \left(tr(M)-2\sqrt{det(M)}\right)^{-1}\left(\sqrt{det(M)}\mathbb{I}_{2\times 2}+ M\right)
\]
3×3 Matrices
In this case, two of the coefficients are also trivial
m_1 = (s_1)^2 – 2 s_2 \sqrt{det(M)}
m_2 = (s_2)^2 – 2s_1
\]
Substituting a variable obtained from one equation into the other would give an equation of degree 4, for example:
s_2 = \frac{m_1 – (s_1)^2}{2\sqrt{det(M)}}
m_2 = (\frac{m_1 – (s_1)^2}{2\sqrt{det(M)}})^2 – 2s_1
\]
These equations are not easy to solve, but can be visualised geometrically as finding the points where two parabolas intersect. Taking the axes to be
The solutions to the equations appear as intersections between the curves and there can be 4, as indicated by the equation of degree 4 obtained by substitution. When the parabolas do not intersect, there will still be 4 solutions, but they will be complex rather than real.
How to Use All This
I have shown that the problem of obtaining the square root of a square matrix amounts to compute the coefficients of a characteristic polinomial, and solving a set of quadratic equations involving those coefficients. The reader experienced in linear algebra might have spotted that there are some conditions that have to be fulfilled, such as certain matrices being invertible. But apart from that, this procedure can be useful whenever you need the square root of a matrix. I hope it will be anyway.