Your Equation

Library / Foundations: Maths / FMA-44

Foundations: Maths

Two simultaneous equations: solution for x

Value of x that satisfies two simultaneous linear equations, found with Cramer’s rule from the determinant Δ of the coefficients.

Ref
FMA-44
Rev
v1
Field
Foundations: Maths
Result
x

Cramer’s rule solves a pair of linear equations ax + by = e and cx + dy = f using determinants. With Δ = ad − bc, x = (ed − bf)/Δ and y = (af − ec)/Δ. If Δ = 0 the lines are parallel or the same, and there is no single solution.

Value of x that satisfies two simultaneous linear equations, found with Cramer’s rule from the determinant Δ of the coefficients. It fails when Δ is zero, because the two lines are then parallel or the same.

Calculator

Solve for
−1010
−1010
−1010
−1010
−5050
−5050
  • Determinant Δ = ad − bc−3
  • Solution for x2
  • Solution for y1
  • Check: a x + b y (should equal e)5
  • Check: c x + d y (should equal f)1

What drives the result

Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.

Solution for x () current value 2
aCoefficient a of x (first equation)Key driver
−1818
eRight-hand side of the first equation
−16.317
fRight-hand side of the second equation
−1518.3
cCoefficient c of x (second equation)
−99
bCoefficient b of y (first equation)
−3.55.5
dCoefficient d of y (second equation)
17
  • For 2x + 1y = 5 and 1x + (−1)y = 1, the determinant is −3 and x = 2, y = 1. Substituting back returns both right-hand sides exactly, which is the check.
  • The solution is where two straight lines cross. If the determinant were near zero the lines would be nearly parallel and a small change in any coefficient would move the crossing point a long way.
Chart data as tables

Ranked variables

VariableTypical rangeLowest resultHighest resultSwing ()Local stepChange in result
a Coefficient a of x (first equation)−10 to 10 −181836+0.4 −11.8 %
e Right-hand side of the first equation−50 to 50 −16.331733.33+2 +33.3 %
f Right-hand side of the second equation−50 to 50 −1518.3333.33+2 +33.3 %
c Coefficient c of x (second equation)−10 to 10 −9918+0.4 −11.8 %
b Coefficient b of y (first equation)−10 to 10 −3.55.59+0.4 −5.88 %
d Coefficient d of y (second equation)−10 to 10 176+0.4 −9.09 %

Sweep of Right-hand side of the first equation

Right-hand side of the first equationSolution for x
−50−16.33
−37.5−12.17
−25−8
−12.5−3.833
00.3333
12.54.5
258.667
37.512.83
5017

Sweep one variable

Solution for x ()Hover, touch, or use the arrow keys on the chart
−10010 −40−2002040 Right-hand side of the first equation now 2

Variables and how each one contributes

x

Solution for x

Result ·

What the equation gives you. Everything else feeds it.

a

Coefficient a of x (first equation)

· typical −10 to 10

The coefficient of x in the first equation, ax + by = e. Changes x through the determinant and the right-hand sides; the size and sign of the effect depend on the other coefficients, so use the swept values to see it. Raising it by 1 (to 3) moves the result by −25 %, from 2 to 1.5.

b

Coefficient b of y (first equation)

· typical −10 to 10

The coefficient of y in the first equation. Changes x through the determinant and the right-hand sides; the size and sign of the effect depend on the other coefficients, so use the swept values to see it. Raising it by 1 (to 2) moves the result by −12.5 %, from 2 to 1.75.

c

Coefficient c of x (second equation)

· typical −10 to 10

The coefficient of x in the second equation, cx + dy = f. Changes x through the determinant and the right-hand sides; the size and sign of the effect depend on the other coefficients, so use the swept values to see it. Raising it by 1 (to 2) moves the result by −25 %, from 2 to 1.5.

d

Coefficient d of y (second equation)

· typical −10 to 10

The coefficient of y in the second equation. Changes x through the determinant and the right-hand sides; the size and sign of the effect depend on the other coefficients, so use the swept values to see it. Raising it by 1 (to 0) moves the result by −50 %, from 2 to 1.

e

Right-hand side of the first equation

· typical −50 to 50

The right-hand side of the first equation. Changes x through the determinant and the right-hand sides; the size and sign of the effect depend on the other coefficients, so use the swept values to see it. Raising it by 1 (to 6) moves the result by +16.7 %, from 2 to 2.333.

f

Right-hand side of the second equation

· typical −50 to 50

The right-hand side of the second equation. Changes x through the determinant and the right-hand sides; the size and sign of the effect depend on the other coefficients, so use the swept values to see it. Raising it by 1 (to 2) moves the result by +16.7 %, from 2 to 2.333.

Worked example with the values above

  1. Determinant: Δ = ad − bc = (2)(−1) − (1)(1) = −3.
  2. Numerator for x: ed − bf = (5)(−1) − (1)(1) = −6.
  3. x = −6 / −3 = 2.

Assumptions and limits

  • The two equations are linear and consistent, with a nonzero determinant.
  • Exact arithmetic: if the determinant is very small compared with the coefficients, rounding in the inputs makes the answer very sensitive.

Common mistakes

  • Forgetting the minus sign in the determinant: Δ = ad − bc, not ad + bc.
  • Solving for x and using the same numerator for y: the numerator for y is af − ec.

Statistics and uncertainty

Errors in the coefficients are magnified by 1/Δ: if the determinant is small compared with the products ad and bc, even rounding errors in the inputs can spoil the answer. Measure or compute the coefficients to more significant figures when Δ is small.

Where it is used

  • Solving two unknown forces or currents from two equations.
  • Finding where two straight lines intersect.

Maths you need

  • Determinant: ad − bc of a two-by-two array
  • Linear equation: one with no powers of the unknowns

Related formulas

Practise this formula