Systems of Linear Equations in Two Variables: Methods and Graphs

Updated 17 min read Beginner to intermediate Baca dalam Bahasa Indonesia

Algebra Geometry Computing Python JavaScript

Quick answer

A system of two linear equations in two variables asks for the one pair (x,y) that satisfies both equations, which on a graph is the point where two lines cross. Solve it by substitution (solve one equation for a variable and put that in the other) or by elimination (add or subtract multiples of the equations so a variable cancels). The lines can cross, never meet, or coincide, giving one, no, or infinitely many solutions, and D=a_1b_2-a_2b_1 tells which.

Key takeaways

  • A system is two conditions at once: a_1x+b_1y=c_1 and a_2x+b_2y=c_2. Each equation alone has infinitely many solutions (the points of a line); the system asks for the pair that is on both lines.
  • There are exactly three outcomes: the lines cross (one solution, D\ne0), are parallel (none, D=0 and the right-hand sides do not fit), or are the same line (infinitely many, D=0 and they fit).
  • Substitution is easiest when some variable has coefficient 1 or -1; elimination works for every system and keeps the numbers whole: multiply so one variable has opposite coefficients, then add (or subtract when they are equal).
  • Elimination that ends in 0=0 means infinitely many solutions, and one that ends in 0=5 (any false statement) means none. Always check the answer in both original equations.
  • Cramer’s rule gives the answer at once when D\ne0: x=(c_1b_2-c_2b_1)/(D) and y=(a_1c_2-a_2c_1)/(D). |D| is the area of the parallelogram on the coefficient vectors, so D=0 means the lines have the same direction.
  • Lines that are almost parallel make the answer extremely sensitive: for x+y=2 and x+(1+\varepsilon)y=2+\delta the answer moves by \delta/\varepsilon. In double precision, 1+\varepsilon is exactly 1 below about 10^-16 and the solver sees D=0; exact fractions do not.

What is a system of linear equations in two variables?

A system of two linear equations in two variables is a pair of equations, a_1x+b_1y=c_1 and a_2x+b_2y=c_2, that must be true at the same time; its solution is a pair of numbers (x,y) that makes both true. "Linear" means each unknown appears only to the first power and is only multiplied by a number, so each equation is a straight line. In Indonesian schools the topic is called SPLDV, short for sistem persamaan linear dua variabel.

Take x+y=10. It has infinitely many solutions: (0,10), (4,6), (5,5), (6,4), (10,0) and every other pair that adds to 10. The equation x-y=2 also has infinitely many: (2,0), (3,1), (6,4), (8,6). Only one pair is on both lists, (6,4), and that is the solution of the system \begincases x+y=10 \ x-y=2 \endcases Check it in both equations: 6+4=10 and 6-4=2. Each equation on its own leaves one degree of freedom; the second one removes it, which is why two equations can pin down two unknowns. Writing a problem in words as such a pair is the skill of turning words into algebra.

What does the graph of a system show, and how many solutions can it have?

Each equation is a line, and the solution of the system is where the two lines meet, so a system has exactly one solution, none, or infinitely many. When b\ne0 the equation ax+by=c is the line y=(c-ax)/(b) with slope -\frac ab; when b=0 it is the vertical line x=\frac ca. Two lines in a plane can be in only three positions:

The linesSolutionsD=a_1b_2-a_2b_1Example
cross at one pointexactly oneD\ne0x+y=10 and x-y=2
are parallelnoneD=0, right-hand sides do not fit2x+3y=6 and 4x+6y=18
are the same lineinfinitely manyD=0, right-hand sides fitx+2y=4 and 3x+6y=12

The number D decides because two lines are parallel exactly when their slopes are equal: -(a_1)/(b_1)=-(a_2)/(b_2), which after cross-multiplying is a_1b_2=a_2b_1, that is D=0. When D=0 the lines are either on top of each other or apart, and the right-hand sides tell which: if c_2 is the same multiple of c_1 that the other numbers are, the second equation is the first one in disguise.

A school shortcut compares ratios: one solution if (a_1)/(a_2)\ne(b_1)/(b_2), none if (a_1)/(a_2)=(b_1)/(b_2)\ne(c_1)/(c_2), infinitely many if all three ratios are equal. It breaks when a coefficient is 0 (you cannot divide by it), and D never does. Type any two equations below and watch the lines.

Interactive: two lines, one system

Type two linear equations and watch their lines: they cross at one point, never meet, or are the same line, with the exact crossing point and the determinants D, Dx and Dy that decide which.

The two equations $x+y=10$ and $x-y=2$ are two lines. They cross at one point, $(6,4)$, and that point is the only pair that lies on both lines: $6+4=10$ and $6-4=2$.
The lines $2x+3y=6$ and $4x+6y=18$ have the same slope, $-\frac23$, and different heights where they cross the $y$-axis ($2$ and $3$). They are parallel, so no point lies on both and the system has no solution.
The equations $x+2y=4$ and $3x+6y=12$ are the same equation, the second being the first multiplied by $3$. Their lines lie on top of each other (one is drawn dashed), so every point on the line, such as $(4,0)$, $(2,1)$ or $(0,2)$, is a solution: infinitely many.

How do you solve a system by substitution?

To solve by substitution, solve one equation for one variable, put that expression in the other equation, solve the resulting one-variable equation, and go back for the other variable. Take \begincases 2x-y=1 \ 3x+2y=12 \endcases 1. Solve the first equation for y, which has coefficient -1: y=2x-1. 2. Put that in for y in the other equation: 3x+2(2x-1)=12. 3. Expand and combine like terms (see the rules): 3x+4x-2=12, so 7x=14 and x=2. 4. Go back: y=2·2-1=3.

The solution is (2,3). Check both equations: 2·2-3=1 and 3·2+2·3=12. Two things go wrong most often. Substituting into the same equation you took the expression from only gives 0=0 or x=x, since it is the same fact twice. And a missing bracket around the substituted expression changes the sum: it is 2(2x-1), not 2·2x-1.

Substitution is at its best when a variable has coefficient 1 or -1, as here. If every coefficient is bigger, isolating a variable creates fractions: in 2x+3y=12 and 3x-2y=5, solving the first for x gives x=6-\frac32y, and the work is easier by elimination, next.

How do you solve a system by elimination?

To solve by elimination, multiply the equations so one variable has coefficients of the same size, then add the equations if the coefficients have opposite signs (or subtract them if the signs are equal), so that variable cancels. You may add equations because adding equal things to both sides of a true statement keeps it true.

The easy case first, x+y=10 and x-y=2: the y-coefficients are already opposite, so adding gives 2x=12, x=6, and the first equation gives y=4.

When no variable cancels at once, scale the equations. For \begincases 2x+3y=12 \ 3x-2y=5 \endcases make the y-coefficients 6 and -6: multiply the first equation by 2 and the second by 3. \begincases 4x+6y=24 \ 9x-6y=15 \endcases Adding cancels y: 13x=39, so x=3. Put x=3 in the first original equation: 6+3y=12, so y=2. Check the second: 3·3-2·2=5. The multipliers come from the least common multiple of the two coefficients, here 6 (see the LCM); use the smallest ones, so the numbers stay small. Eliminating x instead works just as well: multiply by 3 and 2 and subtract.

Two cautions. Multiply every term of an equation, both sides included. And when you subtract an equation, change the sign of every term in it, not only the first. Try your own system, with the steps written out, below: any of the three methods, exact fractions throughout.

Interactive: solve it step by step

Type a system and see it solved by elimination, by substitution or by Cramer’s rule, every step written out with exact fractions, including the systems that cancel to 0 = 0 or to 0 = 5.

What happens when a system has no solution or infinitely many?

When elimination makes every variable disappear, what is left is a statement with no unknowns: if it is true (0=0) the system has infinitely many solutions, and if it is false (0=-4) it has none. Nothing has gone wrong; the algebra is reporting the geometry.

No solution. For 2x+4y=10 and x+2y=7, multiply the second by 2 to get 2x+4y=14 and subtract it from the first: 0=-4. That is false for every x and y, so no pair satisfies both: the lines are parallel. The left sides match (one is twice the other) but the right sides do not.

