Linear Equation Solver

1 Variable · 2×2 Systems · 3×3 Systems · Fractions

Solve linear equations step by step — single variable, simultaneous 2-variable and 3-variable systems. Includes substitution, elimination, Cramer's rule, Gaussian elimination, and graph.

Quick Examples

Equation: ax + b = c

Solves: ax + b = c → x = (c − b) / a

What Is a Linear Equation?

A linear equation is an algebraic equation where each term is either a constant or the product of a constant and a single variable raised to the first power. The graph of a linear equation in two variables is always a straight line, which is why these equations are called "linear." Linear equations are fundamental to algebra, calculus, physics, economics, and virtually every quantitative field.

The general form of a single-variable linear equation is ax + b = c, where a, b, and c are constants and x is the unknown. For two variables: a₁x + b₁y = c₁. For three variables: ax + by + cz = d. When multiple linear equations are solved simultaneously, the collection is called a system of linear equations.

Types of Linear Equation Systems

1. Consistent System (Unique Solution)

A system has exactly one solution when the determinant of the coefficient matrix is non-zero. Two lines in a 2×2 system intersect at exactly one point. This is the most common case and yields a specific numerical answer for each variable.

2. Inconsistent System (No Solution)

A system has no solution when the equations represent parallel lines (in 2D) or parallel planes (in 3D) that never intersect. The coefficient determinant equals zero but at least one equation is contradictory. Example: x + y = 3 and x + y = 5 have no solution.

3. Dependent System (Infinitely Many Solutions)

A system has infinitely many solutions when one or more equations are multiples of another, representing the same geometric object. The coefficient determinant is zero and all equations are consistent, leaving one or more free variables.

Solution Methods for 2×2 Systems

Substitution Method

In the substitution method, isolate one variable from one equation and substitute the expression into the other equation. This reduces the system to a single equation in one variable, which is solved directly. Then back-substitute to find the other variable. Substitution works best when one equation has a coefficient of 1 on one variable.

Elimination Method

The elimination method multiplies equations by constants so that when the equations are added (or subtracted), one variable is eliminated. This is also called the addition method. Elimination is efficient when coefficients are small integers and can be easily scaled to cancel a variable.

Cramer's Rule

Cramer's Rule uses determinants to solve systems of linear equations directly. For the 2×2 system a₁x + b₁y = c₁ and a₂x + b₂y = c₂, the solutions are:

VariableFormulaDeterminant
D (coefficient det.)a₁b₂ − b₁a₂|a₁ b₁ / a₂ b₂|
xD𝑥 / D|c₁ b₁ / c₂ b₂|
yD𝑦 / D|a₁ c₁ / a₂ c₂|

When D = 0, the system is either inconsistent (no solution) or dependent (infinitely many solutions). Cramer's Rule extends naturally to 3×3 and larger systems using 3×3 determinants.

Gaussian Elimination for 3×3 Systems

Gaussian elimination (also called row reduction) converts the augmented matrix of a system into row echelon form using three elementary row operations: (1) swapping two rows, (2) multiplying a row by a non-zero scalar, and (3) adding a multiple of one row to another. Once in echelon form, back-substitution yields the solution from bottom to top.

For a 3×3 system, Gaussian elimination first creates zeros below the leading entry in column 1 (the pivot), then creates zeros below the pivot in column 2, yielding an upper triangular matrix. Back-substitution then solves for z from the third row, then y from the second, then x from the first.

Solving Equations with Fractions

Linear equations containing fractional coefficients such as x/3 + 2 = x/5 − 1 are solved by first finding the Least Common Denominator (LCD) of all denominators. Multiplying every term on both sides by the LCD eliminates all fractions and produces an equivalent integer-coefficient equation. For the example above, LCD = 15 gives 5x + 30 = 3x − 15, yielding x = −22.5.

Real-World Applications

  • Break-even Analysis: Set revenue = cost (both linear functions of quantity) and solve for the break-even quantity.
  • Mixture Problems: Two substances combined in unknown quantities but known total — set up two equations (quantity and concentration) and solve the 2×2 system.
  • Circuit Analysis (Kirchhoff's Laws): Each loop or node produces a linear equation in unknown currents; solve the resulting system for all branch currents.
  • Supply and Demand Equilibrium: Supply and demand are linear functions of price; set equal and solve for equilibrium price and quantity.
  • Distance, Rate, Time Problems: Two travelers moving at different speeds produce simultaneous linear equations in time and distance.
  • Age Word Problems: Present and future ages of two people expressed as two linear equations with two unknowns.

Frequently Asked Questions

What is a linear equation?
A linear equation is an algebraic equation where every variable appears to the first power only (no x², no xy), and the graph is a straight line. Single-variable form: ax + b = c. Two-variable form: ax + by = c. Linear equations are the simplest and most widely applied equations in mathematics.
How do you solve a system of two linear equations?
A 2×2 system can be solved by three main methods: (1) Substitution — isolate one variable and substitute into the second equation; (2) Elimination — scale equations and add/subtract to cancel one variable; (3) Cramer's Rule — compute x = Dx/D and y = Dy/D using 2×2 determinants. All three methods give the same answer.
What is Cramer's Rule?
Cramer's Rule expresses the solution of a linear system as a ratio of determinants. For a 2×2 system, x = (c₁b₂ − c₂b₁) / (a₁b₂ − a₂b₁) and y = (a₁c₂ − a₂c₁) / (a₁b₂ − a₂b₁). If the denominator D = 0, the system either has no solution or infinitely many solutions.
What is Gaussian elimination?
Gaussian elimination transforms the augmented coefficient matrix into upper triangular (row echelon) form using elementary row operations: row swap, scalar multiplication, and adding a multiple of one row to another. Back-substitution then yields the solution. It is the standard algorithm for solving 3×3 and larger systems of linear equations.
When does a system of equations have no solution?
A system has no solution when the equations are contradictory — they represent parallel lines (or planes) that never intersect. Algebraically, the coefficient determinant D = 0 but at least one variable determinant is non-zero. In Gaussian elimination, a row of zeros on the left but a non-zero constant on the right (e.g., 0x + 0y = 5) signals no solution.
When does a system have infinitely many solutions?
A system has infinitely many solutions when the equations are multiples of each other (dependent), representing the same line or plane. Every point on that line/plane satisfies all equations. In Gaussian elimination this shows as a complete row of zeros including the right-hand side [0 0 0 | 0], leaving one or more free variables that can take any value.
How do you solve linear equations with fractions?
Find the Least Common Denominator (LCD) of all fractional coefficients in the equation. Multiply every term on both sides by the LCD to clear all fractions, then solve the resulting integer equation normally. For example: x/3 + 2 = x/5 − 1. LCD = 15. Multiply through: 5x + 30 = 3x − 15. Simplify: 2x = −45. So x = −22.5.