[Home](https://learningfolio.de5.net/) / [Math](https://learningfolio.de5.net/math/) / [Math glossary](https://learningfolio.de5.net/math/glossary/) / Matrices in Math: Definitions, Types, and Operations

[Math glossary](https://learningfolio.de5.net/math/glossary/)

# Matrices in Math: Definitions, Types, and Operations

Read matrix dimensions and entries, identify common types, and work through examples of addition, multiplication, transpose, and systems.

Written by **Learningfolio Team**

We’re subject-matter experts in math, science, parent support, and education, with 100 years of combined experience. We believe in learning, experimenting, and growing, and we review one another’s work.

## On this page

* [TL;DR](https://learningfolio.de5.net/math/matrices/#tldr)
* [Key Points](https://learningfolio.de5.net/math/matrices/#key-points)
* [What is a matrix in mathematics?](https://learningfolio.de5.net/math/matrices/#what-is-a-matrix-in-mathematics)
* [Which types of matrices should you recognise?](https://learningfolio.de5.net/math/matrices/#which-types-of-matrices-should-you-recognise)
* [How do matrix addition, scaling, and multiplication differ?](https://learningfolio.de5.net/math/matrices/#how-do-matrix-addition-scaling-and-multiplication-differ)
* [How do matrices represent systems of equations?](https://learningfolio.de5.net/math/matrices/#how-do-matrices-represent-systems-of-equations)
* [Worked Matrix Examples](https://learningfolio.de5.net/math/matrices/#worked-matrix-examples)
* [Mistakes That Change a Matrix Answer](https://learningfolio.de5.net/math/matrices/#mistakes-that-change-a-matrix-answer)
* [Try It Yourself](https://learningfolio.de5.net/math/matrices/#try-it-yourself)
* [Answers and Reasoning](https://learningfolio.de5.net/math/matrices/#answers-and-reasoning)
* [Frequently Asked Questions](https://learningfolio.de5.net/math/matrices/#frequently-asked-questions)
* [Conclusion](https://learningfolio.de5.net/math/matrices/#conclusion)
* [Read More](https://learningfolio.de5.net/math/matrices/#read-more)
* [Research Behind This Article](https://learningfolio.de5.net/math/matrices/#research-behind-this-article)

## TL;DR

**A matrix is a rectangular array arranged in rows and columns.** Its dimensions are rows by columns. Different operations have different size rules. Matrix multiplication pairs each selected row with a selected column.

## Key Points

* A matrix with $m$ rows and $n$ columns has dimensions $m\times n$.
* The entry $a_{ij}$ is in row $i$ and column $j$.
* Add or subtract matrices only when both dimensions match.
* Multiply when the left column count matches the right row count.
* Special matrices such as the identity and zero matrix have distinct roles.

## What is a matrix in mathematics?

A **matrix** stores entries in a rectangular table. An entry can represent a measurement, a system coefficient, or a component of a transformation. The horizontal positions form rows. The vertical positions form columns.

Write $a_{ij}$ to refer to row $i$ and column $j$ of matrix $A$. The first subscript always names the row. It helps to read dimensions in the same order: rows, then columns. For instance, a matrix with three rows and two columns is $3\times2$ and has six entries. [OpenStax, Matrices and Matrix Operations](https://openstax.org/books/algebra-and-trigonometry-2e/pages/11-5-matrices-and-matrix-operations)

![A three-row, two-column matrix highlights the entry in row three and column one](https://learningfolio.de5.net/assets/versioned/matrix-rows-columns-entry-index.ff0e89849083.webp)


Read the dimensions as three by two. The marked value is in position $(3,1)$.

## Which types of matrices should you recognise?

| Type | What to look for |
| --- | --- |
| Row matrix | Exactly one row |
| Column matrix | Exactly one column |
| Square matrix | The number of rows equals the number of columns |
| Zero matrix | Every entry is zero |
| Diagonal matrix | It is square and all off-diagonal entries are zero |
| Identity matrix | A diagonal matrix with every diagonal entry equal to 1 |
| Upper triangular matrix | All entries below the main diagonal are zero |
| Symmetric matrix | It is square and equals its transpose |

A **transpose** switches rows and columns. It sends the entry in position $(i,j)$ to $(j,i)$ and turns a $3\times2$ matrix into a $2\times3$ one. A square matrix may meet several definitions at once. For instance, the identity is diagonal, symmetric, and triangular. [OpenStax, Precalculus: Matrices and Matrix Operations](https://openstax.org/books/precalculus-2e/pages/9-5-matrices-and-matrix-operations)

## How do matrix addition, scaling, and multiplication differ?

Add or subtract two matrices of the same dimensions by combining entries in matching positions. To multiply a matrix by a **scalar**, multiply every entry by that scalar.

In matrix multiplication, take a row of the left matrix and a column of the right matrix. Multiply entries from matching positions within that pair, then add. A product of an $m\times n$ matrix and an $n\times p$ matrix has dimensions $m\times p$. The shared $n$ counts the terms in each dot product. Reversing the factors can produce a different answer or make the product undefined. The [3 × 3 product guide](https://learningfolio.de5.net/math/how-to-multiply-3-x-3-matrices/) walks through a full calculation. [Georgia Tech, Interactive Linear Algebra: Matrix Multiplication](https://www.textbooks.math.gatech.edu/ila/matrix-multiplication.html)

### What rules carry over from ordinary arithmetic?

Matrix addition is commutative and associative when the matrices have equal shapes. The zero matrix with matching dimensions is the additive identity. The additive inverse of $A$ is $-A$, made by changing every entry’s sign. Multiplication by an ordinary number distributes over matrix addition. The products $(A+B)C$ and $AC+BC$ also agree when the sizes allow them, because each output entry adds corresponding scalar terms. Matrix multiplication itself is associative for compatible sizes and usually depends on order. [OpenStax, Operations and Their Properties](https://openstax.org/books/college-algebra-corequisite-support-2e/pages/7-5-matrices-and-matrix-operations)

For example, let $A$ have rows $(1,4),(-2,3)$ and $B$ have rows $(2,-1),(5,0)$. To compute $2A-B$, double each entry of $A$ and subtract the matching entry of $B$. The two rows of the result are $(0,9)$ and $(-9,6)$. The sign of the second entry of $B$ matters because $8-(-1)=9$.

The transpose also has a useful order rule. $(AB)^{\mathsf T}=B^{\mathsf T}A^{\mathsf T}$ because the row of one product becomes the column of its transpose. If $A$ is $2\times3$ and $B$ is $3\times4$, both sides have shape $4\times2$. Checking dimensions can catch a reversed formula before you calculate its entries.

## How do matrices represent systems of equations?

Place the coefficients of each equation in a different row. Keep the variables in a fixed column order. For instance, in a system with unknowns $x$ and $y$, column 1 holds the $x$ coefficients. Column 2 holds the $y$ coefficients. The numbers on the right of the equations form a separate column.

Writing $A\mathbf{x}=\mathbf{b}$ condenses those equations. If $A$ is square and has an inverse, the system has the unique solution $\mathbf{x}=A^{-1}\mathbf{b}$. A zero determinant means that method cannot be used. A rectangular matrix can still represent a valid system and can be row-reduced. The [inverse matrix guide](https://learningfolio.de5.net/math/inverse-of-matrix/) explains when the inverse exists. [OpenStax, Solving Systems With Inverses](https://openstax.org/books/algebra-and-trigonometry-2e/pages/11-7-solving-systems-with-inverses)

## Worked Matrix Examples

### Example 1

Find the dimensions and entry $a_{31}$ of

$$
A=\begin{pmatrix}2&7\\-1&3\\5&0\end{pmatrix}.
$$

1. There are three rows and two columns.
2. The dimensions are $3\times2$.
3. Row 3 starts with 5, so $a_{31}=5$.

### Example 2

Add the matrices with rows $(1,4),(-2,3)$ and $(2,-1),(5,0)$.

1. Both have dimensions $2\times2$.
2. Adding their first rows gives $(3,3)$.
3. Adding their second rows gives $(3,3)$. The entire result contains four entries equal to 3.

### Example 3

Multiply the matrices

$$
A=\begin{pmatrix}1&2&0\\-1&3&4\end{pmatrix},
\qquad
B=\begin{pmatrix}2&1\\0&5\\3&-2\end{pmatrix}.
$$

1. The inner sizes are both 3, so the result has shape $2\times2$.
2. Row 1 of $A$ dotted with column 1 of $B$ gives $1(2)+2(0)+0(3)=2$.
3. The full result has first row $(2,11)$ and second row $(10,6)$.

### Example 4

Transpose a matrix with first row $(2,0,4)$ and second row $(-1,3,5)$.

1. The first column becomes $(2,-1)$ as a row.
2. The second becomes $(0,3)$, and the third becomes $(4,5)$.
3. The result has three rows and two columns.

### Example 5

Apply the diagonal matrix with diagonal entries 2 and 3 to the column vector with entries 4 and $-1$.

1. The first row multiplies 4 by 2 and contributes zero from the other coordinate.
2. The second row multiplies $-1$ by 3.
3. The resulting vector has entries 8 and $-3$. Each diagonal entry scales the matching coordinate.

### Example 6

Represent $2x+y=7$ and $3x-y=8$ by a matrix equation and find the solution.

1. The coefficient matrix has rows $(2,1)$ and $(3,-1)$.
2. The right-hand column contains 7 and 8. Adding the equations eliminates $y$.
3. Then $5x=15$, so $x=3$ and $y=1$. Both original equations check.

## Mistakes That Change a Matrix Answer

### Mistake 1: Reading the first dimension as columns

A $2\times3$ matrix has two rows and three columns. Position $(2,3)$ means the final entry in its second row.

### Mistake 2: Adding matrices with the same number of entries but different shapes

A $2\times3$ matrix and a $3\times2$ matrix each have six entries. Their positions do not match for addition.

### Mistake 3: Using entrywise multiplication for an ordinary matrix product

The standard product combines rows with columns. Only use entrywise multiplication when the question specifies it.

## Try It Yourself

1. How many entries does a $4\times2$ matrix have?
2. What shape is the product of a $3\times2$ matrix and a $2\times4$ matrix?
3. Is the square matrix with rows $(2,5)$ and $(5,-1)$ symmetric?

## Answers and Reasoning

1. Eight entries.
2. The shared size 2 matches, producing a $3\times4$ matrix.
3. Yes. The off-diagonal positions both contain 5, so taking the transpose leaves it unchanged.

## Frequently Asked Questions

### What does the identity matrix do?

Multiplying a compatible matrix by the identity leaves its entries unchanged. The identity’s diagonal ones select matching rows or columns.

### Can two non-square matrices multiply?

Yes. Only the inner dimensions need to match. The product can be square or rectangular.

### Does every matrix have a determinant?

A determinant is defined for square matrices. The [3 × 3 determinant guide](https://learningfolio.de5.net/math/determinant-of-3x3-matrix/) explains the calculation for that size.

## Conclusion

* Read dimensions and subscripts in row-then-column order.
* Check the shape rule for the requested operation.
* Use a small row, column, or entry calculation to verify the result.

## Read More

* [Find matrix rank and interpret its meaning](https://learningfolio.de5.net/math/rank-of-matrix/)
* [Calculate a covariance matrix from aligned measurements](https://learningfolio.de5.net/math/covariance-matrix/)

## Research Behind This Article

1. OpenStax, *Algebra and Trigonometry 2e: Matrices and Matrix Operations*. [OpenStax](https://openstax.org/books/algebra-and-trigonometry-2e/pages/11-5-matrices-and-matrix-operations)
2. OpenStax, *Precalculus 2e: Matrices and Matrix Operations*. [OpenStax](https://openstax.org/books/precalculus-2e/pages/9-5-matrices-and-matrix-operations)
3. Dan Margalit and Joseph Rabinoff, *Interactive Linear Algebra: Matrix Multiplication*. [Georgia Tech](https://www.textbooks.math.gatech.edu/ila/matrix-multiplication.html)
4. OpenStax, *Algebra and Trigonometry 2e: Solving Systems With Inverses*. [OpenStax](https://openstax.org/books/algebra-and-trigonometry-2e/pages/11-7-solving-systems-with-inverses)
