Matrix: Definition, Operations, Inverse, and Eigenvectors

Table of Contents

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices let you organize data and solve many equations at once, and they are used in computer graphics, physics, economics, and machine learning. On this page you will learn the vocabulary of matrices and how to add, multiply, and invert them, find a determinant, and find eigenvalues and eigenvectors.

What Is a Matrix?

A matrix with m rows and n columns is called an m × n matrix (read “m by n”). Each number inside is an entry or element, written as aij, where i is the row and j is the column.

A=[1 4 −2; 0 3 5]

Matrix A above is a 2 × 3 matrix. Its entry a12 (row 1, column 2) is 4, and a23 is 5.

Common types of matrices

  • Square matrix — same number of rows and columns (2 × 2, 3 × 3, …).
  • Row matrix / column matrix — a single row (1 × n) or a single column (m × 1).
  • Zero matrix — every entry is 0.
  • Diagonal matrix — a square matrix whose entries outside the main diagonal are 0.
  • Identity matrix (I) — a diagonal matrix with 1s on the main diagonal. Multiplying by I leaves a matrix unchanged: AI = IA = A.

Adding Matrices and Multiplying by a Scalar

You can add or subtract two matrices only if they have the same dimensions. Add the entries in matching positions. To multiply a matrix by a number (a scalar), multiply every entry by that number.

[1 2; 3 4] + [5 0; −1 2] = [6 2; 2 6]

3 · [1 2; 3 4] = [3 6; 9 12]

(Notation: rows are separated by a semicolon.)

Matrix Multiplication

To multiply matrix A by matrix B, the number of columns in A must equal the number of rows in B. If A is m × n and B is n × p, the product AB is an m × p matrix.

How to multiply matrices step by step

  1. Check the dimensions: columns of A = rows of B.
  2. To find the entry in row i, column j of AB, take row i of A and column j of B.
  3. Multiply the matching entries and add the products (this is a dot product).
  4. Repeat for every row of A and every column of B.

Multiply A = [1 2; 3 4] by B = [5 6; 7 8].

  • Row 1 · Column 1: 1·5 + 2·7 = 19
  • Row 1 · Column 2: 1·6 + 2·8 = 22
  • Row 2 · Column 1: 3·5 + 4·7 = 43
  • Row 2 · Column 2: 3·6 + 4·8 = 50

AB = [19 22; 43 50]

Properties of matrix multiplication

  • Not commutative: in general AB ≠ BA. For the matrices above, BA = [23 34; 31 46].
  • Associative: (AB)C = A(BC).
  • Distributive: A(B + C) = AB + AC.
  • Identity: AI = IA = A.

Determinant of a Matrix

The determinant is a single number calculated from a square matrix. It tells you whether the matrix has an inverse and how the matrix scales area (2D) or volume (3D).

  • For a 2 × 2 matrix [a b; c d]:   det = ad − bc

det [1 2; 3 4] = 1·4 − 2·3 = −2

  • For a 3 × 3 matrix, expand along the first row (cofactor expansion):

det [1 2 3; 0 1 4; 5 6 0] = 1·(1·0 − 4·6) − 2·(0·0 − 4·5) + 3·(0·6 − 1·5) = −24 + 40 − 15 = 1

Inverse of a Matrix

The inverse of a square matrix A is the matrix A−1 such that A · A−1 = A−1 · A = I. It plays the same role as a reciprocal for numbers, and it lets you solve the matrix equation AX = B as X = A−1B.

Inverse of a 2 × 2 matrix

  • For A = [a b; c d] with ad − bc ≠ 0:

A−1 = 1/(ad − bc) · [d −b; −c a]

Swap a and d, change the signs of b and c, divide by the determinant.

  • Example: A = [1 2; 3 4], det A = −2

A−1 = −1/2 · [4 −2; −3 1] = [−2 1; 1.5 −0.5]

Check: A · A−1 = [1·(−2)+2·1.5   1·1+2·(−0.5); 3·(−2)+4·1.5   3·1+4·(−0.5)] = [1 0; 0 1] ✓

Inverse of a 3 × 3 (or larger) matrix

For larger matrices, the most practical method is Gauss–Jordan elimination: write the augmented matrix [A | I], use row operations to turn the left side into I, and the right side becomes A−1. For example, the 3 × 3 matrix [1 2 3; 0 1 4; 5 6 0] has determinant 1, so it is invertible, and its inverse is [−24 18 5; 20 −15 −4; −5 4 1].

Invertible Matrix

A square matrix is invertible (also called nonsingular) if it has an inverse. A matrix with no inverse is singular. The quickest test is the determinant:

  • det A ≠ 0  →  A is invertible
  • det A = 0  →  A is singular (no inverse)

Example: det [2 4; 1 2] = 2·2 − 4·1 = 0, so this matrix is singular.

Equivalent conditions for an n × n matrix A

All of the following statements are true together or false together (the Invertible Matrix Theorem):

  • A has an inverse.
  • det A ≠ 0.
  • The equation Ax = 0 has only the solution x = 0.
  • Ax = b has exactly one solution for every b.
  • The columns (and rows) of A are linearly independent; A has rank n.
  • 0 is not an eigenvalue of A.

Non-square matrices are never invertible in this sense, because A · A−1 and A−1 · A could not both equal the same identity matrix.

Eigenvalues and Eigenvectors

An eigenvector of a square matrix A is a nonzero vector v that keeps its direction when multiplied by A — it only gets stretched or shrunk. The scale factor λ is the eigenvalue:

  • Av = λv,   v ≠ 0

Eigenvalues are often the point where linear algebra starts to feel abstract. If your teen needs a second explanation, a linear algebra tutor can walk through each step one-on-one and connect it to their class material.

How to find eigenvalues and eigenvectors

  1. Write the characteristic equation det(A − λI) = 0.
  2. Solve it for λ — these are the eigenvalues. For a 2 × 2 matrix this is a quadratic equation.
  3. For each λ, solve (A − λI)v = 0 to find the eigenvectors.

Example: A = [2 1; 1 2]

  • det(A − λI) = (2 − λ)2 − 1 = 0  →  2 − λ = ±1  →  λ = 3 or λ = 1
  • λ = 3: (A − 3I)v = [−1 1; 1 −1]v = 0  →  v = (1, 1). Check: A(1, 1) = (3, 3) = 3(1, 1) ✓
  • λ = 1: (A − I)v = [1 1; 1 1]v = 0  →  v = (1, −1). Check: A(1, −1) = (1, −1) ✓

Two useful checks: the sum of the eigenvalues equals the trace of A (the sum of the diagonal entries, here 2 + 2 = 4 = 3 + 1), and their product equals det A (here 3 = 3 · 1). Any nonzero multiple of an eigenvector, like (2, 2), is also an eigenvector.

Where Matrices Are Used

  • Solving systems of linear equations — a whole system becomes one equation, AX = B.
  • Computer graphics — rotations, scaling, and reflections of images are matrix multiplications.
  • Physics and engineering — matrices describe forces, circuits, and vibrations (eigenvalues give natural frequencies).
  • Data science — tables of data are matrices, and methods like principal component analysis rely on eigenvectors.

Matrices work closely with vectors: each row or column of a matrix is a vector, and every entry of a matrix product is a dot product.  Matrices usually appear in Algebra 2, Precalculus, and college linear algebra. Brighterly’s online high school math tutors help students keep up with these topics and prepare for tests.

Practice Problems

  1. Can you multiply a 2 × 3 matrix by a 2 × 3 matrix? Answer: No — the first has 3 columns, the second has 2 rows.
  2. Find [2 0; 1 3] · [1 4; 2 −1]. Answer: [2 8; 7 1]
  3. Find det [3 5; 2 4]. Answer: 3·4 − 5·2 = 2
  4. Find the inverse of [3 5; 2 4]. Answer: 1/2 · [4 −5; −2 3] = [2 −2.5; −1 1.5]
  5. Is [6 3; 4 2] invertible? Answer: No — det = 12 − 12 = 0.

FAQs on matrix

How do you multiply two matrices?

Multiply each row of the first matrix by each column of the second: multiply matching entries and add the results. This only works when the number of columns in the first matrix equals the number of rows in the second.

What is an invertible matrix?

An invertible matrix is a square matrix A that has an inverse A−1 with AA−1 = I. A square matrix is invertible exactly when its determinant is not zero.

How do you find the inverse of a 2 × 2 matrix?

Swap the two entries on the main diagonal, change the signs of the other two entries, and divide every entry by the determinant ad − bc.

What are eigenvectors?

Eigenvectors are nonzero vectors that a matrix only stretches or shrinks without changing their direction: Av = λv. The number λ is the eigenvalue.

Is matrix multiplication commutative?

No. In general AB ≠ BA, and sometimes only one of the two products is even defined.

Want your kid to excel in math and reading?

Kid’s grade

  • Grade 1
  • Grade 2
  • Grade 3
  • Grade 4
  • Grade 5
  • Grade 6
  • Grade 7
  • Grade 8
  • Grade 9
Image full form
image
Close a child’s math gaps with a tutor!

Close a child’s math gaps with a tutor!

Book a free demo lesson with our math tutor and see your kid fill math gaps with interactive lessons
Book demo lesson Matrix: Definition, Operations, Inverse, and Eigenvectors
Get full test results