Linear Equation Solver

Solve linear equations with one or two variables. Enter coefficients and get exact solutions with step-by-step working.

📐 Linear Equation Solver

Equation form: ax + b = c

a (coefficient of x)
b (constant)
c (right-hand side)
3x + 7 = 22
x =

Step-by-Step Solution

🔢 What is a Linear Equation?

A linear equation is an algebraic equation in which the variables appear only to the first power (no x², x³, or square roots of x). The word "linear" comes from "line" — when graphed, a linear equation with one variable is a point on the number line, and a linear equation with two variables is a straight line on the coordinate plane.

The one-variable form is ax + b = c. To solve, isolate x by performing the same operations on both sides: subtract b from both sides to get ax = c − b, then divide by a to get x = (c − b) / a. This is valid whenever a ≠ 0. If a = 0 and b ≠ c, there is no solution (0 = c − b is false). If a = 0 and b = c, there are infinitely many solutions (0 = 0, true for all x).

A two-variable system (2×2) consists of two equations, each with two unknowns x and y. Geometrically, each equation represents a straight line. The solution is the intersection point of the two lines. Three outcomes are possible: one solution (lines intersect at exactly one point), no solution (lines are parallel — they never meet), or infinite solutions (lines are identical — every point on the line satisfies both equations).

Linear equations are the foundation of algebra and appear everywhere in science, engineering, and daily life: calculating rates (if I drive at 60 km/h for x hours, I cover 60x km), mixing problems, budget planning (your savings after x months = initial + monthly × x), and physics (distance = speed × time). Mastering linear equations is the gateway to more advanced mathematics including matrices, calculus, and linear programming.

📐 Linear Equation Formulas

One Variable: ax + b = c  ⇒  x = (c − b) ÷ a
a = coefficient of x (cannot be 0)
b = constant term on the left side
c = right-hand side value
Two Variables (Cramer's Rule):
D = a&sub1;b&sub2; − a&sub2;b&sub1;
x = (c&sub1;b&sub2; − c&sub2;b&sub1;) ÷ D     y = (a&sub1;c&sub2; − a&sub2;c&sub1;) ÷ D
D = determinant of the coefficient matrix
If D = 0: no solution (parallel lines) or infinite solutions (same line)
Equation 1: a&sub1;x + b&sub1;y = c&sub1;  ·  Equation 2: a&sub2;x + b&sub2;y = c&sub2;

📖 How to Use This Calculator

One Variable Example — 3x + 7 = 22

1
Select "One Variable" tab. Enter a = 3, b = 7, c = 22.
2
Click Solve to get x = (22 − 7) / 3 = 5, with step-by-step working.

Two Variables Example — 2x + y = 5 and x − y = 1

1
Select "Two Variables". Enter a&sub1;=2, b&sub1;=1, c&sub1;=5 for Eq.1 and a&sub2;=1, b&sub2;=−1, c&sub2;=1 for Eq.2.
2
Click Solve. The calculator uses elimination to find x = 2, y = 1.

💡 Example Calculations

Example 1 — One Variable

5x − 3 = 17

1
Add 3 to both sides: 5x = 17 + 3 = 20
2
Divide by 5: x = 20 ÷ 5 = 4
3
Check: 5(4) − 3 = 20 − 3 = 17 ✓
x = 4
Try this example →

Example 2 — Two Variables (Word Problem)

A total of ₹500 is split between two people. One gets ₹50 more than the other. How much does each get?

1
Let x = larger share, y = smaller share. Eq.1: x + y = 500. Eq.2: x − y = 50.
2
Add both equations: 2x = 550 → x = 275
3
Substitute: 275 + y = 500 → y = 225
One person gets ₹275, the other gets ₹225 (a difference of ₹50).
Try this example →

❓ Frequently Asked Questions

What is a linear equation?+
A linear equation is an algebraic equation where the highest power of the variable is 1. It graphs as a straight line when plotted. The standard form is ax + b = c for one variable, or ax + by = c and dx + ey = f for two variables (a system of linear equations). The word ‘linear’ comes from ‘line’ — these equations, when graphed, produce straight lines.
How do you solve a one-variable linear equation?+
The goal is to isolate x. Use inverse operations: if a number is added, subtract it from both sides; if multiplied, divide both sides. Example: 3x + 7 = 22 → subtract 7: 3x = 15 → divide by 3: x = 5. Check: 3(5) + 7 = 15 + 7 = 22 ✓. For ax + b = c: x = (c − b) ÷ a, provided a ≠ 0.
How do you solve a 2-variable system of linear equations?+
Two main methods: (1) Substitution — solve one equation for one variable, substitute into the second. (2) Elimination — multiply equations by constants to make one variable’s coefficients equal, then add/subtract to eliminate it. Example: x + y = 5 and 2x − y = 1. Add both: 3x = 6, x = 2. Substitute: 2 + y = 5, y = 3. Solution: (2, 3). This calculator uses Cramer’s rule (elimination with determinants) for 2-variable systems.
What does ‘no solution’ mean for a system of equations?+
A system has no solution when the two equations are parallel lines — they have the same slope but different y-intercepts, so they never intersect. This happens when the ratios of coefficients are equal but the ratio of constants is different: a&sub1;/a&sub2; = b&sub1;/b&sub2; ≠ c&sub1;/c&sub2;. For example: x + y = 3 and x + y = 5 — both lines have the same slope, but no point satisfies both simultaneously.
What does ‘infinite solutions’ mean?+
A system has infinitely many solutions when both equations represent the same line. One equation is a multiple of the other: a&sub1;/a&sub2; = b&sub1;/b&sub2; = c&sub1;/c&sub2;. For example: 2x + 4y = 8 and x + 2y = 4 are the same line. Any point on the line is a valid solution — infinitely many (x, y) pairs satisfy both equations simultaneously.
What is Cramer’s Rule?+
Cramer’s Rule solves a 2-variable system ax + by = e, cx + dy = f using determinants. The determinant D = ad − bc. x = (ed − bf) / D and y = (af − ec) / D. If D = 0, the system has either no solution or infinite solutions. Cramer’s Rule generalizes to n-variable systems but is computationally inefficient for large n — Gaussian elimination is preferred then.
What does it mean when a linear equation has no solution or infinite solutions?+
For a single-variable equation ax + b = c: if a = 0 and b ≠ c, there is no solution (e.g., 0x + 5 = 3 — impossible). If a = 0 and b = c, there are infinite solutions (e.g., 0x + 5 = 5 — true for any x). For a 2-variable system, no solution means the lines are parallel; infinite solutions mean the lines are coincident (one equation is a scalar multiple of the other).
How do I check if my solution to a linear equation is correct?+
Substitute your answer back into the original equation and verify both sides are equal. For x = 4 in 5x − 3 = 17: 5(4) − 3 = 20 − 3 = 17 ✓. For a 2-variable system, check both equations: if x = 2, y = 3 from x + y = 5 and 2x − y = 1: (2+3=5 ✓) and (4−3=1 ✓). Always verify, as arithmetic errors are easy to make.
What is the graphical interpretation of a linear equation?+
A single-variable linear equation ax + b = c represents a point on the number line (the solution x). A two-variable linear equation ax + by = c represents a straight line in the xy-plane. A 2×2 system of equations represents two lines in the plane: if they intersect, the intersection point is the unique solution; if they are parallel, there is no solution; if they coincide, there are infinitely many solutions.
What are real-world applications of linear equations?+
Linear equations model proportional relationships: distance-speed-time (d = v × t), simple interest (I = P × r × t), unit price and total cost, break-even analysis, mixture problems, wage calculations (hourly rate × hours = pay), and currency conversion. Two-variable systems model problems with two unknowns — splitting bills, age problems, and upstream-downstream problems in physics.