ELIAS EBNER

  • Home
  • Blog
  • Courses
  • About

Linear Algebra

  1. Vectors
    1. Scalars
    2. Vectors vs Sets
    3. Addition and Subtraction
    4. Scalar Multiplication
    5. Zero Vectors
    6. Linear Combinations
    7. Real Dot Product
    8. Length of a Vector
    9. Orthogonal Vectors
    10. Parallel Vectors
    11. Angle Between Vectors
    12. Unit Vectors
  2. Matrices
    1. Notation
    2. Indexing
    3. Submatrices
    4. Matrix-by-Vector Product
    5. Addition and Subtraction
    6. Scalar Multiplication
    7. Transpose
    8. Symmetries
    9. Matrix Multiplication
    10. Identity Matrix
    11. Non-Negative Integer Powers
    12. Reverse Order Law of Transposition
  3. Linear Systems
    1. Inverse Matrices
    2. Singular Matrices
    3. Linear Dependence
    4. Solutions
  4. Planes
    1. Vector Cross Product
  5. Gaussian Elimination
Linear Algebra ›Linear Systems ›Solutions

Solutions to a Linear System

We have talked a lot about linear systems, how many solutions they can have, what their matrices represent, etc., but we never talked about how to systematically find the solution to a linear system of equations.

In case it wasn’t clear - because I already did this in the lesson about linear dependence - a linear system with an m×nm \times nm×n matrix can be rewritten as a linear system of equations with mmm equations and nnn variables.

Take the linear system

Ax⃗=b⃗[1212−13312][x1x2x3]=[475].\begin{align*} A \vec{x} &= \vec{b} \\ \begin{bmatrix} 1 & 2 & 1 \\ 2 & -1 & 3 \\ 3 & 1 & 2 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} &= \begin{bmatrix} 4 \\ 7 \\ 5 \end{bmatrix}. \end{align*}Ax​123​2−11​132​​​x1​x2​x3​​​​=b=​475​​.​

This can be rewritten as