Infinitely many solutions. For x+2y=4 and 3x+6y=12, multiply the first by 3 to get 3x+6y=12 and subtract the second: 0=0. That is always true, so the second equation told us nothing new: it is the first one in disguise, and every point of the line x+2y=4 is a solution. They can be listed by choosing y=t freely: x=4-2t, y=t, giving (4,0) for t=0, (2,1) for t=1, (0,2) for t=2, and so on.

Do not mix the two up: 0=0 is true, so there are many solutions; 0=5 is false, so there are none. The same happens with substitution, where the one-variable equation turns into 0=0 or 0=5 instead of 7x=14. Both of these systems are in the widget above; type them to see the working.

What is Cramer’s rule for two equations, and why does the determinant decide?

Cramer’s rule says that when D=a_1b_2-a_2b_1\ne0, the solution is x=(D_x)/(D) and y=(D_y)/(D), with D_x=c_1b_2-c_2b_1 and D_y=a_1c_2-a_2c_1. It is elimination done once for every system. To eliminate y from a_1x+b_1y=c_1 and a_2x+b_2y=c_2, multiply the first by b_2 and the second by b_1 and subtract: (a_1b_2-a_2b_1) x=c_1b_2-c_2b_1. To eliminate x, multiply by a_2 and a_1 and subtract the other way: (a_1b_2-a_2b_1) y=a_1c_2-a_2c_1. Both equations have the same coefficient D in front, so if D\ne0 you divide and are done; if D=0 you cannot divide, and that is exactly the parallel or coincident case.

For 2x+3y=12 and 3x-2y=5: D=2·(-2)-3·3=-13, D_x=12·(-2)-5·3=-39, D_y=2·5-3·12=-26. So x=(-39)/(-13)=3 and y=(-26)/(-13)=2, as before.

There is a picture behind D. Take the coefficients of each equation as a vector, n_1=(a_1,b_1) and n_2=(a_2,b_2) (each is perpendicular to its line). Then |D| is the area of the parallelogram they span. If the two lines have the same direction, n_1 and n_2 are parallel, the parallelogram is flat, and D=0.

For $2x+3y=12$ and $3x-2y=5$, the coefficients make the vectors $n_1=(2,3)$ and $n_2=(3,-2)$. The parallelogram on them has area $|2\cdot(-2)-3\cdot3|=13$, which is $|D|$. If the two vectors pointed the same way the parallelogram would be flat, the area $0$, and the lines would have the same direction.

How do you solve a word problem with two unknowns?

Solve a word problem with two unknowns in five steps: name the two unknowns with their units, write one equation for each fact, solve the system, check the answer against the words of the problem, and answer in a sentence. The equations are the hard part; the solving is the same as above.

Tickets. Two adult tickets and three child tickets cost 60 in all, and one adult ticket and two child tickets cost35. Let x be the price of an adult ticket and y that of a child ticket, in dollars: \begincases 2x+3y=60 \ x+2y=35 \endcases Multiply the second by 2 to get 2x+4y=70, subtract the first: y=10. Then x=35-2·10=15. An adult ticket costs 15 and a child ticket10. Check in words: 2·15+3·10=60 and 15+2·10=35.

Ages. A father and his son are 40 years old together, and the father is three times as old as the son. With x the father’s age and y the son’s: x+y=40 and x=3y. This is made for substitution: 3y+y=40, so y=10 and x=30.

A boat on a river. A boat goes 18 km/h with the current and 12 km/h against it. If x is the speed of the boat in still water and y the speed of the current, then x+y=18 and x-y=12. Adding gives 2x=30, so the boat does 15 km/h and the current is 3 km/h.

The most common slip is writing both equations about the same fact. Each equation should use a different piece of information; if the second could be got from the first, you will meet 0=0. And always check against the story: an age of -3 or a price of 0.5 people may be a clue that an equation was set up wrongly.

Which method should you choose for a system of equations?

Use substitution when a variable has coefficient 1 or -1, elimination when the coefficients are larger, Cramer’s rule when you want a formula or a program, and the graph to see the three outcomes. All four give the same answer.

