Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

System of Equations Calculator (Elimination and Substitution with Steps)

Enter the coefficients and the right-hand sides of equations (1) and (2). The system below is linked to the input fields, so you can also edit the numbers directly in it.

Decimals, negative numbers and fractions such as 3/4 can be used. A blank coefficient of x or y is treated as 1 (x means 1x), and a blank right-hand side is treated as 0. Enter 0 for any term you do not use.
Result and graph
Enter the coefficients of the two equations in the fields on the left and press "Calculate". The steps and a graph will appear here.

What you can do on this page

  • Solve a system of two linear equations, \(ax + by = c,\ dx + ey = f\), on the spot just by entering the coefficients and the right-hand sides. The calculator shows the system as you would write it by hand, and you can edit the numbers right in it
  • Choose the elimination method (match the coefficients, then add or subtract the equations) or the substitution method (rewrite one equation as \(y = \) and substitute). The steps follow the same flow as a school algebra textbook
  • Coefficients can be decimals, negative numbers or fractions such as 3/4 (for fractions and decimals, the steps start by multiplying both sides to make the coefficients whole numbers)
  • Besides a single solution, it detects no solution (parallel lines) and infinitely many solutions (the same line), and explains why. Answers are shown as fractions in lowest terms (exact values), with decimals added when they are fractions. You also get a graph of the two lines (the intersection is the solution) and a check that substitutes the solution into both equations
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
This page solves a system of two linear equations in two variables (x and y). Systems with three or more variables, or with squared terms, are not supported.

What is this calculation used for?

Finding the prices of two items (shopping and bookkeeping)

Suppose you have two receipts that show only totals: "1 coffee and 1 bagel for $5.50" and "2 coffees and 1 bagel for $9.00". Let a coffee be \(x\) dollars and a bagel \(y\) dollars. The system \(x + y = 5.5\), \(2x + y = 9\) gives a coffee at $3.50 and a bagel at $2.00.
"The single prices are not shown, but the totals of combinations are" is the most classic use of a system of equations, and it also comes up when breaking down bills and quotes in bookkeeping.

Finding where two price plans cross (phone, electricity, subscriptions)

Plan A costs $15 a month plus $5 per GB, and Plan B costs $30 a month plus $2 per GB. With the monthly bill \(y\) dollars and the data \(x\) GB, they are \(y = 5x + 15\) and \(y = 2x + 30\). Solving the system gives \(x = 5\) GB, where both bills are the same, $40.
So "if you use more than 5 GB, Plan B is cheaper". Finding the intersection of two lines, the crossover point, works the same way for comparing electricity plans or subscriptions (assuming the price grows in proportion to how much you use).

Finding how far you walked and how far you ran (commuting)

It is 1.5 miles from home to the station. You walk at 3 mph, then run at 6 mph, and arrive in 20 minutes (\(\dfrac{1}{3}\) hour). With \(x\) miles walked and \(y\) miles run, the distance equation is \(x + y = 1.5\) and the time equation is \(\dfrac{x}{3} + \dfrac{y}{6} = \dfrac{1}{3}\). Solving gives 0.5 mile walked and 1 mile run.
Whenever you have a total and a second amount decided by how the total is split (time, cost, and so on), you get a system of equations. This pattern is useful far beyond speed problems.

Mixing solutions of different strengths (cooking, manufacturing, farming)

To make 300 mL of an 8% solution by mixing a 5% solution and a 10% solution, let \(x\) mL be the 5% solution and \(y\) mL the 10% solution. The total amount gives \(x + y = 300\), and the amount of the dissolved substance gives \(0.05x + 0.1y = 24\) (8% of 300 mL is 24 mL). Solving gives 120 mL of the 5% solution and 180 mL of the 10% solution.
Diluting cleaning concentrate, mixing fertilizer, making metal alloys: this calculation is used wherever two ingredients are mixed to reach a target strength.

Finding the break-even point (shops and business)

