How to solve Ax=b, given some specific vector b

 
 
 
 
 

Solving Ax=b requires us to find the complementary and particular solutions

We know how to find the null space of a matrix as the full set of vectors x\vec{x} that satisfy Ax=OA\vec{x}=\vec{O}. But now we want to be able to solve the more general equation Ax=bA\vec{x}=\vec{b}. In other words, we want to be able to solve this equation when that vector on the right side is some non-zero b\vec{b}, instead of being limited to solving the equation only when b=O\vec{b}=\vec{O}.

Hi! I'm krista.

I create online courses to help you rock your math class. Read more.

 

We’ll look at the general procedure for solving Ax=bA\vec{x}=\vec{b}, but we’ll need to start by finding a b\vec{b} that we know will produce a solution x\vec{x}, before then finding the solution x\vec{x} itself.

The complementary, particular, and general solutions

We can think of the set of vectors x\vec{x} that satisfy Ax=OA\vec{x}=\vec{O} as the complementary solution to the system Ax=OA\vec{x}=\vec{O}. Once we choose a specific b\vec{b} for the equation Ax=bA\vec{x}=\vec{b}, then the solution x\vec{x} we find to Ax=bA\vec{x}=\vec{b} is the particular solution for the specific b\vec{b} that we chose. Keep in mind that the complementary solution always stays the same, but the particular solution changes depending on the specific b\vec{b} given by Ax=bA\vec{x}=\vec{b}.

The general solution (or the complete solution) to the system Ax=bA\vec{x}=\vec{b} is the sum of the complementary that satisfied Ax=OA\vec{x}=\vec{O} and the particular solution that satisfied Ax=bA\vec{x}=\vec{b}.

To distinguish between these solutions, we call the complementary solution xn\vec{x}_n (since it’s the null space), we call the particular solution xp\vec{x}_p, and we call the general solution just x\vec{x}.

Then we can say Axn=OA\vec{x}_n=\vec{O} and Axp=bA\vec{x}_p=\vec{b}. If we add these together, we get

Axn+Axp=O+bA\vec{x}_n+A\vec{x}_p=\vec{O}+\vec{b}

A(xn+xp)=bA(\vec{x}_n+\vec{x}_p)=\vec{b}

What this equation shows us is that the full set of vectors x\vec{x} that satisfies Ax=bA\vec{x}=\vec{b} will be any vector x=xn+xp\vec{x}=\vec{x}_n+\vec{x}_p, which means that the general solution will always be the sum of the complementary and particular solutions.

If you’ve taken a Differential Equations course (it’s okay if you haven’t), this should remind you of solving non-homogeneous differential equations. In both cases (here in Linear Algebra with matrices, and in Differential Equations with non-homogeneous equations), we find the set of solutions that satisfy the homogeneous equation where the right side is 00 (or the zero vector O\vec{O}), and then we find the particular solution that satisfies the specific non-zero right side we’ve been given. Then the general solution is the sum of the complementary and particular solutions.

Finding the complete solution set

So to find the full family of solutions to Ax=bA\vec{x}=\vec{b}, we first verify that a generic b=(b1,b2,b3,...bm)\vec{b}=(b_1,b_2,b_3,...b_m) will produce a solution x\vec{x}. We’ll do that by augmenting AA with b\vec{b}, putting the augmented matrix into reduced row-echelon form, and then identifying the relationship between the values of b\vec{b} such that b\vec{b} is in the column space of AA.

Once we know we have a b\vec{b} that can produce a solution x\vec{x}, we’ll find the complementary solution by solving Axn=OA\vec{x}_n=\vec{O}. Keep in mind that we’ll have already put the matrix into rref at this point, so we can start from the rref matrix when solving for the complementary solution.

Then we’ll again start with the rref matrix and solve Axp=bA\vec{x}_p=\vec{b} by plugging in the specific b\vec{b} that we’re using. Once we have the complementary and particular solutions, we’ll add them together to get the general solution.

Let’s work through a full example so that we can see how to get all the way to x=xn+xp\vec{x}=\vec{x}_n+\vec{x}_p.

 
 

How to solve any Ax=b equation, given a specific vector b


 
 

