Matrix Calculator

🌐 English
A (3×3)
Rows: 3
Cols: 3
B (3×3)
Rows: 3
Cols: 3
Supports: fractions (1/2), decimals (0.5), constants (pi, e). Empty cells are treated as 0.

Calculation Results

1. What is a matrix square root?

A matrix \(X\) is called a square root of a square matrix \(A\) if

\[ X^{2} = A. \]

In general a matrix may have zero, one, or many square roots (over the reals or complex numbers). For real symmetric positive definite matrices there exists a unique symmetric positive definite square root, called the principal square root, usually denoted \(A^{1/2}\).

2. How to compute a matrix square root — common methods

  • Diagonal (or diagonalizable) matrices: If \(A = VDV^{-1}\) with \(D=\operatorname{diag}(d_i)\), then one square root is \[ X = V\,\operatorname{diag}(\pm\sqrt{d_i})\,V^{-1}, \] provided the \(d_i\) admit square roots (e.g. \(d_i>0\) for real principal roots).
  • Symmetric positive definite case: if \(A\) is symmetric positive definite and \(A=V D V^{T}\) orthogonally diagonalizes, the principal (symmetric) square root is \[ A^{1/2} = V \operatorname{diag}(\sqrt{d_i}) V^{T}. \]
  • Schur method (numerical): compute real Schur \(A = Q T Q^{T}\) with \(T\) quasi-triangular, compute a square root \(S\) of \(T\) blockwise, then set \(X = Q S Q^{T}\).
  • Matrix Newton iteration (numerical): \[ X_{k+1} = \tfrac{1}{2}\left(X_k + X_k^{-1} A\right), \] starting from a suitable \(X_0\), converges quadratically to a square root under conditions.

3. Worked examples

Example 1 — diagonal matrix (easy)

\[ A = \begin{pmatrix}4 & 0 \\[4pt] 0 & 9\end{pmatrix} \]

Since \(A\) is diagonal, take square roots of diagonal entries (principal positive roots):

\[ A^{1/2} = \begin{pmatrix}2 & 0 \\[4pt] 0 & 3\end{pmatrix}. \]

Check: \(\begin{pmatrix}2 &0\\0&3\end{pmatrix}^2 = \begin{pmatrix}4&0\\0&9\end{pmatrix}.\)

Example 2 — symmetric positive-definite 2×2 (diagonalization)

Let

\[ A = \begin{pmatrix}5 & 4 \\[4pt] 4 & 5\end{pmatrix}. \]

Compute eigen-decomposition. Eigenvalues are \(\lambda_1=9,\ \lambda_2=1\); orthonormal eigenvectors form

\[ V = \frac{1}{\sqrt{2}}\begin{pmatrix}1 & 1 \\[4pt] 1 & -1\end{pmatrix}. \]

Principal square root (use positive roots):

\[ A^{1/2} = V \operatorname{diag}(\sqrt{9},\sqrt{1}) V^{T} = V \operatorname{diag}(3,1) V^{T}. \]

Carrying out the multiplication (since \(V\) is orthogonal):

\[ A^{1/2} = \frac{1}{2}\begin{pmatrix}3+1 & 3-1 \\[4pt] 3-1 & 3+1\end{pmatrix} = \begin{pmatrix}2 & 1 \\[4pt] 1 & 2\end{pmatrix}. \]

Check: \(\begin{pmatrix}2&1\\1&2\end{pmatrix}^2=\begin{pmatrix}5&4\\4&5\end{pmatrix}=A.\)

4. Common mistakes

  • Treating square root element-wise: \(A^{1/2}\) is not generally \((\sqrt{a_{ij}})\).
  • Assuming existence for arbitrary matrices: not every real matrix has a real square root (or a symmetric real square root). Check eigenvalues and Jordan blocks.
  • Using diagonalization without checking: diagonalization requires a full set of eigenvectors; if \(A\) is not diagonalizable use Schur/Jordan methods.
  • Mixing signs: eigenvalues have two square roots \(\pm\sqrt{\lambda}\); principal square root uses the positive branch for positive eigenvalues.
  • Neglecting numerical stability: computing square roots for nearly defective matrices requires stable algorithms (Schur + careful block solves or Newton iteration).

5. Practice problems

Try these problems. Click Show Answer to reveal the (principal) square root.

Exercise 1

\[ A=\begin{pmatrix}4 & 0 \\[4pt] 0 & 9\end{pmatrix} \]
Show Answer
\[ A^{1/2} = \begin{pmatrix}2 & 0 \\[4pt] 0 & 3\end{pmatrix}. \]

Exercise 2

\[ A=\begin{pmatrix}5 & 4 \\[4pt] 4 & 5\end{pmatrix} \]
Show Answer
\[ A^{1/2} = \begin{pmatrix}2 & 1 \\[4pt] 1 & 2\end{pmatrix}. \]

(See worked Example 2.)

Exercise 3

\[ A=\begin{pmatrix}2 & 1 \\[4pt] 1 & 2\end{pmatrix} \]
Show Answer
\[ \text{Eigenvalues: } 3,\;1.\quad A^{1/2} = \frac{1}{2}\begin{pmatrix}\sqrt{3}+1 & \sqrt{3}-1 \\[6pt] \sqrt{3}-1 & \sqrt{3}+1\end{pmatrix}. \]

This is the principal symmetric square root (use positive root \(\sqrt{3}\)).

Exercise 4

\[ A=\begin{pmatrix}1 & 0 & 0 \\[4pt] 0 & 4 & 0 \\[4pt] 0 & 0 & 9\end{pmatrix} \]
Show Answer
\[ A^{1/2} = \begin{pmatrix}1 & 0 & 0 \\[4pt] 0 & 2 & 0 \\[4pt] 0 & 0 & 3\end{pmatrix}. \]

Diagonal case: take positive square roots on the diagonal.


Copyright Notice: This article is original content from the Matrix Calculator website. Please credit the source when sharing or reproducing it. For more matrix computation tools, visit matrixcalcu.com.

Learn matrix multiplication more easily in just 2 minutes with this free game.

Matrix Multiplication Game