What are eigenvectors and eigenvalues?

Eigenvectors and eigenvalues

The role of eigenvectors and eigenvalues is important in both engineering and science. They're used to solve ordinary differential equations. They're used in the well-known dimensionality reduction algorithm, Principal Component Analysis (PCA). They're also used in face recognition techniques, semidefinite matrices, and many more real-world applications as well as theoretical concepts.

Suppose, A\textbf{A} is a matrix of n×nn \times n dimensions with real values. Then, λ\lambda is the eigenvalue and v\textbf{v} is the eigenvector of nn dimension, if the following equation holds:

where, v0\textbf{v} \ne 0.

This equation shows that the matrix multiplication between the matrix A\textbf{A} and vector v\textbf{v} is equal to the vector v\textbf{v} scaled by factor λ\lambda. But it may look confusing when the LHS is a matrix-vector multiplication and the RHS is a scalar-vector multiplication. So we can write this equation in the following way:

Here, I\textbf{I} is the identity matrix with the same dimensions as that of the matrix A\textbf{A}. We can further simplify the above equation in the following way:

An easy solution to this equation would be to simply put v=0\textbf{v}=\textbf{0}. But that is not what we are interested in, thus the condition, v0 \textbf{v} \ne 0. This equation only holds with the following condition:

This is called the characteristic equation of A\textbf{A}. In other words, v\textbf{v} has a non-zero solution if and only if det(λIA) \text{det}(\lambda\textbf{I} - \textbf{A} ) is a singular matrix. Each eigenvalue will have a corresponding eigenvector.

Properties

Some of the fascinating properties of eigenvectors and eigenvalues are given below:

  • For a diagonal or triangular matrix, the eigenvalues are the diagonal entries of the matrix

  • The determinant of the matrix A\textbf{A} is equal to the product of all of its eigenvalues.

  • The number of non-zero eigenvalues represents the rank of the matrix A\textbf{A}.

  • The sum of eigenvalues of a matrix A\textbf{A} is equal to the trace of that matrix A.

  • If the matrix A\textbf{A} is a non-singular matrix, then 1/λ1/\lambda is the eigenvalue of A1\textbf{A}^{-1} with the associated eigenvector.

Code implementation

Here, we show how to calculate eigenvectors and eigenvalues of a matrix using the NumPy library of Python:

import numpy as np
A = np.array([
[5, 0],
[0, 1],
])
λ, v = np.linalg.eig(A)
print("Eigenvalues")
print("-"*30)
print(λ)
print("-"*30)
print("Eigenvectors")
print("-"*30)
print(v)
print("-"*30)

Explanation

  • Line 3–6: In these lines, we define a square matrix to compute its eigenvalues and eigenvectors. This matrix must be a square matrix otherwise, it will throw an exception.

  • Line 8: Here, we use the np.linalg.eig() function to calculate the eigenvalues and eigenvectors. It returns a tuple with the first element being the eigenvalues and the second one being the eigenvectors.

Note: In the code above, one of the properties of eigenvalues and eigenvectors is shown. It would be a fun activity to try them out.

Conclusion

There are a number of applications that require us to calculate eigenvectors and eigenvalues. Especially in the scientific community, the properties mentioned above give them great importance.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved