Link Search Menu Expand Document

Linear equations

A linear equation in a set of variables x1,x2,x3,,xmx_1,x_2,x_3,\ldots,x_m is a equation of the form a1x1+a2x2++amxm=ba_1 x_1 + a_2 x_2 + \cdots + a_m x_m = b for constant numbers a1,,am,ba_1,\ldots,a_m, b.

So, for example, x1+2x23x3+4x4=5-x_1 + 2x_2 - 3x_3 + 4x_4 = 5 would be a linear equation in 4 unknowns.

Most equations you have seen are not linear. For example, xy=1.xy = 1. or ex1+x2+x3=1.e^{x_1} + x_2 + x_3 = -1.

In general, linear equations are the simplest types of mathematical equations so we better be able to handle them quickly and efficiently.

Solving a single linear equation

Say we wanted to solve the equation x1+2x23x3+4x4=5-x_1 + 2x_2 - 3x_3 + 4x_4 = 5 How would we go about doing this?

First, we need to be a bit more precise about what we mean to “solve the equation”. What we want here is often called a *parametric” representation of the solution. We want to identify some free variables that can be used to determine all the solutions explicitly.

As you might have done or seen before, this can be accomplished by “solving out” a variable using the equation. We can rewrite the equation as x1=2x23x3+4x45x_1 = 2x_2 - 3x_3 + 4x_4 - 5

Now, given any possible values of (x2,x3,x4)(x_2,x_3,x_4), we can use the new form of the equation to find a value for x1x_1 so that we solve the equation. For example, if we take (1,1,1)(1,1,1), then plug in to get x1=2131+415=2x_1 = 2 \cdot 1 - 3 \cdot 1 + 4 \cdot 1 -5 = -2 and (2,1,1,1)(-2,1,1,1) is a solution to the equation.

Great! You might think we have mastered single linear equations. To find the solution to a1x1++amxm=ba_1 x_1 + \cdots + a_m x_m = b in general, we pick some ai0a_i \neq 0 and then we can solve for xix_i as xi=bjiajaixjx_i = b - \sum_{j \neq i} \frac{a_j}{a_i} x_j

We can try another example to test our understanding. How about solving x2x4=2x_2 - x_4 = 2

One possible point of confusion is: how many variables are we using? We only see 2 in the equation but the biggest index is a 4. So are we using 2 unknowns or 4 unknowns? We will often infer the number of unknowns in the linear equation (and system) from the context. The convention we will use will be this is an equation in 4 unknowns. But, do not be afraid to ask for clarification.

Back to the example. Let us pick x4x_4 to solve out x4=x22x_4 = x_2 - 2 Then, our general (parametric) solution would look like (x1,x2,x3,x22)(x_1,x_2,x_3,x_2-2).

We might be satisfied with our understanding but there is actually one case that breaks our algorithm.

What happens if all ai=0a_i = 0 and b0b \neq 0, say b=1b = 1? Then, we are looking at an immediate problem 0=10 = 1 is not satisfiable for any values of our unknowns. In this case, there are no solutions.

This situation may seem contrived. Often in mathematics, a general understanding often hinges on properly understanding the edge cases of a problem. Linear algebra is no different. Encountering 0=10 = 1 will be a natural possibility once we have developed enough tools.

Before we turn to systems of linear equations, let’s recap some important points:


Algorithm for solving a linear equation:

We can summarize the algorithm for solving a1x1++amxm=ba_1x_1 + \cdots + a_mx_m = b described above.

Step 1

If we have an equation of the form 0=b0 = b with b0b \neq 0, then output “No Solution”.

Step 2

Otherwise, identify some xix_i with ai0a_i \neq 0 and solve for xix_i in terms of the other variables.

Dichotomy of solutions:

For a linear equation, a1x1+amxm=ba_1x_1 + \cdots a_mx_m = b, we have three possibilities

  • there can be infinitely-many solutions (if m>1m > 1 and either not all aia_i are 00 or b=0b = 0),
  • there can be a unique solution (if m=1m = 1 and either not all aia_i are 00 or b=0b = 0), or
  • there can be no solutions at all (if all aia_i are 00 and b0b \neq 0).

We will see this dichotomy continues to hold for systems of linear equations.