# Finding the square root of a 7*7 matrix with real entries

Suppose that I have the following symbolic 7*7 matrix

   mat= {{(a^2 b^2)/c^2, 0, 0, 0, 0, 0, (a^2 b^2 e11)/c^2}, {0, (a^2 b^2)/c^2,
0, 0, 0, 0, (a^2 b^2 e22)/c^2}, {0, 0, (a^2 b^2)/c^2, 0, 0, 0, (
a^2 b^2 e33)/c^2}, {0, 0, 0, (2 a^2 b^2)/c^2, 0, 0, (2 a^2 b^2 e12)/
c^2}, {0, 0, 0, 0, (2 a^2 b^2)/c^2, 0, (2 a^2 b^2 e13)/c^2}, {0, 0,
0, 0, 0, (2 a^2 b^2)/c^2, (2 a^2 b^2 e23)/c^2}, {(a^2 b^2 e11)/
c^2, (a^2 b^2 e22)/c^2, (a^2 b^2 e33)/c^2, (2 a^2 b^2 e12)/c^2, (
2 a^2 b^2 e13)/c^2, (2 a^2 b^2 e23)/c^2,
b^2 (1 + (
a^2 (e11^2 + 2 e12^2 + 2 e13^2 + e22^2 + 2 e23^2 + e33^2))/c^2)}}


for which I have the following information

a>0, b>0, c>0, {e11,e22,e33,e12,e13,e23} are Reals.

How is it possible to symbolically obtain the square root of this matrix.

What I tried so far was to Eigendecompose the matrix but it doesn't give me a closed-form solution, despite the fact that I declare the above assumptions, i.e.

 eigen= Assuming[{e11,e22,e33,e12,e13,e23}\[Element]Reals&&a>0&&b>0&&c>0,Eigenvalues[mat]];


Are there any other ways where I can find the square root of this symbolic matrix?

• You can try to apply ToRadicals to the eigenvalues. – Henrik Schumacher Apr 1 '20 at 11:58
• You could try MatrixPower[…,1/2] – Ulrich Neumann Apr 1 '20 at 12:01
• @UlrichNeumann The first thing that I tried was MatrixPower but it wasn't useful. – KratosMath Apr 1 '20 at 12:02
• @KratosMath "wasn't useful " means "doesn't evaluate"? – Ulrich Neumann Apr 1 '20 at 12:04
• @KratosMath Result is a little bit lengthy… The root-objects can be evaluated with Normal if you assign values to the parameters. That means the Root -result can be used like other Mathematica-functions! – Ulrich Neumann Apr 1 '20 at 12:57

Are you sure that you require the square root? The Cholesky factorization does often the same job and in this case, it can be computed symbolically:

L = Simplify[CholeskyDecomposition[mat] /. Conjugate -> Identity, {a > 0, b > 0, c > 0}]


$$\left( \begin{array}{ccccccc} \frac{a b}{c} & 0 & 0 & 0 & 0 & 0 & \frac{a b \text{e11}}{c} \\ 0 & \frac{a b}{c} & 0 & 0 & 0 & 0 & \frac{a b \text{e22}}{c} \\ 0 & 0 & \frac{a b}{c} & 0 & 0 & 0 & \frac{a b \text{e33}}{c} \\ 0 & 0 & 0 & \frac{\sqrt{2} a b}{c} & 0 & 0 & \frac{\sqrt{2} a b \text{e12}}{c} \\ 0 & 0 & 0 & 0 & \frac{\sqrt{2} a b}{c} & 0 & \frac{\sqrt{2} a b \text{e13}}{c} \\ 0 & 0 & 0 & 0 & 0 & \frac{\sqrt{2} a b}{c} & \frac{\sqrt{2} a b \text{e23}}{c} \\ 0 & 0 & 0 & 0 & 0 & 0 & b \\ \end{array} \right)$$

L\[Transpose].L - mat // Simplify


$$\left( \begin{array}{ccccccc} 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} \right)$$

• Thanks for your valuable response. So as I understood from your response the Cholesky decomposition gives the square root of the matrix, is it correct always? – KratosMath Apr 2 '20 at 7:07
• The Cholesky factorization of a positive (semi-)definite matrix $A$ is an upper triangular matrix $L$ such that $A = L^T L$. So it is not exactly the square root, but it shares many important properties with it. Maybe that suffices for your application? (I cannot tell because I do not know what you are about to do...) – Henrik Schumacher Apr 2 '20 at 7:11
• Well, what I need is exactly the square root of the matrix. But, as you said, maybe this is enough for my case. – KratosMath Apr 2 '20 at 7:20
• "what I need is exactly the square root of the matrix" I am not soo sure about it. What is it that you want to do with the square root? – Henrik Schumacher Apr 2 '20 at 7:24
• The square root of the matrix is included in the FEM procedure of my code. – KratosMath Apr 2 '20 at 7:27

There is likely not a clean expression.

Even just getting rid of a bunch of common terms and truncating to a 4 x 4 leaves you with complicated expressions, and the matrix is not sparse. Try this, to get just the first term

mat3 = mat[[4 ;; 7, 4 ;; 7]] /. {e11 -> 0, e22 -> 0, b -> 1, c -> 1, π -> 1}

(* {{8, 0, 0, 8 e12}, {0, 8, 0, 8 e13}, {0, 0, 8, 8 e23},
{8 e12, 8 e13, 8 e23, 1 + 4 (2 e12^2 + 2 e13^2 + 2 e23^2 + e33^2)}} *)

MatrixPower[mat3, 1/2][[2, 1]]

(* complicated expression *)