MathorynMathematical Formula Database

Algebra

System of Two Linear Equations

For the system a1x+b1y=c1, a2x+b2y=c2a_1x+b_1y=c_1,\ a_2x+b_2y=c_2 these formulas give the unique solution whenever a1b2−a2b1≠0a_1b_2-a_2b_1\neq0. They are the 2×22\times2 case of Cramer's rule. Use it to solve two simultaneous conditions, such as mixture, pricing or intersection-of-lines problems.

x=c1b2−c2b1a1b2−a2b1,y=a1c2−a2c1a1b2−a2b1x=\frac{c_1b_2-c_2b_1}{a_1b_2-a_2b_1},\qquad y=\frac{a_1c_2-a_2c_1}{a_1b_2-a_2b_1}
LaTeXx=\frac{c_1b_2-c_2b_1}{a_1b_2-a_2b_1},\qquad y=\frac{a_1c_2-a_2c_1}{a_1b_2-a_2b_1}

Variables

a1,b1,c1a_1,b_1,c_1
coefficients and constant of the first equation
a2,b2,c2a_2,b_2,c_2
coefficients and constant of the second equation
a1b2−a2b1a_1b_2-a_2b_1
determinant of the system (nonzero)

Example

Solve 2x+y=5, x−y=12x+y=5,\ x-y=1.

  1. Determinant: 2⋅(−1)−1⋅1=−32\cdot(-1)-1\cdot1=-3.
  2. x=5⋅(−1)−1⋅1−3=−6−3x=\frac{5\cdot(-1)-1\cdot1}{-3}=\frac{-6}{-3}.
  3. y=2⋅1−1⋅5−3=−3−3y=\frac{2\cdot1-1\cdot5}{-3}=\frac{-3}{-3}.

Answer: x=2, y=1x=2,\ y=1.

Related formulas