MethodBest whenWatch out
Graphyou want to see how many solutions there arereading ((31)/(11),\frac511) off a grid is guesswork
Substitutionone variable has coefficient 1 or -1fractions appear if you isolate a bigger coefficient
Eliminationthe coefficients are bigger, or the system is largemultiply every term; subtract all of the signs
Cramer’s rulewriting a formula or a programD=0 means no formula: test it exactly

For three or more unknowns, elimination is the one that grows into Gaussian elimination, the method behind every serious linear solver, and Cramer’s rule becomes very slow. The square roots, fractions and decimals that can appear in the answers are handled the usual way: leave the exact fraction as long as you can (fractions) and round only at the end.

Why do nearly parallel lines make a computer give the wrong answer?

When two lines are nearly parallel, a tiny change in one number moves their crossing point a long way, so the system is ill-conditioned and a computer, which stores numbers with tiny errors, can return a badly wrong answer or none at all. Take \begincases x+y=2 \ x+(1+\varepsilon) y=2+\delta \endcases with \varepsilon small. Subtract the first from the second: \varepsilon y=\delta, so y=(\delta)/(\varepsilon) and x=2-\frac\delta\varepsilon. With \delta=0 the answer is (2,0). With \varepsilon=10^-6 and a nudge of only \delta=10^-9 in one right-hand side, y becomes 10^-3: a change in the ninth decimal place of one number appears in the third of the answer. The amplification is \frac1\varepsilon and the condition number of the coefficients, which measures how much any change can be magnified, is about \frac4\varepsilon.

A computer adds a second problem. D=a_1b_2-a_2b_1 subtracts two products that are nearly equal, which is cancellation, and in double precision 1+\varepsilon is exactly 1 once \varepsilon is below about 10^-16: both equations look identical, D comes out exactly 0, and a solver reports "singular" or divides by zero. Move the sliders below to see the exact answer, the double-precision answer, and where the computer gives up.

What helps: for a system you build by hand from whole numbers or fractions, use exact arithmetic (Python’s Fraction never loses the \varepsilon); never test D == 0 on numbers that came from measurements, compare with a tolerance; and for real data use a solver that pivots and report the residual and the condition number, remembering that a tiny residual does not prove a small error when the condition number is huge.

Interactive: almost parallel lines

Two lines at a tiny angle: nudge one right-hand side by a hair and the crossing point jumps, and below about 10⁻¹⁶ double precision cannot tell the lines apart at all, while exact fractions can.

How do you solve a system of equations in a program?

A program solves a two-variable system with Cramer’s rule in a few lines: compute D, divide when it is not zero, and otherwise decide between "no solution" and "infinitely many" from the right-hand sides. For whole numbers do everything in integers and fractions, so that (31)/(11) stays exact. The three programs below print the same four systems from this article, the last two being parallel and the same line, and then show the nearly parallel trap: 1·(1+10^-16)-1·1 is exactly 0 in double precision, while Python’s exact fractions still find the answer (1,1).

Python: exact Cramer’s rule with Fraction
from fractions import Fraction


def solve2(a1, b1, c1, a2, b2, c2):
    """a1 x + b1 y = c1 and a2 x + b2 y = c2, exactly. Each equation must contain x or y."""
    a1, b1, c1, a2, b2, c2 = (Fraction(v) for v in (a1, b1, c1, a2, b2, c2))
    D = a1 * b2 - a2 * b1
    if D != 0:
        return 'one', (c1 * b2 - c2 * b1) / D, (a1 * c2 - a2 * c1) / D
    # D = 0: the lines have the same direction; they are one line when the right-hand sides fit as well
    if a1 * c2 == a2 * c1 and b1 * c2 == b2 * c1:
        return 'line', None, None
    return 'none', None, None


def describe(*system):
    kind, x, y = solve2(*system)
    if kind == 'one':
        return f'x = {x}; y = {y}'
    return 'infinitely many solutions' if kind == 'line' else 'no solution'


print(describe(1, 1, 10, 1, -1, 2))     # x = 6; y = 4
print(describe(2, 3, 7, 1, -4, 1))      # x = 31/11; y = 5/11
print(describe(2, 3, 6, 4, 6, 18))      # no solution
print(describe(1, 2, 4, 3, 6, 12))      # infinitely many solutions

# nearly parallel lines: x + y = 2 and x + (1 + e) y = 2 + e, whose exact answer is (1, 1)
e = 1e-16
print(1 * (1 + e) - 1 * 1)              # 0.0: in doubles the two equations are the same
tiny = Fraction(1, 10**16)
print(describe(1, 1, 2, 1, 1 + tiny, 2 + tiny))   # x = 1; y = 1
JavaScript: the same with whole numbers
const gcd = (a, b) => (b === 0 ? Math.abs(a) : gcd(b, a % b))

// n / d in lowest terms, as text
const frac = (n, d) => {
  const g = gcd(n, d) * Math.sign(d)
  return `${n / g}${d / g === 1 ? '' : '/' + d / g}`
}

function solve2(a1, b1, c1, a2, b2, c2) {
  const D = a1 * b2 - a2 * b1
  if (D !== 0) return `x = ${frac(c1 * b2 - c2 * b1, D)}; y = ${frac(a1 * c2 - a2 * c1, D)}`
  // D = 0: one line when the right-hand sides fit as well, else parallel
  const same = a1 * c2 === a2 * c1 && b1 * c2 === b2 * c1
  return same ? 'infinitely many solutions' : 'no solution'
}

solve2(1, 1, 10, 1, -1, 2)   // 'x = 6; y = 4'
solve2(2, 3, 7, 1, -4, 1)    // 'x = 31/11; y = 5/11'
solve2(2, 3, 6, 4, 6, 18)    // 'no solution'
solve2(1, 2, 4, 3, 6, 12)    // 'infinitely many solutions'

// nearly parallel lines: in doubles, 1 + 1e-16 is exactly 1
const e = 1e-16
1 * (1 + e) - 1 * 1          // 0
C++: the same with integers and printf
#include <iostream>
#include <cstdio>
using namespace std;

int gcd(int a, int b) { return b == 0 ? (a < 0 ? -a : a) : gcd(b, a % b); }

// prints n / d in lowest terms
void printFraction(int n, int d) {
  int g = gcd(n, d);
  if (d < 0) g = -g;
  n = n / g;
  d = d / g;
  if (d == 1) printf("%d", n);
  else printf("%d/%d", n, d);
}

void solve2(int a1, int b1, int c1, int a2, int b2, int c2) {
  int D = a1 * b2 - a2 * b1;
  if (D != 0) {
    printf("x = ");
    printFraction(c1 * b2 - c2 * b1, D);
    printf("; y = ");
    printFraction(a1 * c2 - a2 * c1, D);
    printf("\n");
  } else if (a1 * c2 == a2 * c1 && b1 * c2 == b2 * c1) {
    printf("infinitely many solutions\n");
  } else {
    printf("no solution\n");
  }
}

int main() {
  solve2(1, 1, 10, 1, -1, 2);
  solve2(2, 3, 7, 1, -4, 1);
  solve2(2, 3, 6, 4, 6, 18);
  solve2(1, 2, 4, 3, 6, 12);
  double e = 1e-16;
  printf("%.1f\n", 1 * (1 + e) - 1 * 1);
  return 0;
}

/* output:
x = 6; y = 4
x = 31/11; y = 5/11
no solution
infinitely many solutions
0.0
*/

Where do systems of equations come from?

Systems of linear equations are among the oldest problems in mathematics, and the method of elimination is older than the notation we use for it.

  • From about 1800 BCE. Clay tablets from Babylon pose problems that amount to two linear equations in two unknowns, such as two fields whose areas and combined yield are known, and solve them with rules that come to elimination.
  • By the 1st century CE. The Chinese Nine Chapters on the Mathematical Art devotes its eighth chapter, fangcheng ("rectangular arrays"), to systems of several equations, solved by an elimination procedure on arrays of numbers laid out with counting rods, the same steps as Gaussian elimination.
  • 1557. Robert Recorde writes the first equals sign, =, "bicause noe 2 thynges can be moare equalle" than two parallel lines of the same length.
  • 1707 and 1750. Newton’s lectures, published in 1707, describe elimination for several unknowns, and Gabriel Cramer publishes, in 1750, the determinant rule that carries his name (Colin Maclaurin had found it for two and three unknowns a little earlier).
  • Early 19th century. Gauss uses the systematic elimination for his least-squares calculations, which is why it is called Gaussian elimination; it is the ancestor of the solvers in every numerical library today.