Take the course

Want to learn more about Linear Algebra? I have a step-by-step course for that. :)

 
 

 
 

Solving Ax=b for a 3x4 matrix

Example

Find the general solution to Ax=bA\vec{x}=\vec{b}.

We should start by verifying that b=(1,2,3)\vec{b}=(1,2,3) is, in fact, a vector that will produce a solution x\vec{x}. To do that, we’ll augment AA with a generic b=(b1,b2,b3)\vec{b}=(b_1,b_2,b_3),

and then put the matrix into reduced row-echelon form. Zero out the first column below the pivot.

Find the pivot in the second column.

Zero out the rest of the second column.

The third row of the augmented matrix can be rewritten as

b1b2+b3=0-b_1-b_2+b_3=0

b1+b2=b3b_1+b_2=b_3

The relationship we find here among these values of the generic b\vec{b} tell us a couple of things. First, they tell us about the relationship between the rows of the original matrix AA. Because the equation says that the sum of b1b_1 and b2b_2 is equivalent to b3b_3, it must also be true that the sum of the first two rows of AA is equivalent to the third row of AA, which we can see is the case.

Second, this relationship between these values of the generic b\vec{b} tell us that we’ll be able to find a particular solution x\vec{x} that satisfies Ax=bA\vec{x}=\vec{b}, as long as we choose a b\vec{b} that satisfies b1+b2=b3b_1+b_2=b_3. Because b=(1,2,3)\vec{b}=(1,2,3) satisfies b1+b2=b3b_1+b_2=b_3, we know we’ll be able to find a particular solution to

First though, before we find the particular solution, let’s find the complementary solution by solving Axn=OA\vec{x}_n=\vec{O}.

Let’s parse out a system of equations.

1x1+0x22x3+1x4=01x_1+0x_2-2x_3+1x_4=0

0x1+1x2+52x3+1x4=00x_1+1x_2+\frac52x_3+1x_4=0

The system simplifies to

x12x3+x4=0x_1-2x_3+x_4=0

x2+52x3+x4=0x_2+\frac52x_3+x_4=0

Solve for the pivot variables in terms of the free variables.

x1=2x3x4x_1=2x_3-x_4

x2=52x3x4x_2=-\frac52x_3-x_4

Then the vector set that satisfies the null space is given by

In other words, any linear combination of these column vectors is a member of the null space; it satisfies Axn=OA\vec{x}_n=\vec{O}. We can therefore write the complementary solution as

This should remind you of solving non-homogeneous differential equations. In both cases, we find the set of solutions that satisfy the homogeneous equation where the right side is 0, and then we find the particular solution that satisfies a specific non-zero right side.

Now we need to find the particular solution that satisfies Axp=bA\vec{x}_p=\vec{b}. We’ll plug b=(1,2,3)\vec{b}=(1,2,3) into the augmented matrix we built earlier.

To find a vector xp\vec{x}_p that satisfies Axp=bA\vec{x}_p=\vec{b}, we need to choose values for the free variables, and the easiest values to use are x3=0x_3=0 and x4=0x_4=0. Using those values, we’ll rewrite the matrix as a system of equations.

1x1+0x22(0)+1(0)=11x_1+0x_2-2(0)+1(0)=1

0x1+1x2+52(0)+1(0)=00x_1+1x_2+\frac52(0)+1(0)=0

The system becomes

x1=1x_1=1

x2=0x_2=0

So the particular solution then is x1=1x_1=1, x2=0x_2=0, x3=0x_3=0, and x4=0x_4=0, or

We’ll get the general solution by adding the particular and complementary solutions.

Therefore, we can say that any x\vec{x} that satisfies this general solution equation is a solution to the equation Ax=bA\vec{x}=\vec{b}, where b=(1,2,3)\vec{b}=(1,2,3). And as we said before, if we wanted to find a general solution to Ax=bA\vec{x}=\vec{b} for the same matrix AA but a different b\vec{b}, we would find the same complementary solution xn\vec{x}_n, but the particular solution xp\vec{x}_p would change, leading us to a different general solution x\vec{x}.

Text

 
 

Get access to the complete Linear Algebra course