# The general solution to a system of equations

In your algebra classes, if a system of equations had infinitely many solutions, you would simply write “infinitely many solutions” and move on to the next problem. However, there is a lot more going on when we say “infinitely many solutions”. In this article, we will explore this idea with general solutions.

## Writing out a general solution

First, let’s review just how to write out a general solution to a given system of equations. To do this, we will look at an example.

### Example

Find the general solution to the system of equations:

$$\begin{array}{c} x_1 + 2x_2 + 8x_3 + 18x_4 = 11\\ x_1 + x_2 + 5x_3 +11x_4 = 10\\ \end{array}$$

As with any system of equations, we will use an augmented matrix and row reduce.

$$\left[ \begin{array}{cccc|c} 1 & 2 & 8 & 18 & 11\\ 1 & 1 & 5 & 11 & 10\\ \end{array} \right] \sim \left[ \begin{array}{cccc|c} 1 & 0 & 2 & 4 & 9\\ 0 & 1 & 3 & 7 & 1\\ \end{array} \right]$$

Now, write out the equations from this reduced matrix.

$$\begin{array}{c} x_1 + 2x_3 + 4x_4 = 9\\ x_2 + 3x_3 + 7x_4 = 1\\ \end{array}$$

Notice in the matrix, that the leading ones (the first nonzero entry in each row) are in the columns for $$x_1$$ and $$x_2$$.

Solve for these variables.

$$\begin{array}{c} x_1 = 9 – 2x_3 – 4x_4\\ x_2 = 1 – 3x_3 – 7x_4\\ \end{array}$$

The remaining variables are free variables, meaning, that they can take on any value. The values of $$x_1$$ and $$x_2$$ are based on the value of these two variables. In the general solution, you want to note this.

General solution:

$$\boxed{ \begin{array}{l} x_1 = 9 – 2x_3 – 4x_4\\ x_2 = 1 – 3x_3 – 7x_4\\ x_3 \text{ is free}\\ x_4 \text{ is free}\\ \end{array} }$$

There are infinitely many solutions to this system of equations, all using different values of the two free variables.

## Finding specific solutions

Suppose that you wanted to give an example of a specific solution to the system of equations above. There are infinitely many, so you have a lot of choices! You just need to consider possible values of the free variables.

### Example solution

Let:

$$\begin{array}{l} x_3 = 0\\ x_4 = 1\\ \end{array}$$

There was no special reason to pick 0 and 1. Again, this would work for ANY value you pick for these two variables.

Using these values, a solution is:

$$\begin{array}{l} x_1 = 9 – 2x_3 – 4x_4 = 9 – 2(0) – 4(1)\\ x_2 = 1 – 3x_3 – 7x_4 = 1 – 3(0) – 7(1)\\ x_3 = 0\\ x_4 = 1\\ \end{array} \rightarrow \boxed{ \begin{array}{l} x_1 = 5\\ x_2 = -6\\ x_3 = 0\\ x_4 = 1\\ \end{array} }$$

You can check these values in the original system of equations to be sure:

$$\begin{array}{l} x_1 + 2x_2 + 8x_3 + 18x_4 = 11\\ x_1 + x_2 + 5x_3 +11x_4 = 10\\ \end{array} \rightarrow \begin{array}{l} (5) + 2(-6) + 8(0) + 18(1) = 11 \text{ (true)}\\ (5) + (-6) + 5(0) +11(1) = 10 \text{ (true)}\\ \end{array}$$

Since both equations are true for these values, we know that we have found one of the many, many solutions. If we wanted to find more solutions, we could just pick different values for the two free variables $$x_1$$ and $$x_2$$.

## Summary of the steps

Given a system of equations, the steps for writing out the general solution are:

1. Row reduce the augmented matrix for the system.
2. Write out the equations from the row-reduced matrix.
3. Solve for the variables that have a leading one in their column.
4. Label the remaining variables as free variables.