A product sells for $8, its materials cost $5 per unit, and fixed costs such as rent are $900 a month. With \(x\) units sold per month and \(y\) dollars, the revenue equation is \(y = 8x\) and the cost equation is \(y = 5x + 900\). Their intersection is \(x = 300\) units and \(y = 2{,}400\) dollars, so 300 units a month is the line between profit and loss (the break-even point).
It is one of the first numbers to check in a business plan or when setting a price, and it is a system of equations at heart (assuming the price and the unit cost do not change with the quantity).

Formulas and graphs

A system of two linear equations and its solution
Graph
Standard notation (the usual math form)
\(ax + by\) \(=\) \(c\)
\(dx + ey\) \(=\) \(f\)
In words (symbols replaced with words)
① \(ax + by\): left side of (1) (the \(x\) term plus the \(y\) term) \(=\) ② \(c\): right side of (1)
③ \(dx + ey\): left side of (2) (the \(x\) term plus the \(y\) term) \(=\) ④ \(f\): right side of (2)
The formula in words
① The equation that \(ax + by\): left side of (1) (the \(x\) term plus the \(y\) term)
② equals \(c\): right side of (1) and the equation that
③ \(dx + ey\): left side of (2) (the \(x\) term plus the \(y\) term)
④ equals \(f\): right side of (2) must both be true at the same time. A pair \(x,\ y\) that makes both true is called the "solution"
Quick example
For (1) \(x + y = 5\) and (2) \(2x - y = 1\), the only pair that makes both true is \(x = 2,\ y = 3\)
left side of (1), \(x + y\) \(=\) right side of (1), \(5\)
left side of (2), \(2x - y\) \(=\) right side of (2), \(1\)
\(x = 2,\ y = 3\)
\(2 + 3 = 5\)
\(2 \times 2 - 3 = 1\)
Key idea
With the single equation \(x + y = 5\), there are infinitely many pairs that work: \((1,\ 4)\), \((2,\ 3)\), \((0.5,\ 4.5)\), and so on. Adding the condition that a second equation must also be true narrows the answer down to one pair. On a graph, the points that satisfy one equation form a line, and the solution of the system is the point where the two lines cross (the point of intersection). So if the two lines are parallel there is no solution, and if they lie exactly on top of each other there are infinitely many solutions.
Elimination method (match the coefficients and subtract the equations)
Standard notation (the usual math form)
\((ax + by)\) \(-\) \((ax + ey)\) \(=\) \(c - f\)
\((b - e)y\) \(=\) \(c - f\)
In words (symbols replaced with words)
① \((ax + by)\): left side of (1) \(-\) ② \((ax + ey)\): left side of (2) (\(x\) coefficient matched to (1)) \(=\) ③ \(c - f\): difference of the right sides
④ \((b - e)y\): \(x\) is gone and only \(y\) is left \(=\) \(c - f\): difference of the right sides
The formula in words
① First make the \(x\) coefficients of the two equations match. From \((ax + by)\): left side of (1)
② subtract \((ax + ey)\): left side of (2) with its \(x\) coefficient matched to (1) (subtract the right sides in the same way)
③ The right side becomes \(c - f\): difference of the right sides
④ and on the left side the \(ax\) terms cancel, leaving \((b - e)y\): \(x\) is gone and only \(y\) is left (then divide both sides by the coefficient of \(y\) to find \(y\))
Quick example
Eliminate \(y\) from (1) \(x + y = 5\) and (2) \(2x - y = 1\). The coefficients of \(y\) are \(+1\) and \(-1\) (same absolute value, opposite signs), so you can add the equations as they are
left side of (1), \(x + y\) \(+\) left side of (2), \(2x - y\) \(=\) sum of the right sides, \(5 + 1\)
\((x + y) + (2x - y) = 5 + 1\)
\(3x = 6\)
\(x = 2\)
\(y = 5 - 2 = 3\)
Key idea
Whether to subtract or add depends on the signs of the matched coefficients. If they have the same sign (such as \(+2\) and \(+2\)), subtract the equations; if they have opposite signs (such as \(+2\) and \(-2\)), add them. Either way, that variable is eliminated. If the coefficients do not match yet, multiply both sides of the equations to make them match. For example, if the \(x\) coefficients are 2 and 3, match them at the least common multiple, 6, by doing (1) × 3 and (2) × 2. "Multiply both sides by the same number" and "add or subtract left side to left side and right side to right side" are both based on the properties of equality (doing the same thing to both sides keeps them equal), so the answer does not change. You may eliminate either \(x\) or \(y\). A good tip is to eliminate the one whose coefficients are easier to match.
Substitution method (rewrite as \(y = \) and substitute)
Standard notation (the usual math form)
\(y\) \(=\) \(px + q\)
\(dx + e(px + q)\) \(=\) \(f\)
In words (symbols replaced with words)
① \(y\): from rewriting (1) \(=\) ② \(px + q\): an expression in \(x\) only
③ \(dx + e(px + q)\): left side of (2) with \(px + q\) substituted for \(y\), now in \(x\) only \(=\) ④ \(f\): right side of (2)
The formula in words
① Rewrite (1) by moving terms and dividing, so that \(y\): from rewriting (1) is written as
② \(px + q\): an expression in \(x\) only
③ Put this in place of \(y\) in (2) (substitute it), and the left side of (2) becomes \(dx + e(px + q)\): left side of (2) in \(x\) only
④ Set this equal to \(f\): right side of (2) and solve this one-variable linear equation to find \(x\). Then substitute \(x\) into \(px + q\) to find \(y\)
Quick example
For (1) \(x + y = 5\) and (2) \(2x - y = 1\), solving (1) for \(y\) gives \(y = 5 - x\). Substitute this for \(y\) in (2)
left side of (2) with \(5 - x\) for \(y\), \(2x - (5 - x)\) \(=\) right side of (2), \(1\)
\(2x - (5 - x) = 1\)
\(3x - 5 = 1\)
\(3x = 6\)
\(x = 2\)
\(y = 5 - 2 = 3\)
Key idea
You are free to choose which equation to solve and for which variable. Choosing a variable whose coefficient is 1 or \(-1\) avoids fractions and makes the work easier (this calculator chooses the same way). When you substitute, put the whole expression in parentheses. Getting the signs wrong when removing the parentheses in \(2x - (5 - x)\) is the most common mistake with the substitution method. Elimination and substitution are two routes with the same plan: "get rid of one variable to make a one-variable equation". So they always give the same answer. When one equation is already in the form \(y = \), such as \(y = 2x + 1\), substitution is the better choice.
A formula for the solution in one step, and how to spot no solution or infinitely many
Graph
Standard notation (the usual math form)
\(x\) \(=\) \(\dfrac{ce - bf}{ae - bd}\)
\(y\) \(=\) \(\dfrac{af - cd}{ae - bd}\)
In words (symbols replaced with words)
② \(x\): solution for \(x\) \(=\) ① \(\dfrac{ce - bf}{ae - bd}\): fraction made from the coefficients
④ \(y\): solution for \(y\) \(=\) ③ \(\dfrac{af - cd}{ae - bd}\): fraction made from the coefficients
The formula in words
① For the denominator, cross-multiply \(a\) with \(e\) and \(b\) with \(d\) and subtract. For the numerator, do the same with \(c\) and \(e\), \(b\) and \(f\). Working out \(\dfrac{ce - bf}{ae - bd}\): fraction made from the coefficients gives
② \(x\): solution for \(x\)
③ Keeping the same denominator and changing only the numerator to \(af - cd\), working out \(\dfrac{af - cd}{ae - bd}\): fraction made from the coefficients gives
④ \(y\): solution for \(y\)
Quick example
For (1) \(x + y = 5\) and (2) \(2x - y = 1\) (\(a = 1,\ b = 1,\ c = 5,\ d = 2,\ e = -1,\ f = 1\))
\(x\): solution for \(x\) \(=\) fraction made from the coefficients \(\dfrac{5 \times (-1) - 1 \times 1}{1 \times (-1) - 1 \times 2}\)
\(ae - bd = 1 \times (-1) - 1 \times 2 = -3\)
\(x = \dfrac{ce - bf}{ae - bd} = \dfrac{5 \times (-1) - 1 \times 1}{-3} = \dfrac{-6}{-3} = 2\)
\(y = \dfrac{af - cd}{ae - bd} = \dfrac{1 \times 1 - 5 \times 2}{-3} = \dfrac{-9}{-3} = 3\)
Key idea
If the denominator \(ae - bd\) is not 0, there is exactly one solution. This formula is called Cramer's rule. It is the result of elimination, written with the coefficient letters instead of numbers. If the denominator \(ae - bd = 0\), you cannot divide, and there is no single solution. This happens when the left sides of the two equations are proportional (the two lines have the same slope). If the right sides are in the same ratio too, the lines are the same (infinitely many solutions); if only the right sides are off, the lines are parallel (no solution). In formulas: if the numerators \(ce - bf\) and \(af - cd\) are both 0 as well, there are infinitely many solutions; otherwise there is no solution. The formula is handy for checking answers and for solving many systems at once in a spreadsheet. On a school test, though, you are usually expected to show the steps of elimination or substitution.
The basic plan for solving a system of equations is to "get rid of one variable to make a one-variable equation". The elimination method matches the coefficients and adds or subtracts the equations; the substitution method rewrites one equation as \(y = \) and substitutes it. Both give the same answer. When there is no single solution, the two lines are either parallel (no solution) or the same line (infinitely many solutions).