{x1+2x2+x3=42x1−x2+3x3=73x1+x2+2x3=5.\begin{cases} x_1 + 2 x_2 + x_3 = 4 \\ 2 x_1 - x_2 + 3 x_3 = 7 \\ 3 x_1 + x_2 + 2 x_3 = 5. \end{cases}⎩⎨⎧​x1​+2x2​+x3​=42x1​−x2​+3x3​=73x1​+x2​+2x3​=5.​

Conversely, you can rewrite any linear system of equations in the form Ax⃗=b⃗A \vec{x} = \vec{b}Ax=b.

More formally, any linear system of equations in the form

{a11x1+a12x2+⋯+a1nxn=b1a21x1+a22x2+⋯+a2nxn=b2⋮am1x1+am2x2+⋯+amnxn=bm,\begin{cases} a_{11} x_1 + a_{12} x_2 + \cdots + a_{1n} x_n = b_1 \\ a_{21} x_1 + a_{22} x_2 + \cdots + a_{2n} x_n = b_2 \\ \vdots \\ a_{m1} x_1 + a_{m2} x_2 + \cdots + a_{mn} x_n = b_m \\ \end{cases},⎩⎨⎧​a11​x1​+a12​x2​+⋯+a1n​xn​=b1​a21​x1​+a22​x2​+⋯+a2n​xn​=b2​⋮am1​x1​+am2​x2​+⋯+amn​xn​=bm​​,

can be rewritten in the form

Ax⃗=b⃗,A \vec{x} = \vec{b},Ax=b,

where

A=[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn],x⃗=[x1x2⋮xn],b⃗=[b1b2⋮bm],A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}, \quad \vec{x} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}, \quad \vec{b} = \begin{bmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{bmatrix},A=​a11​a21​⋮am1​​a12​a22​⋮am2​​⋯⋯⋱⋯​a1n​a2n​⋮amn​​​,x=​x1​x2​⋮xn​​​,b=​b1​b2​⋮bm​​​,

and vice-versa.

Visual Intuition

You should already be familiar with some method to solve a linear system of equations from earlier in your studies. We will learn more advanced and mechanical methods later in the course, but for now we will stick to what we already know.

I already mentioned the visual intuition for a linear system of equations in my lesson about linear dependence.

There, I talked about the possibility of thinking of a linear system with a 2×22 \times 22×2 matrix as two lines in a 2D-space. Their intersection (if it exists) is the solution to the linear system. There are two ways of thinking of the solution to a linear system. This is one of them, and it’s called the row picture. There’s also the so-called column picture, and we’ll look into both versions now.

We take the linear system

[12−11][x1x2]=[4−1]\begin{bmatrix} 1 & 2 \\ -1 & 1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 4 \\ -1 \end{bmatrix}[1−1​21​][x1​x2​​]=[4−1​]

as an example for the explanation.

Row Picture

You can perform the matrix-by-vector product between AAA and x⃗\vec{x}x, and then separate the entire equation into rows. This is what we did above. You basically rewrite the system into a system of equations.

So we multiply AAA by x⃗\vec{x}x, and our linear system becomes

[12−11][x1x2]=[4−1][x1+2x2−x1+x2]=[4−1].\begin{align*} \begin{bmatrix} 1 & 2 \\ -1 & 1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 4 \\ -1 \end{bmatrix} \\ \begin{bmatrix} x_1 + 2x_2 \\ -x_1 + x_2 \end{bmatrix} = \begin{bmatrix} 4 \\ -1 \end{bmatrix}. \end{align*}[1−1​21​][x1​x2​​]=[4−1​][x1​+2x2​−x1​+x2​​]=[4−1​].​

If we split everything up into rows we are left with two equations:

{x1+2x2=4−x1+x2=−1.\begin{cases} x_1 + 2x_2 = 4 \\ -x_1 + x_2 = -1. \end{cases}{x1​+2x2​=4−x1​+x2​=−1.​

If we plot x2x_2x2​ on the yyy-axis and x1x_1x1​ on the xxx-axis, we get two lines, which intersect at some point, since this system is non-singular.

As you can see, the lines cross at the point (2,1)(2,1)(2,1). In fact, this is also the solution to our system. Look, we will try x1=2x_1 = 2x1​=2 and x2=1x_2 = 1x2​=1:

{x1+2x2=4−x1+x2=−1.{2+2⋅1=4−2+1=−1{4=4−1=−1. \begin{align*} &\begin{cases} x_1 + 2x_2 = 4 \\ -x_1 + x_2 = -1. \end{cases} \\ &\begin{cases} 2 + 2 \cdot 1 = 4 \\ -2 + 1 = -1 \end{cases} \\ &\begin{cases} 4 = 4 \\ -1 = -1. \end{cases} \end{align*}​{x1​+2x2​=4−x1​+x2​=−1.​{2+2⋅1=4−2+1=−1​{4=4−1=−1.​​

A similar idea holds for 3D-Systems as well. In those cases, instead of lines, we’re dealing with planes intersecting each other. Two planes intersecting form a line, and if you add a third plane, you get a point.

So we saw that one way to think of the solution of a linear system is by splitting it up into rows and plotting the individual equations.

Column Picture

Another way of thinking about the solution to a linear system is by rewriting it as a linear combination of the columns. This remains closer to the matrix-by-vector product between AAA and x⃗\vec{x}x, where we think of the left side of Ax⃗=b⃗A\vec{x} = \vec{b}Ax=b as a linear combination of the columns of AAA.

We use the same linear system we had above:

[12−11][x1x2]=[4−1].\begin{bmatrix} 1 & 2 \\ -1 & 1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 4 \\ -1 \end{bmatrix}.[1−1​21​][x1​x2​​]=[4−1​].

The multiplication between AAA and x⃗\vec{x}x can be rewritten as

x1[1−1]+x2[21]=[4−1].x_1 \begin{bmatrix} 1 \\ -1 \end{bmatrix} + x_2 \begin{bmatrix} 2 \\ 1 \end{bmatrix} = \begin{bmatrix} 4 \\ -1 \end{bmatrix}.x1​[1−1​]+x2​[21​]=[4−1​].

If we now try the solution we found before (x1=2x_1 = 2x1​=2, x2=1x_2 = 1x2​=1), it will still work:

2[1−1]+1[21]=[4−1][2−2]+[21]=[4−1][4−1]=[4−1].\begin{align*} 2 \begin{bmatrix} 1 \\ -1 \end{bmatrix} + 1 \begin{bmatrix} 2 \\ 1 \end{bmatrix} &= \begin{bmatrix} 4 \\ -1 \end{bmatrix} \\ \begin{bmatrix} 2 \\ -2 \end{bmatrix} + \begin{bmatrix} 2 \\ 1 \end{bmatrix} &= \begin{bmatrix} 4 \\ -1 \end{bmatrix} \\ \begin{bmatrix} 4 \\ -1 \end{bmatrix} &= \begin{bmatrix} 4 \\ -1 \end{bmatrix}. \end{align*}2[1−1​]+1[21​][2−2​]+[21​][4−1​]​=[4−1​]=[4−1​]=[4−1​].​

What we’re asking now is “what linear combination of the columns of AAA gets us to the vector b⃗\vec{b}b?”. This can be represented like this:

Where a⃗1\vec{a}_1a1​ and a⃗2\vec{a}_2a2​ are the first and second columns of AAA respectively. To reach b⃗\vec{b}b, we had to add 2a⃗12\vec{a}_12a1​ and a⃗2\vec{a}_2a2​.

Conclusion

So in conclusion, the row picture focuses on the equations themselves. We want to find a solution x1,x2,⋯ ,xnx_1, x_2, \cdots, x_nx1​,x2​,⋯,xn​ to solve all equations simultaneously.

The column picture, on the other hand, focuses on the columns of AAA. We see the solution as trying to find the coefficients x1,x2,⋯ ,xnx_1, x_2, \cdots, x_nx1​,x2​,⋯,xn​ such that the linear combination x1a⃗1+x2a⃗2+⋯+xna⃗nx_1 \vec{a}_1 + x_2 \vec{a}_2 + \cdots + x_n \vec{a}_nx1​a1​+x2​a2​+⋯+xn​an​ results in b⃗\vec{b}b.

Both viewpoints really describe the same problem, but from different perspectives.

Previous
Linear Dependence and Independence
Next
Planes
This website does not collect personal data, does not use cookies, and does not perform any tracking.