When we want to solve a system of linear equations, we pack the entire system into a single matrix equation, Ax=b.
1
Packing Equations into Ax=b and the Row Picture
To find the numbers x and y that satisfy two equations at the same time, we can read the matrix equation Ax=b across its rows as intersecting lines on a grid.
Packing Equations into Ax = b and the Row Picture
2x+1y1x+3y=5=5
(x,y)=?
Text solution
Pack the coefficients, unknowns, and totals into Ax=bPull the numbers in front of x and y into the matrix A, stack the unknowns into the vector x, and stack the right-hand sides into the target vector b.
2x+1y1x+3y=5=5⟶A[2113]x[xy]=b[55]
Read across each row to graph the linesEach row of Ax=b gives one line on the xy-grid, and the point (x,y)=(2,1) where the two lines cross satisfies both equations at once.
2
The Column Picture of Ax=b
Picturing intersecting planes gets too hard once we pass three variables, so we need a second way to read Ax=b that stays simple in any number of dimensions: splitting the system vertically into columns.
The Column Picture of Ax = b
Text solution
Split the system into columns weighted by x and yGroup the x-terms and y-terms into vertical vectors so the left side becomes a linear combination of the columns of A.
[2113][xy]=[55]⟶x[21]+y[13]=[55]
Scale the columns by x=2 and y=1 and add tip-to-tailStretching the first column by 2 and adding 1 copy of the second column lands directly on the target vector b.
2[21]+1[13]=[42]+[13]=[55]
As (x,y) moves along either line in the Row Picture, the matching entry of the column sum stays fixed at 5, and at the intersection (2,1) the tip-to-tail sum of the scaled columns lands right on [55].
A point on the left sets the weights on the columns on the right, so sliding along each line holds one entry of the column sum steady and their intersection solves both at once.
3
Two Ways to Compute Ax
Before solving for an unknown vector x, we often start with a known vector x and want to compute the product Ax. Reading A across its rows or down its columns gives two ways to calculate the same result.
Two Ways to Compute Ax
[2113]A[3−1]x=[??]
Text solution
Dot each row with x to get one entry at a timeTake the dot product of the top row with x for the top entry, and the bottom row with x for the bottom entry.
Weight the columns by the entries of x to combine whole vectorsScale the first column by 3 and the second column by −1, then add the two vectors together.
[2113][3−1]=3[21]−1[13]=[63]−[13]=[50]
4
When Does Ax=b Have a Solution?
Now we want to know when we can find weights x to reach a given target b, and how a system can have no solution or infinitely many.
When Does Ax = b Have a Solution?
independent columns
dependent columns
When the second column of A is a multiple of the first, every combination of the columns stays on a single line through the origin:
x[21]+y[42]=[55](no solution: b lies off the line)
Moving the target onto that line gives infinitely many ways to adjust the weights x and y between the two columns:
Whenever the second column lies off the line through [21], the two columns span the whole plane and reach b=[55] in one exact way; when the second column lines up with [21], the row lines turn parallel and the span shrinks to a single line that misses b.
The two columns fill the plane and the row lines cross once as long as the columns lie on different lines through the origin, but lining the columns up collapses their span to one line and turns the row lines parallel.
5
Tall and Wide Matrices
In a 2×2 matrix, two independent columns span the entire plane. Next, let's see what happens when the number of equations and unknowns do not match: how that changes the sizes of x and b, and whether independent columns still span the whole space.
Tall and Wide Matrices
tall: 3 rows, 2 columns
213
134
b
seen edge-on
wide: 2 rows, 3 columns
[21]
[13]
[34]
In a tall matrix (3 rows, 2 columns), the 2 columns only span a flat 2D plane inside 3D space, so only targets b sitting right on that plane have a solution:
In a wide matrix (2 rows, 3 columns), the first 2 independent columns already span the entire 2D plane, so the third column [34]=[21]+[13] is not needed to reach new points and gives infinitely many solutions for every b in 2D:
When both columns have non-zero entries in every position, we cannot see the weights x and y right away. Combining equations in the Row Picture puts a 0 into a column in the Column Picture so we can find one weight at a time.
How Row Operations Simplify the Columns
x[21]+y[13]=[55]
2x+1y1x+3y=5=5
b
1
2
5
1
3
5
Text solution
Clear the bottom entry of the first column with a row operationMultiply the bottom equation 1x+3y=5 by 2 and subtract the top equation 2x+1y=5 so the x-term disappears from the bottom row.
2(1x+3y)−(2x+1y)=2(5)−5⟶0x+5y=5
Read y from the bottom entry of the new column equationBecause the first column [20] now has a 0 in the bottom entry, the bottom of the equation depends only on y.
x[20]+y[15]=[55]⟶5y=5⟶y=1
Plug y=1 into the top entry to find xSubstitute y=1 into the top row and solve for x.
2x+1(1)=5⟶2x=4⟶x=2
Key concepts
Whenever you work with Ax=b, pick your view based on the question in front of you:
Computing Ax vs. understanding what Ax=b asks
If you are given x and just need the numbers in Ax, dot each row of A with x one entry at a time:
If you want to see what Ax=b means geometrically, especially in 3D or higher where picturing intersecting planes is too hard, don't use the Row Picture. Split A into columns weighted by the entries of x:
x[21]+y[13]=[55]
Checking if Ax=b has a solution
Ask whether b lies in the span of the columns of A. Always check the shape of A before concluding that independent columns span the whole space: the number of columns tells you how many weights x has, while the number of rows tells you the dimension of the space. Two independent columns span all of 2D space in [2113], but in a tall matrix like 213134 two independent columns only span a 2D plane inside 3D space, missing almost every b.
Finding the weights x step by step
When non-zero entries in every position keep you from seeing the weights right away, use a row operation to put a 0 at the bottom of the first column, turning x[21]+y[13]=[55] into x[20]+y[15]=[55]. Then you can read y=1 straight from the bottom entry and plug it into the top entry to get x=2.
7
Practice
1
Rewrite the system of equations 3x−y+2z=7,x+4z=−2, and −2x+5y−z=0 in the matrix form Ax=b and as a linear combination of the columns of A.
What coefficient belongs in the middle spot of the second equation where y does not appear?
Write the missing y-term in the second equation as 0y so every unknown stays in its own column:
3x−1y+2z1x+0y+4z−2x+5y−1z=7=−2=0
Watch out for skipping the missing y-term in x+4z=−2, which shifts 4 into the middle spot and gives the wrong second row [140] and wrong second column −145. Packing the coefficients into Ax=b gives:
31−2−10524−1xyz=7−20
Splitting the matrix vertically into a linear combination of the columns gives:
x31−2+y−105+z24−1=7−20
2
For A=[32−14] and x=[2−3], compute the product Ax in two ways: first by taking the dot product of each row with x, and second by taking a linear combination of the columns of A.
In the column way, be careful not to weight the rows 2[3−1]−3[24]=[0−14]; split A vertically so 2 scales the first column and −3 scales the second column.
In the column way, which column of A gets multiplied by 2 and which gets multiplied by −3?
In the column way, be careful not to weight the rows 2[3−1]−3[24]=[0−14]; split A vertically so 2 scales the first column and −3 scales the second column:
2[32]−3[−14]=[64]−[−312]=[9−8]
3
In the Row Picture of a 2×2 system Ax=b, the two lines intersect at the point (−1,4). If the columns of A are [23] and [12], what is the target vector b?
Watch out for dotting [−14] with each column as if the columns were rows, which gives [(−1)(2)+(4)(3)(−1)(1)+(4)(2)]=[107].
How are the intersection coordinates (−1,4) from the Row Picture used in the Column Picture?
The intersection coordinates (−1,4) in the Row Picture are the column weights x=−1 and y=4 in the Column Picture. Watch out for dotting [−14] with each column as if the columns were rows, which gives [(−1)(2)+(4)(3)(−1)(1)+(4)(2)]=[107]. Weighting the columns by −1 and 4 gives:
b=−1[23]+4[12]=[−2−3]+[48]=[25]
4
Start with the system x[13]+y[21]=[76]. Use a row operation to put a 0 at the bottom of the first column, write the new column equation, and find the solutions y and x.
Be careful not to forget to subtract 3(7)=21 from the right-hand side; leaving the target vector as [76] gives −5y=6 and the wrong answer y=−56.
How many copies of the top row 1x+2y=7 do you need to subtract from the bottom row 3x+1y=6 to eliminate 3x?
Subtract 3 times the top row from the bottom row:
(3x+1y)−3(1x+2y)=6−3(7)⟶0x−5y=−15
Be careful not to forget to subtract 3(7)=21 from the right-hand side; leaving the target vector as [76] gives −5y=6 and the wrong answer y=−56. The new column equation is:
x[10]+y[2−5]=[7−15]
Reading the bottom entry gives −5y=−15, so y=3. Plugging y=3 into the top entry gives x+2(3)=7, so x=1.
5
Let A=[31−6−2]. Explain in both the Row Picture and the Column Picture why Ax=[52] has no solution. Then find the number k for which Ax=[6k] has solutions, and give two different solution vectors x.
How is the second column [−6−2] related to the first column [31], and what line do they span?
In the Row Picture, 3x−6y=5 and 1x−2y=2 are parallel lines because multiplying the bottom equation by 3 gives 3x−6y=6=5, so they never intersect. In the Column Picture, the columns [31] and [−6−2] lie on the same line through the origin, and [52] lies off that line.
For b=[6k] to lie on the line spanned by [31], it must be 2[31]=[62], so k=2. Using 2 of the first column and 0 of the second gives our first solution, x=[20]. To get a second solution with y=1, watch out for subtracting 2 from x to get [01], which gives 0[31]+1[−6−2]=[−6−2]; because the second column is −2 times the first column, adding 1 of the second column must be balanced by adding 2 more of the first column:
4[31]+1[−6−2]=[62]⟶x=[41]
6
Consider Ax=b with A=123213. How many entries must x and b have, do the columns of A span all of 3D space, and for what number c does b=54c have a solution? Find x for that c.
Because A has 2 columns and 3 rows, x must have 2 entries and b must have 3 entries (watch out for matching x to the 3 rows and giving x3 entries).
Find the weights x and y that hit the first two entries [54] first. Once x and y are fixed, what must the third entry c equal?
Because A has 2 columns and 3 rows, x must have 2 entries and b must have 3 entries (watch out for matching x to the 3 rows and giving x3 entries). The 2 independent columns only span a flat 2D plane inside 3D space, not all of 3D space.
In column form, the system is:
x123+y213=54c
Subtracting 2 times the first row from the second row in the top two entries gives (2x+y)−2(x+2y)=4−2(5), so −3y=−6, which gives y=2 and x=5−2(2)=1. Plugging x=1 and y=2 into the third row forces c=1(3)+2(3)=9, with solution vector:
x=[12]
7
Consider the system [122133]xyz=[54]. Use the Column Picture to explain why this system can reach any target b in 2D in infinitely many ways, and find two different solution vectors xyz for b=[54].
Notice that the third column [33] equals the sum of the first two columns. Find one solution with z=0, then see how x and y adjust when you set z=1.
Splitting the system into columns gives:
x[12]+y[21]+z[33]=[54]
The three columns live in 2D space, and the first two columns [12] and [21] don't lie on the same line through the origin, so they already span the entire 2D plane, which means the third column [33]=[12]+[21] is not needed to reach new points.
Setting z=0 gives 1[12]+2[21]+0[33]=[54], so our first solution is 120. When you change z to 1, watch out for leaving x=1 and y=2 unchanged, which adds an extra [33] and lands on [87]. Because 1[33] contributes the same amount as 1[12]+1[21], reduce both x and y by 1: