Recipe
Compute a function of a diagonalizable matrix
Use when: you have a diagonalizable matrix A and a function f defined at each of A's eigenvalues, not necessarily a polynomial
Goal: the matrix f(A), built by applying f to A's eigenvalues and conjugating back
Taught in Functions of a diagonalizable matrix
Quick recipe
-
1
Find A's eigenvalues and a full set of independent eigenvectors, then assemble P (eigenvectors as columns) and D (matching eigenvalues on the diagonal) so A=PDP^{-1}.
Example
For A=\begin{pmatrix}4&1\\2&3\end{pmatrix}: eigenvalues 5,2 with eigenvectors (1,1),(1,-2), so D=\text{diag}(5,2) and P=\begin{pmatrix}1&1\\1&-2\end{pmatrix}.
- A has a full set of n independent eigenvectors — continue; A is genuinely diagonalizable.
- A is missing an independent eigenvector for some eigenvalue — stop; this construction needs section 7's Jordan-block version instead.
Why: this section's whole definition of f(A) is built directly on top of a diagonalization, so nothing else below is possible without one.
-
2
Compute f(\lambda_i) for each eigenvalue on D's diagonal, leaving every off-diagonal entry at 0.
Example
For f(x)=\sqrt x and eigenvalues 5,2: f(D)=\text{diag}(\sqrt5,\sqrt2).
⚡ Shortcut
If f is a polynomial, this whole procedure agrees exactly with ordinary polynomial evaluation; evaluate f(A) directly by Horner's method instead of building a diagonalization at all.
Why: this is literally the definition of f(A) from this section, applying the ordinary numerical function once per eigenvalue.
-
3
Compute P^{-1}, then multiply P, f(D), and P^{-1} together in that order to undo the diagonalization.
Example
P^{-1}=\begin{pmatrix}2/3&1/3\\1/3&-1/3\end{pmatrix}, so \sqrt A=P\,\text{diag}(\sqrt5,\sqrt2)\,P^{-1}, a genuinely non-diagonal matrix.
Why: this conjugation is what moves the answer back out of the eigenvector basis and into A's own original coordinates.
-
4
Verify the construction on a case where the answer is independently known, such as squaring \sqrt A back to confirm it reproduces A exactly.
Example
(\sqrt A)^2=A=\begin{pmatrix}4&1\\2&3\end{pmatrix} exactly, confirming the square-root construction above.
Why: this catches an arithmetic slip in the eigenvector, diagonal, or conjugation steps before the answer is trusted.
Common mistakes
- Applying f to the wrong diagonal entries by mismatching eigenvalue order between D and the eigenvector columns of P.
- Multiplying in the wrong order, such as P^{-1}f(D)P instead of Pf(D)P^{-1}.
- Using this construction on a matrix that isn't actually diagonalizable, silently producing a wrong answer.
- Forgetting that f must be defined at every eigenvalue, such as \sqrt{\cdot} at a negative real eigenvalue.
- Assuming f(A) only makes sense for a polynomial f, missing the whole point of this section's generalization.