Tutorials › Linear Algebra › Writing Ax=b Solutions with Free Variables

Vectors and Linear Combinations · Tutorial 130 of 1000

Writing Ax=b Solutions with Free Variables

Use row reduction to identify free variables, express all solutions with parameters, and check the resulting family in the original system.

Beginner 10 min read

What You'll Learn

  • Distinguish pivot variables from free variables in a reduced augmented matrix.
  • Choose independent real parameters for the free variables.
  • Use back-substitution to write pivot variables in terms of the parameters.
  • Express a family of solutions as a vector-valued formula.
  • Check a parametric solution by substituting it into every original equation.

From a Reduced System to a Family of Solutions

A system can have more than one solution when its equations do not determine every variable uniquely. Row reduction makes that freedom visible: a variable in a column without a pivot can be chosen freely, while the variables in pivot columns are determined by the equations. The goal is to describe all the solutions at once, rather than list a few individual solutions.

Consider a system \(\mathbf{A}\mathbf{x}=\mathbf{b}\) with real entries, where \(\mathbf{x}=(x_1,\dots,x_n)^{\top}\) is a column vector. The system is consistent if at least one vector \(\mathbf{x}\) satisfies it. Its augmented matrix is \([\mathbf{A}\mid\mathbf{b}]\). Row operations on this matrix produce an equivalent system: they change the equations’ appearance without changing which \(\mathbf{x}\) satisfy them.

Definition: In a row-reduced system, a pivot variable is a variable whose column contains a pivot, and a free variable is a variable whose column contains no pivot. To write a solution in parametric form, assign a parameter to each free variable and express every pivot variable in terms of those parameters. Each parameter may take any real value.

When a free variable is assigned a value, the pivot variables are found by solving the reduced equations, starting with the last pivot equation and working upward. In a consistent system, every choice of the free variables produces a solution. Conversely, every solution must use some values for those free variables, and the pivot equations then determine its pivot-variable values. The examples will show both the calculation and the check in the original equations.

One Free Variable and Two Free Variables

Worked Example: Two Free Variables

Write all solutions of the following system in parametric form, then check the family in the original equations.

$$ \begin{aligned} x_1+2x_2-x_3&=3,\\ 2x_1+4x_2-2x_3&=6. \end{aligned} $$

Place the coefficients and right-hand sides in an augmented matrix. Subtract twice row 1 from row 2:

$$ \begin{bmatrix} 1&2&-1&|&3\\ 2&4&-2&|&6 \end{bmatrix} \underset{R_2\to R_2-2R_1}{\sim} \begin{bmatrix} 1&2&-1&|&3\\ 0&0&0&|&0 \end{bmatrix}. $$

The only pivot is in the \(x_1\) column, so \(x_2\) and \(x_3\) are free. Set \(x_2=s\) and \(x_3=t\), where \(s,t\in\mathbb{R}\). The remaining equation gives \(x_1+2s-t=3\), hence \(x_1=3-2s+t\). Thus all solutions are

$$ \mathbf{x}= \begin{bmatrix} 3-2s+t\\ s\\ t \end{bmatrix}, \qquad s,t\in\mathbb{R}. $$

Check in the original equations: Substituting into the left side of the first equation gives \((3-2s+t)+2s-t=3\). Substituting into the second gives \(2(3-2s+t)+4s-2t=6-4s+2t+4s-2t=6\). Both equations hold for every real \(s,t\), as required.

The parameters are not extra unknowns that need to be solved for. They record the choices available for free variables. Here choosing \(s=0,t=0\) gives one solution, \((3,0,0)^{\top}\), but the full family also includes every solution obtained from other parameter values.

Worked Example: A Free Variable in a Four-Variable System

Find all solutions of

$$ \begin{aligned} x_1+x_2+x_3+x_4&=2,\\ 2x_1+3x_2+4x_3+5x_4&=5,\\ x_1+2x_2+3x_3+4x_4&=3. \end{aligned} $$

Start with the augmented matrix. Apply \(R_2\to R_2-2R_1\) and \(R_3\to R_3-R_1\):

$$ \begin{bmatrix} 1&1&1&1&|&2\\ 2&3&4&5&|&5\\ 1&2&3&4&|&3 \end{bmatrix} \sim \begin{bmatrix} 1&1&1&1&|&2\\ 0&1&2&3&|&1\\ 0&1&2&3&|&1 \end{bmatrix}. $$

Next apply \(R_3\to R_3-R_2\) to obtain a zero row, then \(R_1\to R_1-R_2\):

$$ \begin{bmatrix} 1&1&1&1&|&2\\ 0&1&2&3&|&1\\ 0&1&2&3&|&1 \end{bmatrix} \sim \begin{bmatrix} 1&0&-1&-2&|&1\\ 0&1&2&3&|&1\\ 0&0&0&0&|&0 \end{bmatrix}. $$

The pivot variables are \(x_1,x_2\); the free variables are \(x_3,x_4\). Set \(x_3=s\) and \(x_4=t\). The reduced equations give \(x_1-s-2t=1\) and \(x_2+2s+3t=1\), so \(x_1=1+s+2t\) and \(x_2=1-2s-3t\). The full family is

$$ \mathbf{x}= \begin{bmatrix} 1+s+2t\\ 1-2s-3t\\ s\\ t \end{bmatrix}, \qquad s,t\in\mathbb{R}. $$

Check in all three original equations: For the first left side, substitution gives \((1+s+2t)+(1-2s-3t)+s+t=2\). For the second, it gives \(2(1+s+2t)+3(1-2s-3t)+4s+5t=2+2s+4t+3-6s-9t+4s+5t=5\). For the third, it gives \((1+s+2t)+2(1-2s-3t)+3s+4t=1+s+2t+2-4s-6t+3s+4t=3\). Thus every member of the displayed family satisfies the original system.

Free Variables Need Not Be at the End

Choose parameters according to the columns without pivots, not according to a rule that the last variables must be free. The pivot columns can have gaps. The following reduction has pivots in columns 1 and 3, leaving \(x_2\) free.

Worked Example: A Free Variable Between Pivot Variables

Find all solutions and check them for the system

$$ \begin{aligned} 2x_1+4x_2&=2,\\ x_1+2x_2+x_3&=5. \end{aligned} $$

Swap the rows so the second equation is first. Then subtract twice the new row 1 from row 2, multiply row 2 by \(-\tfrac12\), and subtract row 2 from row 1:

$$ \begin{bmatrix} 2&4&0&|&2\\ 1&2&1&|&5 \end{bmatrix} \underset{R_1\leftrightarrow R_2}{\sim} \begin{bmatrix} 1&2&1&|&5\\ 2&4&0&|&2 \end{bmatrix} $$
$$ \underset{R_2\to R_2-2R_1}{\sim} \begin{bmatrix} 1&2&1&|&5\\ 0&0&-2&|&-8 \end{bmatrix} \underset{R_2\to-\frac12R_2}{\sim} \begin{bmatrix} 1&2&1&|&5\\ 0&0&1&|&4 \end{bmatrix} \underset{R_1\to R_1-R_2}{\sim} \begin{bmatrix} 1&2&0&|&1\\ 0&0&1&|&4 \end{bmatrix}. $$

Column 2 has no pivot, so set \(x_2=s\). The reduced equations give \(x_1+2s=1\) and \(x_3=4\). Therefore

$$ \mathbf{x}= \begin{bmatrix} 1-2s\\ s\\ 4 \end{bmatrix}, \qquad s\in\mathbb{R}. $$

Check: In the first original equation, \(2(1-2s)+4s=2-4s+4s=2\). In the second, \((1-2s)+2s+4=5\). Each parameter value gives a solution.

Why the Parametric Procedure Gives All Solutions

Theorem: Suppose a real system \(\mathbf{A}\mathbf{x}=\mathbf{b}\) is consistent, and row reduction of its augmented matrix produces a reduced system. Assign arbitrary real values to all free variables, then solve the reduced equations for the pivot variables. The resulting parametric family is exactly the set of solutions of the original system.

Proof. Each row operation preserves the set of solutions: swapping two equations changes only their order; multiplying an equation by a nonzero scalar gives an equivalent equation; and adding a multiple of one equation to another can be undone by subtracting that same multiple. Therefore the original and reduced systems have the same solutions. In the reduced system, once values are assigned to the free variables, the pivot equations determine the pivot variables by solving from the last pivot row upward. This proves that each parameter choice produces a solution of the reduced system and hence of the original system. Conversely, take any solution of the original system. It also solves the reduced system, since the row operations preserve solutions. Its free-variable entries are some real parameter values; the pivot equations then force its pivot-variable entries to be exactly those produced by the stated procedure. So the procedure includes every solution and introduces none that fail the system. \(\square\)

This result explains why a check in the original equations is valuable. It confirms that the expressions satisfy the system as originally given, rather than only appearing to satisfy an equation copied incorrectly into the reduced matrix. In the examples, each original equation was checked, not merely the final reduced equations.

Common Pitfalls

Changing a sign when solving for a pivot variable. In the first worked example, the reduced equation is \(x_1+2x_2-x_3=3\). With \(x_2=s\) and \(x_3=t\), it gives \(x_1=3-2s+t\). A tempting but incorrect expression is \(x_1=3-2s-t\). Substitution of that incorrect expression into the original first equation gives \((3-2s-t)+2s-t=3-2t\), which is not always \(3\). The correction is to add \(t\) when isolating \(x_1\): \(x_1=3-2s+t\), and then the left side is \((3-2s+t)+2s-t=3\).

Giving parameters only one value does not describe all solutions. Setting every free variable to zero can produce a valid particular solution, but it does not describe the whole family when free variables are present. For example, in the first worked example, \((3,0,0)^{\top}\) is only the choice \(s=t=0\); the parametric form includes solutions for all \(s,t\in\mathbb{R}\).

Check each equation independently. A substitution should show the left side of every original equation reducing to its stated right side. In particular, distribute coefficients across every term in a variable expression before combining constants and parameter terms. This makes sign and arithmetic errors easier to catch.

Check Your Understanding

For each system, identify the free variables, write all solutions in parametric form, and check the family in the original equations.

  1. Find all solutions of \(x_1-x_2=4,\;2x_1-2x_2=8\). How many independent parameters are needed?
  2. For \(x_1+x_2+x_3=1,\;x_1-x_2+x_3=3\), choose a parameter for each free variable and solve for the pivot variables.
  3. In the system \(x_1+2x_2=5,\;x_2+x_3=1\), which variable is free? Write the solution family and verify both equations.
  4. Explain why assigning values to free variables cannot omit a solution of the original system.
  5. A proposed family is \(x_1=2-s,\;x_2=s\) for the equation \(x_1+x_2=2\). Check it by substitution and state whether it works for every real \(s\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon