If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Matrix row operations

Learn how to perform the matrix elementary row operations. These operations will allow us to solve complicated linear systems with (relatively) little hassle!

Matrix row operations

The following table summarizes the three elementary matrix row operations.
Matrix row operationExample
Switch any two rows[253346][346253]  (Interchange row 1 and row 2.)\left[\begin{array}{rr}{\blueD2} & {\blueD5} &{ \blueD{3}} \\ \greenD{3} &\greenD {4} &\greenD {6} \end{array}\right]\rightarrow\left[\begin{array}{rr} \greenD{3} & \greenD{4} &\greenD {6}\\\blueD{2} &\blueD {5} &\blueD{ 3} \end{array}\right]\\\\~~\\ \\ {\text{(Interchange row 1 and row 2.)}}
Multiply a row by a nonzero constant[253346][323533346] (Row 1 becomes 3 times itself.)\left[\begin{array}{rr}{\maroonD2} & {\maroonD5} &{ \maroonD3} \\ {3} & {4} & {6} \end{array}\right]\rightarrow\left[\begin{array}{rrr}{\goldD3 \cdot \maroonD2} & {\goldD3 \cdot \maroonD5} &{ \goldD3 \cdot \maroonD3} \\ { 3} & { 4} & { 6} \end{array}\right] \\~\\ {\text{(Row 1 becomes 3 times itself.)}}
Add one row to another[253346][2533+24+56+3]  (Row 2 becomes the sum of rows 2 and 1.)\left[\begin{array}{rr}{\tealD2} &\tealD5 &{ \tealD{3}} \\ \purpleC{3} &\purpleC {4} &\purpleC {6} \end{array}\right]\rightarrow\left[\begin{array}{rrr} {\tealD2} &\tealD5&{\tealD3}\\\purpleC{3}+\tealD2 & \purpleC{4}+\tealD5 &\purpleC{6} +\tealD3\end{array}\right]\\~~\\ {\text{(Row 2 becomes the sum of rows 2 and 1.)}}
Matrix row operations can be used to solve systems of equations, but before we look at why, let's practice these skills.

Switch any two rows

Example

Perform the row operation R, start subscript, 1, end subscript, \leftrightarrow, R, start subscript, 2, end subscript on the following matrix.
[483245712]\left[\begin{array} {rrr} 4 & 8 & 3 \\ 2 & 4 & 5 \\ 7 & 1 & 2 \end{array} \right]

Solution

R, start subscript, start color #11accd, 1, end color #11accd, end subscript, \leftrightarrow, R, start subscript, start color #1fab54, 2, end color #1fab54, end subscript means to interchange row start color #11accd, 1, end color #11accd and row start color #1fab54, 2, end color #1fab54.
So the matrix [483245712]\left[\begin{array} {rrr} \blueD4 & \blueD8 & \blueD{3} \\ \greenD2 & \greenD4 & \greenD5 \\ 7 & 1 & 2 \end{array} \right] becomes [245483712]\left[\begin{array} {rrr} \greenD2 & \greenD4 & \greenD5 \\ \blueD4 & \blueD8 & \blueD{3} \\ 7 & 1 & 2 \end{array} \right] .
Sometimes you will see the following notation used to indicate this change.
[483245712]R1R2[245483712]\left[\begin{array} {rrr} 4 & 8 & 3 \\ 2 & 4 & 5 \\ 7 & 1 & 2 \end{array} \right] \xrightarrow{{R_1\leftrightarrow R_2}}\left[\begin{array} {rrr} 2 & 4 & 5 \\ 4 &8 & 3 \\ 7 & 1 & 2 \end{array} \right]
Notice how row 1 replaces row 2 and row 2 replaces row 1. The third row is not changed.
Problem 1
  • Current
Perform the row operation R, start subscript, 2, end subscript, \leftrightarrow, R, start subscript, 3, end subscript on the following matrix.
[7296411312]\left[\begin{array} {rrr} 7 & 2 & 9 \\ 6 & 4 & 1 \\ 1 & 3 & 12 \end{array} \right]

Multiply a row by a nonzero constant

Example

Perform the row operation 3, R, start subscript, 2, end subscript, right arrow, R, start subscript, 2, end subscript on the following matrix.
[661230459]\left[\begin{array} {rrr} 6 & 6 & 1 \\ 2 & 3 & 0 \\ 4 & 5 & 9 \end{array} \right]

Solution

