Diagonalization Calculator

Enter a square matrix to write it as PDP⁻¹.

Matrix A
Size
2

A 2 by 2 or 3 by 3 matrix, rows separated by semicolons, like 4, 1; 2, 3.

Try

Result

You entereddiagonalize (2003)\text{diagonalize } \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}

D=(2003),  P=(1001)\displaystyle D = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix},\ \ P = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}

Check

PDP−1=(1001)(2003)(1001)=(2003)\displaystyle P D P^{-1} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}
Show the work
  1. Characteristic polynomial

    An eigenvalue λ\lambda is a number for which A−λIA - \lambda I is singular, so its determinant is 0. Expanding that determinant gives the characteristic polynomial.

    p(λ)=det⁡(λI−A)=λ2−5λ+6\begin{aligned} p\left(\lambda\right) &= \det\left(\lambda I - A\right) \\ &= \lambda^{2} - 5\lambda + 6 \end{aligned}
  2. Eigenvalues from the roots

    Setting the polynomial equal to 0 and factoring gives the eigenvalues, listed here from smallest to largest.

    p(λ)=(λ−2)(λ−3)=0,  λ=2, λ=3p\left(\lambda\right) = \left(\lambda - 2\right)\left(\lambda - 3\right) = 0,\ \ \lambda = 2,\ \lambda = 3
  3. Eigenvectors for an eigenvalue

    For λ=2\lambda = 2, an eigenvector v\mathbf{v} satisfies (A−λI)v=0\left(A - \lambda I\right)\mathbf{v} = \mathbf{0}, so it lies in the null space of A−λIA - \lambda I. Scaled to whole numbers with no common factor and a positive first non-zero entry, it is below.

    A−2I=(0001),  v1=(1,0)A - 2I = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix},\ \ \mathbf{v}_{1} = \left(1, 0\right)
  4. Eigenvectors for an eigenvalue

    For λ=3\lambda = 3, an eigenvector v\mathbf{v} satisfies (A−λI)v=0\left(A - \lambda I\right)\mathbf{v} = \mathbf{0}, so it lies in the null space of A−λIA - \lambda I. Scaled to whole numbers with no common factor and a positive first non-zero entry, it is below.

    A−3I=(−1000),  v2=(0,1)A - 3I = \begin{pmatrix} -1 & 0 \\ 0 & 0 \end{pmatrix},\ \ \mathbf{v}_{2} = \left(0, 1\right)
  5. Diagonalization

    Put the eigenvectors in the columns of PP and the matching eigenvalues on the diagonal of DD, in the same order. Because there are enough independent eigenvectors, PP is invertible and AA is similar to the diagonal matrix DD.

    Using A=PDP−1A = P D P^{-1}

    D=(2003),  P=(1001)D = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix},\ \ P = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}
  6. Check

    Multiplying PDP−1P D P^{-1} back together should give AA.

    PDP−1=(1001)(2003)(1001)=(2003)P D P^{-1} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}
  7. Result

    So A=PDP−1A = P D P^{-1} with D=(2003),  P=(1001)D = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix},\ \ P = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}.

Worked examples