What are the common mistakes with systems of equations?

The most common mistakes with systems of equations are the nine below, each with the correct statement.

MistakeCorrect
❌ Substitute the expression into the same equation it came fromThat gives 0=0 or x=x: put it into the other equation.
❌ Multiply only one term, or one side, when scaling an equationMultiply every term on both sides, or the equation is no longer the same one.
❌ Add when the coefficients have the same sign and expect it to cancelOpposite signs: add. Equal signs: subtract. Check that the variable is gone.
❌ (3x+2y)-(x-y)=2x+ySubtracting changes every sign: (3x+2y)-(x-y)=2x+3y.
❌ Find x and stopA solution is a pair: go back for the other variable.
❌ Check the answer in one equation onlyCheck both: (0,10) fits x+y=10 but not x-y=2.
❌ 0=0 means no solution, 0=5 means infinitely manyThe other way round: 0=0 is true (infinitely many); 0=5 is false (none).
❌ The answer must be whole numbersIt often is not: 2x+3y=7 and x-4y=1 give ((31)/(11),\frac511).
❌ Test D==0 on floating-point numbersRounding hides or invents zeros: use exact numbers, or compare with a tolerance.

Practice: test your understanding

These questions mix everything above. A wrong answer costs nothing here: read the hint and try again.

True or false?

Decide whether each statement is True or False.

  • A system of two linear equations can have exactly two solutions.
  • If elimination ends in 0=0, the system has infinitely many solutions.
  • If elimination ends in 0=7, the lines are parallel and there is no solution.
  • The solution of a system is the point where the two lines cross.
  • When D\ne0 the system has exactly one solution.
  • The solution of a system always has whole numbers for x and y.

Add the equations

Solve x+y=7 and x-y=1.

Substitution

Solve 3x-y=5 and x+2y=4.

How many solutions?

How many solutions does 2x + 4y = 6 and 3x + 6y = 8 have?

  • none
  • exactly one
  • exactly two
  • infinitely many

Another system

How many solutions does x − 2y = 3 and 2x − 4y = 6 have?

  • none
  • exactly one
  • exactly two
  • infinitely many

A price

Three markers and two notebooks cost 27 together; one marker and four notebooks cost29. How much does one notebook cost, in dollars?

Ages

A father and his son are 50 years old together, and the father is four times as old as the son. How old is the son?

The determinant

Find D=a_1b_2-a_2b_1 for 2x+3y=12 and 3x-2y=5.

Which have exactly one solution?

Which of these systems has exactly one solution? Choose all that apply.

  • x+y=3 and x-y=1
  • 2x+y=4 and 4x+2y=8
  • x-y=2 and 2x-2y=5
  • 3x+2y=7 and x-y=1

Order the elimination

Put the steps of solving a system by elimination in order.

Fill in the working

Add the equations 2x + y = 8 and x − y = 1 to eliminate y, and complete the working.

Which is right?

Elimination of x from two equations leaves 0 = 5. What does that tell you?

  • the lines are parallel: no solution
  • the lines are the same: infinitely many solutions
  • x = 5
  • the lines cross at the origin

Summary: systems of linear equations at a glance

  • System: a_1x+b_1y=c_1 and a_2x+b_2y=c_2 at once; the solution is the pair (x,y) on both lines.
  • Three outcomes: cross (one solution, D\ne0), parallel (none), same line (infinitely many); for the last two D=0.
  • Substitution: isolate a variable (best with coefficient ±1), put it in the other equation, solve, go back.
  • Elimination: scale so a variable has opposite coefficients, add (subtract if equal), solve, go back; 0=0 means infinitely many, 0=5 means none.
  • Cramer: x=(c_1b_2-c_2b_1)/(D), y=(a_1c_2-a_2c_1)/(D); |D| is the area on the coefficient vectors.
  • Word problems: name the unknowns, one equation per fact, solve, check in the story, answer in a sentence.
  • Numerics: nearly parallel lines amplify errors by about \frac1\varepsilon; double precision sees D=0 below 10^-16; use exact fractions for exact data.