start color #ca337c, 3, end color #ca337c, R, start subscript, start color #e07d10, 2, end color #e07d10, end subscript, right arrow, R, start subscript, start color #e07d10, 2, end color #e07d10, end subscript means to replace the start color #e07d10, 2, start text, n, d, end text, end color #e07d10 row with start color #ca337c, 3, end color #ca337c times itself.
[661230459]\left[\begin{array} {rrr} 6 & 6 & 1 \\ \goldD{2} & \goldD{3} & \goldD{0} \\ 4 & 5 & 9 \end{array} \right] becomes [661323330459]=[661690459]\left[\begin{array} {rrr} 6 & 6 & 1 \\ \maroonD{3}\cdot \goldD{2} &\maroonD{3}\cdot \goldD{3} &\maroonD{3}\cdot \goldD{0} \\ 4 & 5 & 9 \end{array} \right] =\left[\begin{array} {rrr} 6 & 6 & 1 \\ 6 & 9 & {0} \\ 4 & 5 & 9 \end{array} \right]
To indicate this matrix row operation, we often see the following:
[661230459]3R2R2[661690459]\left[\begin{array} {rrr} 6 & 6 & 1 \\ 2 & 3 & 0 \\ 4 & 5 & 9 \end{array} \right] \xrightarrow{3R_2\rightarrow R_2}\left[\begin{array} {rrr} 6 & 6 & 1 \\ 6 & 9 & {0} \\ 4 & 5 & 9 \end{array} \right]
Notice here three times the second row replaces the second row. The other rows remain the same.
Problem 3
  • Current
Perform the row operation 2, R, start subscript, 1, end subscript, right arrow, R, start subscript, 1, end subscript on the following matrix.
[26517480]\left[\begin{array} {ccc} 2 & 6 & 5 & 1 \\ 7 & 4 & 8 & 0 \end{array} \right]

Add one row to another

Example

Perform the row operation R, start subscript, 1, end subscript, plus, R, start subscript, 2, end subscript, right arrow, R, start subscript, 2, end subscript on the following matrix.
[234081]\left[\begin{array} {rrr} 2 & 3 & 4\\ 0 & 8 & 1 \end{array} \right]

Solution

R, start subscript, start color #01a995, 1, end color #01a995, end subscript, plus, R, start subscript, start color #aa87ff, 2, end color #aa87ff, end subscript, right arrow, R, start subscript, 2, end subscript means to replace the 2, start text, n, d, end text row with the sum of the start color #01a995, 1, start text, s, t, end text, end color #01a995 and start color #aa87ff, 2, start text, n, d, end text, end color #aa87ff rows.
[234081]\left[\begin{array} {rrr} \tealD2 & \tealD{3} &\tealD{ 4}\\ \purpleC0 & \purpleC8 & \purpleC1 \end{array} \right] becomes [2342+03+84+1]=[2342115]\left[\begin{array} {lll} \tealD2 &{\tealD3} &{ \tealD4}\\ \tealD2+\purpleC0 & \tealD3+\purpleC8 & \tealD4 +\purpleC1 \end{array} \right]= \left[\begin{array} {rrr} 2 & 3 & 4\\ 2 & 11 & 5 \end{array} \right]
To indicate this matrix row operation, we can write the following:
[234081]R1+R2R2[2342115]\left[\begin{array} {rrr} 2 & 3 & 4\\ 0 & 8 & 1 \end{array} \right] \xrightarrow{R_1+R_2\rightarrow R_2} \left[\begin{array} {rrr} 2 & 3 & 4\\ 2 & 11 & 5 \end{array} \right]
Notice how the sum of row 1 and 2 replaces row 2. The other row remains the same.
Problem 5
  • Current
Perform the row operation R, start subscript, 1, end subscript, plus, R, start subscript, 3, end subscript, right arrow, R, start subscript, 3, end subscript on the following matrix.
[162350721]\left[\begin{array} {rrr} -1 & 6 & -2 \\ -3 & 5 & 0 \\ 7 & 2 & 1 \end{array} \right]

Challenge problem
Perform the row operation R, start subscript, 1, end subscript, plus, 2, R, start subscript, 3, end subscript, right arrow, R, start subscript, 1, end subscript on the following matrix.
[573214886]\left[\begin{array} {rrr} -5 & 7 & 3 \\ -2 & -1 & 4 \\ 8 & 8 & -6 \end{array} \right]

Systems of equations and matrix row operations

Recall that in an augmented matrix, each row represents one equation in the system and each column represents a variable or the constant terms.
For example, the system on the left corresponds to the augmented matrix on the right.
SystemMatrix
1x+3y=52x+5y=6\begin{aligned} 1x+3y &=5\\2x+5y &=6\end{aligned}[135256]\left[\begin{array}{cc:c}1&3&5\\\\2&5&6\end{array}\right]
When working with augmented matrices, we can perform any of the matrix row operations to create a new augmented matrix that produces an equivalent system of equations. Let's take a look at why.

Switching any two rows

Equivalent SystemsAugmented matrix
1x+3y=52x+5y=6\begin{aligned} \blueD1x+\blueD3y &=\blueD{5} \\\greenD{2}x+\greenD{{5}}y &=\greenD{6} \end{aligned} [135256]\left[\begin{array}{cc:c}\blueD1&\blueD3&\blueD5\\\\\greenD2&\greenD5&\greenD6\end{array}\right]
\downarrow
2x+5y=61x+3y=5\begin{aligned}\greenD{2}x+\greenD{{5}}y &=\greenD{6}\\ \blueD1x+\blueD3y &=\blueD{5} \end{aligned}[256135]\left[\begin{array}{cc:c}\greenD2&\greenD5&\greenD6\\\\\blueD1&\blueD3&\blueD5\end{array}\right]
The two systems in the above table are equivalent, because the order of the equations doesn't matter. This means that when using an augmented matrix to solve a system, we can interchange any two rows.

Multiply a row by a nonzero constant

We can multiply both sides of an equation by the same nonzero constant to obtain an equivalent equation.
In solving systems of equations, we often do this to eliminate a variable. Because the two equations are equivalent, we see that the two systems are also equivalent.
Equivalent SystemsAugmented matrix
1x+3y=52x+5y=6\begin{aligned} \maroonD1x+\maroonD3y &=\maroonD5 \\2x+5y &=6\end{aligned} [135256]\left[\begin{array}{cc:c}\maroonD1 & \maroonD3 &\maroonD5 \\2&5&6\end{array}\right]
\downarrow
2x+(6)y=102x+()5y=6\begin{aligned}\goldD{-2}x+(\goldD{-6})y &=\goldD{-10} \\2x+\phantom{(-)}5y &=6\end{aligned} [2610256]\left[\begin{array}{rr:r}\goldD{-2}&\goldD{-6}& \goldD{-10}\\2&5&6\end{array}\right]
This means that when using an augmented matrix to solve a system, we can multiply any row by a nonzero constant.

Add one row to another

We know that we can add two equal quantities to both sides of an equation to obtain an equivalent equation.
So if A, equals, B and C, equals, D, then A, plus, C, equals, B, plus, D.
We do this often when solving systems of equations. For example, in this system 2x6y=102x+5y=6\begin{aligned}-2x-6y &=-10 \\ {2}x+{{5}}y &={6}\end{aligned}, we can add the equations to obtain minus, y, equals, minus, 4.
Pairing this new equation with either original equation creates an equivalent system of equations.
Equivalent SystemsAugmented matrix
2x6y=102x+5y=6\begin{aligned} -2x-6y &=-10\\2x+5y &=6\end{aligned} [2610256]\left[\begin{array}{rr:r}-2&-6&-10\\2&5&6\end{array}\right]
\downarrow
2x+(6)y=100x+(1)y=4\begin{aligned}-2x+(-6)y &=-10\\\purpleC0x+(\purpleC{-1})y &=\purpleC{-4} \end{aligned}[2610014]\left[\begin{array}{rr:r}-2&-6&-10\\\purpleC0&\purpleC{-1}&\purpleC{-4}\end{array}\right]
So when using an augmented matrix to solve a system, we can add one row to another.
Concluding challenge problem
A sequence of row operations is performed on the matrix [2210233]\left[\begin{array}{rrr}{2} & {2} &{ 10} \\ {-2} & {-3} & {3} \end{array}\right]. The table below describes the result of each step in the sequence.
Arrange the row operations according to each step.
Original matrix: [2210233]\left[\begin{array}{rr:r}2&2&10\\-2 & -3 & 3\end{array}\right]
1

Notice that the original matrix corresponds to 2x+2y=102x3y=3\begin{aligned} 2x+2y &={10} \\ {-2}x-3y &={ 3} \end{aligned}, while the final matrix corresponds to x=18y=13\begin{aligned} x&=18 \\ y&=-13 \end{aligned} which simply gives the solution.
The system was solved entirely by using augmented matrices and row operations!

Want to join the conversation?