Symbols and terms

Symbols

\(x,\ y\) ex, why The letters for the two numbers you want to find (the unknowns). By custom, letters near the end of the alphabet, \(x,\ y,\ z\), are used for numbers we do not know yet.
\(a,\ b,\ c,\ d,\ e,\ f\) a, b, c, d, e, f Letters that stand for the coefficients and the right-hand constants (the known numbers). By custom, letters near the start of the alphabet are used for fixed numbers. On this page, (1) is \(ax + by = c\) and (2) is \(dx + ey = f\).
(1), (2) equation one, equation two Numbers given to the equations. They are used to write briefly which operation was done to which equation, as in "(1) × 2" or "(1) + (2)". Textbooks and worked solutions use them too.
\(\{\) brace The large brace on the left of a system of equations. It means "these two equations must be true at the same time", showing that they belong together as a set.
\(ae - bd\) a e minus b d The value in the denominator of the one-step formula, found by cross-multiplying the coefficients and subtracting. Whether it is 0 decides whether there is exactly one solution. In the language of matrices, it is the determinant of the matrix of coefficients.
\((x,\ y)\) the pair x, y A way of writing two values as a set. The solution of a system is a pair of \(x\) and \(y\), so it is written as an ordered pair such as \((2,\ 3)\), the same way as the coordinates of a point on a graph.

Terms

system of equations Two or more equations taken as a set, where you look for the values of the variables that make all of them true at the same time. Taught in Grade 8 and Algebra 1.
linear equation in two variables An equation with two variables in which every term is first degree (no squares and no variables multiplied together). \(x + y = 5\) is a linear equation in two variables. Its graph is a straight line.
solution The values of the variables that make the equations true. For a system, the solution is a pair of values of \(x\) and \(y\), which on a graph is the point of intersection of the two lines.
elimination method A way of solving by matching the coefficients of the two equations and then adding or subtracting them (left side to left side, right side to right side) to eliminate one variable. It is also called the addition method.
adding the equations Adding the left sides together and the right sides together, and joining the two sums with "=" to make a new equation. Subtracting the equations works the same way.
substitution method A way of solving by rewriting one equation in the form "\(y = \) (an expression in \(x\))" and substituting it for \(y\) in the other equation to eliminate one variable.
substitute To put a value or an expression in place of a letter. Substituting \(y = 5 - x\) into \(2x - y = 1\) gives \(2x - (5 - x) = 1\).
eliminate To remove one of the two variables from the equations, leaving an equation with only one variable. The elimination and substitution methods are both ways to do this.
moving a term Moving a term of an equation to the other side and changing its sign. Moving the \(3\) in \(x + 3 = 7\) gives \(x = 7 - 3\). It is a shortcut for "subtract the same number from both sides".
coefficient The number in front of a letter. In \(2x\), the coefficient is 2. When no number is written, as in \(x\), the coefficient is 1, and the coefficient of \(-y\) is \(-1\).
properties of equality An equation stays true when you add, subtract or multiply both sides by the same number, or divide both sides by the same nonzero number. It is like a balance scale that stays level when the same weight is put on both pans. Every step of elimination and substitution is based on these properties.
least common multiple (LCM) The smallest number that is a multiple of both numbers. In the elimination method it is the target when matching coefficients (for coefficients 2 and 3, match them at 6).
parallel Two lines that never meet, however far they go. In a system of equations, if the two graphs are parallel there is no intersection, so there is "no solution".
infinitely many solutions When there is not one single solution but infinitely many. This happens when the two equations describe the same line, so every point on the line is a solution. Such a system is called dependent.
point of intersection The point where two graphs cross. The solution of a system of equations is the coordinates of the point where the graphs of the two equations (two lines) cross.
check Substituting the solution into both original equations to make sure the left and right sides really are equal. A system can be checked just by substituting, so making it a habit helps you catch your own mistakes.
Cramer's rule A formula that calculates the solution directly from the coefficients: \(x = \dfrac{ce - bf}{ae - bd},\ y = \dfrac{af - cd}{ae - bd}\). It is named after the Swiss mathematician Gabriel Cramer. It is usually taught with matrices in high school or linear algebra in college, but for two variables you can check it with basic algebra.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to review these topics is the fastest way forward.

Expressions with variables (Grades 6–7)
  • Knowing that \(x\) and \(y\) stand in for numbers we do not know yet
  • Reading \(2x\) as short for "\(2 \times x\)", with 2 as its coefficient
Arithmetic with negative numbers (Grade 7)
  • Being able to multiply with the sign rules, as in \((-1) \times 3 = -3\)
  • Being able to subtract a negative number, as in \(5 - (-2) = 7\) (this comes up often when subtracting equations in the elimination method)
Properties of equality and linear equations (Grades 7–8)
  • Knowing that, like a balance scale, an equation stays true when you add, subtract, multiply or divide (by a nonzero number) both sides by the same number
  • Being able to solve a linear equation such as \(2x + 3 = 7\) by moving terms to the other side (and changing their signs)
Coordinates and graphs (Grades 6–8)
  • Being able to describe the position of a point with an ordered pair such as \((2,\ 3)\)
  • Knowing that the points that satisfy an equation such as \(y = 2x + 1\) form a straight line (used to understand no solution and infinitely many solutions on a graph)
Working with fractions (Grades 5–7)
  • Being able to find common denominators, simplify fractions, and add, subtract, multiply and divide fractions
  • Being able to multiply both sides of an equation such as \(\dfrac{1}{2}x + y = 4\) to turn the coefficients into whole numbers

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to solve the system
(1) x coefficient a 1
(1) y coefficient b 1
(1) right side c 5
(2) x coefficient d 2
(2) y coefficient e -1
(2) right side f 1
Denominator ae−bd =B1*B5-B2*B4
Solution x ((ce−bf)÷(ae−bd)) =(B3*B5-B2*B6)/B7
Solution y ((af−cd)÷(ae−bd)) =(B1*B6-B3*B4)/B7
Table to check for no solution or infinitely many solutions
(1) x coefficient a 1
(1) y coefficient b 1
(1) right side c 3
(2) x coefficient d 2
(2) y coefficient e 2
(2) right side f 6
Denominator ae−bd =B1*B5-B2*B4
Numerator ce−bf =B3*B5-B2*B6
Numerator af−cd =B1*B6-B3*B4
Result =IF(B7<>0,"One solution",IF(AND(B8=0,B9=0),"Infinitely many solutions","No solution (parallel)"))
Table to check the solution (substitute into both equations)
(1) x coefficient a 1
(1) y coefficient b 1
(1) right side c 5
(2) x coefficient d 2
(2) y coefficient e -1
(2) right side f 1
Solution x 2
Solution y 3
Left side of (1) ax+by (correct if equal to c) =B1*B7+B2*B8
Left side of (2) dx+ey (correct if equal to f) =B4*B7+B5*B8
After pasting, the upper rows (the coefficients and right sides) are your inputs and the lower rows are calculated automatically.
The first table solves x + y = 5, 2x − y = 1. The denominator ae−bd is −3, and the solution is x = 2, y = 3. If the denominator is 0, the division gives an error (#DIV/0!), which is the sign that there is no single solution.
The second table is for x + y = 3, 2x + 2y = 6, and the result is "Infinitely many solutions". Change the right side f of (2) to 10 and it becomes "No solution (parallel)".
The third table checks the solution by substituting it into both equations. The left side of (1) is 5 and the left side of (2) is 1, matching their right sides.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to solve the system
(1) x coefficient a 1
(1) y coefficient b 1
(1) right side c 5
(2) x coefficient d 2
(2) y coefficient e -1
(2) right side f 1
Denominator ae−bd =B1*B5-B2*B4
Solution x ((ce−bf)÷(ae−bd)) =(B3*B5-B2*B6)/B7
Solution y ((af−cd)÷(ae−bd)) =(B1*B6-B3*B4)/B7
Table to check for no solution or infinitely many solutions
(1) x coefficient a 1
(1) y coefficient b 1
(1) right side c 3
(2) x coefficient d 2
(2) y coefficient e 2
(2) right side f 6
Denominator ae−bd =B1*B5-B2*B4
Numerator ce−bf =B3*B5-B2*B6
Numerator af−cd =B1*B6-B3*B4
Result =IF(B7<>0,"One solution",IF(AND(B8=0,B9=0),"Infinitely many solutions","No solution (parallel)"))
Table to check the solution (substitute into both equations)
(1) x coefficient a 1
(1) y coefficient b 1
(1) right side c 5
(2) x coefficient d 2
(2) y coefficient e -1
(2) right side f 1
Solution x 2
Solution y 3
Left side of (1) ax+by (correct if equal to c) =B1*B7+B2*B8
Left side of (2) dx+ey (correct if equal to f) =B4*B7+B5*B8
The same formulas as in Excel work as is. Copy the whole table, paste it into cell A1, and replace the coefficients and right sides with your own numbers.

How to calculate it in Python

from fractions import Fraction

# (1): a1*x + b1*y = c1
# (2): a2*x + b2*y = c2  (a fraction such as 3/4 can be written Fraction(3, 4))
a1, b1, c1 = Fraction(1), Fraction(1), Fraction(5)
a2, b2, c2 = Fraction(2), Fraction(-1), Fraction(1)

denominator = a1 * b2 - a2 * b1   # denominator of the formula, ae − bd
if denominator != 0:
    x = (c1 * b2 - c2 * b1) / denominator
    y = (a1 * c2 - a2 * c1) / denominator
    print(f"Solution: x = {x}, y = {y}")
    print(f"As decimals: x = {float(x)}, y = {float(y)}")
elif c1 * b2 - c2 * b1 == 0 and a1 * c2 - a2 * c1 == 0:
    print("Infinitely many solutions (both equations describe the same line)")
else:
    print("No solution (the two lines are parallel and never meet)")
With the fractions module from the standard library, you can calculate with exact fractions and no decimal rounding errors. This example solves x + y = 5, 2x − y = 1, and running it prints "Solution: x = 2, y = 3". Change the coefficients and right sides and run it.

How to write it in LaTeX and other math languages (copy and paste)

A system of two linear equations and its solution
ax + by = c, dx + ey = f
\begin{cases} ax + by = c \\ dx + ey = f \end{cases}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mo>{</mo>
    <mtable columnalign="left">
      <mtr><mtd>
        <mi>a</mi><mi>x</mi><mo>+</mo><mi>b</mi><mi>y</mi><mo>=</mo><mi>c</mi>
      </mtd></mtr>
      <mtr><mtd>
        <mi>d</mi><mi>x</mi><mo>+</mo><mi>e</mi><mi>y</mi><mo>=</mo><mi>f</mi>
      </mtd></mtr>
    </mtable>
  </mrow>
</math>
{(ax + by = c),(dx + ey = f):}
Solve[{a*x + b*y == c, d*x + e*y == f}, {x, y}]
solve({a*x + b*y = c, d*x + e*y = f}, {x, y});
S = solve(a*x + b*y == c, d*x + e*y == f, [x, y])
ax + by = c, dx + ey = f
Elimination method (match the coefficients and subtract the equations)
(ax + by) − (ax + ey) = c − f
(ax + by) - (ax + ey) = c - f
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mo>(</mo><mi>a</mi><mi>x</mi><mo>+</mo><mi>b</mi><mi>y</mi><mo>)</mo>
    <mo>&#x2212;</mo>
    <mo>(</mo><mi>a</mi><mi>x</mi><mo>+</mo><mi>e</mi><mi>y</mi><mo>)</mo>
    <mo>=</mo>
    <mi>c</mi><mo>&#x2212;</mo><mi>f</mi>
  </mrow>
</math>
(ax + by) - (ax + ey) = c - f
Simplify[(a*x + b*y) - (a*x + e*y) == c - f]
(a*x + b*y) - (a*x + e*y) = c - f;
simplify((a*x + b*y) - (a*x + e*y) == c - f)
(ax + by) − (ax + ey) = c − f
Substitution method (rewrite as \(y = \) and substitute)
y = px + q, dx + e(px + q) = f
y = px + q,\quad dx + e(px + q) = f
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>y</mi><mo>=</mo><mi>p</mi><mi>x</mi><mo>+</mo><mi>q</mi>
    <mo>,</mo>
    <mi>d</mi><mi>x</mi><mo>+</mo><mi>e</mi>
    <mo>(</mo><mi>p</mi><mi>x</mi><mo>+</mo><mi>q</mi><mo>)</mo>
    <mo>=</mo><mi>f</mi>
  </mrow>
</math>
y = px + q, dx + e(px + q) = f
Solve[{y == p*x + q, d*x + e*y == f}, {x, y}]
subs(y = p*x + q, d*x + e*y = f);
subs(d*x + e*y == f, y, p*x + q)
y = px + q, dx + e(px + q) = f
A formula for the solution in one step, and how to spot no solution or infinitely many
x = (ce − bf)/(ae − bd), y = (af − cd)/(ae − bd)
x = \frac{ce - bf}{ae - bd},\quad y = \frac{af - cd}{ae - bd}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>x</mi><mo>=</mo>
    <mfrac>
      <mrow><mi>c</mi><mi>e</mi><mo>&#x2212;</mo><mi>b</mi><mi>f</mi></mrow>
      <mrow><mi>a</mi><mi>e</mi><mo>&#x2212;</mo><mi>b</mi><mi>d</mi></mrow>
    </mfrac>
    <mo>,</mo>
    <mi>y</mi><mo>=</mo>
    <mfrac>
      <mrow><mi>a</mi><mi>f</mi><mo>&#x2212;</mo><mi>c</mi><mi>d</mi></mrow>
      <mrow><mi>a</mi><mi>e</mi><mo>&#x2212;</mo><mi>b</mi><mi>d</mi></mrow>
    </mfrac>
  </mrow>
</math>
x = (ce - bf)/(ae - bd), y = (af - cd)/(ae - bd)
{x, y} = {(c*e - b*f)/(a*e - b*d), (a*f - c*d)/(a*e - b*d)}
x := (c*e - b*f)/(a*e - b*d); y := (a*f - c*d)/(a*e - b*d);
x = (c*e - b*f)/(a*e - b*d); y = (a*f - c*d)/(a*e - b*d);
x = (ce − bf)/(ae − bd), y = (af − cd)/(ae − bd)

How to have ChatGPT  do the calculation

You are a calculation assistant for math (systems of equations). Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

Solve the system of equations x + y = 5, 2x − y = 1.
Show each of the following:
1. The solution x, y (if they are fractions, give both fractions in lowest terms and decimals)
2. The steps with the elimination method (match the coefficients of one variable, then add or subtract the equations)
3. A check that substitutes the solution into both equations

In Python, calculate exactly with the fractions module from the standard library, and show the formulas you used and the numbers from the execution result. If there is no solution or there are infinitely many, also explain why.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.