Glossary: key terms

System of linear equations
Two or more linear equations that must all be true at once; with two unknowns, two lines.
Solution of a system
The pair of numbers x and y that makes every equation of the system true; the point where the lines meet.
Substitution
Solving one equation for a variable and putting that expression into the other equation.
Elimination
Adding or subtracting multiples of the equations so that one variable cancels.
Determinant of a 2 by 2 system
The number a1 b2 minus a2 b1; the system has exactly one solution when it is not zero.
Cramer’s rule
The formulas x equals Dx over D and y equals Dy over D that solve a system when D is not zero.
Parallel lines
Lines with the same slope that never meet; a system of two of them has no solution.
Coincident lines
Two equations describing the same line; every point of it is a solution.
Ill-conditioned system
A system whose answer changes a lot when the numbers change a little, as with nearly parallel lines.
Condition number
A number that says how many times a change in the data can be magnified in the answer; it is large for nearly parallel lines.

Frequently asked questions

What is a system of linear equations in two variables?

It is two linear equations, a1 x plus b1 y equals c1 and a2 x plus b2 y equals c2, that must hold at the same time. Its solution is the pair x and y that satisfies both, which on a graph is the point where the two lines cross.

How do you solve a system of equations by substitution?

Solve one equation for one variable, put that expression into the other equation, solve the equation that now has one variable, and substitute back to get the other. Then check the pair in both original equations.

How do you solve a system of equations by elimination?

Multiply the equations so one variable has coefficients of the same size, then add them if the signs are opposite or subtract them if equal, so that variable cancels. Solve for the other, then go back for the first.

How can you tell whether a system has no solution or infinitely many?

Look at D, a1 b2 minus a2 b1. If D is not zero there is one solution. If D is zero the lines have the same direction: they are the same line, with infinitely many solutions, when the right sides fit too, and parallel, with none, when they do not.

What does the solution of a system mean on a graph?

Each equation is a line, and every point of a line satisfies its equation. The solution of the system is therefore the point that lies on both lines, their intersection. Parallel lines have none, and identical lines share all their points.

What is Cramer’s rule for two equations?

When D, a1 b2 minus a2 b1, is not zero, x equals Dx over D and y equals Dy over D, where Dx is c1 b2 minus c2 b1 and Dy is a1 c2 minus a2 c1. It is elimination carried out once for every system.

How do you solve a word problem with two unknowns?

Name the two unknowns with their units, write one equation for each different fact in the problem, solve the system by substitution or elimination, and check the answer against the story before answering in a sentence.

Why do nearly parallel lines make a computer solver unreliable?

Their crossing point moves a long way when a number changes slightly, so tiny rounding errors are magnified, and in double precision two very close slopes can become identical, giving a determinant of exactly zero. Exact fractions avoid this for exact data.

References

  1. James Stewart, Lothar Redlin, Saleem Watson (2016). Precalculus: Mathematics for Calculus (chapters on systems of equations). Cengage Learning.
  2. Gilbert Strang (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press.
  3. Shen Kangshen, John N. Crossley, Anthony W.-C. Lun (1999). The Nine Chapters on the Mathematical Art: Companion and Commentary. Oxford University Press.
  4. Carl B. Boyer, Uta C. Merzbach (2011). A History of Mathematics (3rd ed.). Wiley.
  5. Gabriel Cramer (1750). Introduction à l’analyse des lignes courbes algébriques. Frères Cramer et Cl. Philibert.
  6. Lloyd N. Trefethen, David Bau III (1997). Numerical Linear Algebra. SIAM.
  7. Nicholas J. Higham (2002). Accuracy and Stability of Numerical Algorithms (2nd ed.). SIAM.