In short
A linear equation in two variables has the form ax + by + c = 0, where a and b are not both zero. Unlike a one-variable linear equation — which has a single number as its solution — a two-variable equation has infinitely many solutions, each an ordered pair (x, y). When you plot all these pairs on the coordinate plane, they form a straight line. Finding two points is enough to draw the line, and the x-intercept and y-intercept are the two easiest points to find. The intercept form \frac{x}{a} + \frac{y}{b} = 1 names a line directly by where it crosses the axes.
A mobile recharge shop sells ₹100 recharges and ₹200 recharges. At the end of the day, the total collection is ₹1,000. If x is the number of ₹100 recharges and y is the number of ₹200 recharges, then
or, after dividing by 100,
Is the answer x = 4, y = 3? Check: 4 + 6 = 10. Yes. But x = 6, y = 2 also works: 6 + 4 = 10. And x = 0, y = 5: 0 + 10 = 10. There are many valid combinations. Each one is an ordered pair (x, y) that satisfies the equation, and all of them together trace a line on the plane.
This is the fundamental shift from one variable to two. A one-variable linear equation pins down a single number. A two-variable linear equation pins down a relationship between two numbers — infinitely many pairs are valid, and the line is the picture of that relationship.
The general form
Linear equation in two variables
An equation that can be written as
where a, b, c are real constants and a, b are not both zero, is called a linear equation in two variables. Every solution is an ordered pair (x, y) such that a \cdot x + b \cdot y + c = 0.
The condition "not both zero" prevents the equation from collapsing. If a = 0 and b = 0, the equation becomes c = 0, which is either always true or never true — neither describes a relationship between x and y.
If only a = 0 (and b \neq 0), the equation becomes by + c = 0, so y = -c/b — a horizontal line. If only b = 0 (and a \neq 0), it becomes ax + c = 0, so x = -c/a — a vertical line. Both are legitimate linear equations in two variables, even though one of the variables has dropped out.
Ordered pairs as solutions
An ordered pair (x, y) is a solution of the equation ax + by + c = 0 if substituting those values into the equation makes it true.
Take 2x + 3y = 12.
- Is (3, 2) a solution? 2(3) + 3(2) = 6 + 6 = 12. Yes.
- Is (0, 4) a solution? 2(0) + 3(4) = 0 + 12 = 12. Yes.
- Is (6, 0) a solution? 2(6) + 3(0) = 12 + 0 = 12. Yes.
- Is (1, 1) a solution? 2(1) + 3(1) = 2 + 3 = 5 \neq 12. No.
The first three pairs satisfy the equation; the fourth does not. Plot the three that work, and they lie on a straight line. Plot the one that fails, and it falls off the line. This is the geometric meaning of "solution" — a point lies on the line if and only if its coordinates satisfy the equation.
You can generate as many solutions as you like by choosing any value for x and computing y from the equation:
At x = 0: y = 4. At x = 3: y = 2. At x = -3: y = 6. Each choice gives a valid pair. There are infinitely many, one for every real number x.
Graphing a linear equation
To draw the graph of a linear equation, you need only two points — because two points determine a unique straight line. (A third point is useful as a check, but it is not strictly necessary.)
The most convenient two points are usually the intercepts: the places where the line crosses the axes.
Finding intercepts
The x-intercept is the point where the line crosses the x-axis. At every point on the x-axis, y = 0. So set y = 0 in the equation and solve for x.
The y-intercept is the point where the line crosses the y-axis. At every point on the y-axis, x = 0. So set x = 0 in the equation and solve for y.
For 2x + 3y = 12:
- x-intercept: set y = 0 \implies 2x = 12 \implies x = 6. The point is (6, 0).
- y-intercept: set x = 0 \implies 3y = 12 \implies y = 4. The point is (0, 4).
Plot (6, 0) and (0, 4), draw a straight line through them, and you have the graph.
The slope
The slope of a line measures how steeply it rises or falls. For the line ax + by + c = 0 (with b \neq 0), rewrite it as y = -\frac{a}{b}x - \frac{c}{b}. The coefficient of x is the slope, usually denoted m:
For 2x + 3y = 12: y = -\frac{2}{3}x + 4, so the slope is -\frac{2}{3}. This means that for every 3 units you move to the right, the line drops by 2 units. A negative slope means the line falls from left to right; a positive slope means it rises.
Intercept form
When a line has both a non-zero x-intercept and a non-zero y-intercept, there is a particularly clean way to write its equation. If the line crosses the x-axis at (p, 0) and the y-axis at (0, q), then the equation can be written as
This is the intercept form. You can read the intercepts directly from the equation without any algebra: the x-intercept is p and the y-intercept is q.
For 2x + 3y = 12, divide both sides by 12:
So the x-intercept is 6 and the y-intercept is 4 — which matches the points you found earlier.
Intercept form does not work for lines through the origin (where both intercepts are 0), or for horizontal and vertical lines (where one intercept does not exist). For those, you fall back to the general form ax + by + c = 0 or the slope-intercept form y = mx + c.
Applications
Linear equations in two variables model any situation where two quantities are linked by a constant-rate relationship.
Mixture problems. A tea shop blends Assam tea (₹300/kg) and Darjeeling tea (₹500/kg). If the shop wants to make 10 kg of blend costing ₹3,600 total:
where x and y are the kilograms of each type. Each equation is a line in the xy-plane. The single combination that satisfies both conditions is the point where the two lines cross — a topic you meet in full in Systems of Linear Equations.
Distance–speed–time. A cyclist rides at 15 km/h for x hours and then at 10 km/h for y hours, covering 55 km total:
Each valid pair (x, y) on this line represents a possible split of the journey between the two speeds.
Budgets. A student can buy pens at ₹10 each and notebooks at ₹30 each, with a total budget of ₹150:
The line passes through (15, 0), (12, 1), (9, 2), (6, 3), (3, 4), (0, 5). In this context, only non-negative integer solutions make sense — you cannot buy half a notebook. The valid solutions are six dots on the line, not the entire line. But the equation is still the same line; the application adds extra constraints (whole numbers, non-negative).
The interactive graph
The figure below lets you explore a line interactively. Drag the red point along the line 3x + 2y = 12 and watch the coordinates update. Every position of the point on the line gives a valid solution of the equation.
Two worked examples
Example 1: Graph $4x + 5y = 20$ using intercepts
Step 1. Find the x-intercept. Set y = 0:
The x-intercept is (5, 0).
Why: on the x-axis, y = 0 by definition. Substituting y = 0 reduces the two-variable equation to a one-variable equation, which you solve by dividing both sides by 4.
Step 2. Find the y-intercept. Set x = 0:
The y-intercept is (0, 4).
Why: same idea — on the y-axis, x = 0. Substituting and solving gives y = 4.
Step 3. Find a third point for verification. Set x = 2.5:
The third point is (2.5, 2).
Why: two points determine the line, but a third point is a check. If (2.5, 2) lies on the line through (5, 0) and (0, 4), the work is correct.
Step 4. Write the intercept form.
Why: divide both sides of 4x + 5y = 20 by 20. The denominators 5 and 4 are the x-intercept and y-intercept.
Result. The line 4x + 5y = 20 passes through (5, 0) and (0, 4), with slope -4/5.
The intercept form is the fastest way to sketch a line when both intercepts are clean numbers. You read the crossing points directly from the equation, plot two dots, draw the line, and you are done.
Example 2: A speed–distance application
A delivery rider spends x hours cycling at 12 km/h and y hours on a scooter at 36 km/h. The total distance for the day is 108 km. Find the equation, graph it, and determine how many hours of cycling are needed if the rider uses the scooter for 2 hours.
Step 1. Write the equation.
Divide both sides by 12:
Why: distance equals speed times time. Cycling contributes 12x km and the scooter contributes 36y km. The total is 108 km. Dividing by 12 gives smaller numbers without changing the solutions.
Step 2. Find the intercepts.
x-intercept: set y = 0 \implies x = 9. Point: (9, 0).
y-intercept: set x = 0 \implies 3y = 9 \implies y = 3. Point: (0, 3).
Why: (9, 0) means 9 hours of cycling and no scooter — total distance 12 \times 9 = 108 km. (0, 3) means 3 hours on the scooter and no cycling — 36 \times 3 = 108 km. Both make physical sense.
Step 3. Answer the specific question. If y = 2:
The rider cycles for 3 hours.
Why: substituting y = 2 into the equation reduces it to a one-variable equation, which is the link back to Linear Equations in One Variable.
Step 4. Verify. 12(3) + 36(2) = 36 + 72 = 108 km. Correct.
Result. The equation is x + 3y = 9. When the scooter is used for 2 hours, cycling takes 3 hours.
Notice how the physical context restricts the solutions. The full line extends infinitely in both directions, but negative hours of cycling or scooting are meaningless. The real-world solutions are only the segment from (0, 3) to (9, 0).
Common confusions
-
"A linear equation in two variables has two solutions." No — it has infinitely many, one for each value of x (or y) you choose. A single linear equation in two variables underdetermines the system. To get a unique solution, you need a second equation — which leads to Systems of Linear Equations.
-
"The x-intercept is where x = 0." The opposite. The x-intercept is where y = 0 — the point on the x-axis. You set the other variable to zero to find each intercept. This swap trips people up because the naming feels backwards until you think about what "on the x-axis" means geometrically.
-
"2x + 3y = 12 and 4x + 6y = 24 are different lines." They are the same line. Multiplying both sides of the first equation by 2 gives the second. Two equations that are scalar multiples of each other represent the same set of solutions — the same line in the plane.
-
"A line with slope 0 is not a line." A line with slope 0 is a horizontal line — perfectly valid. The equation is y = c for some constant c. It is the vertical lines, x = c, that have undefined slope (not zero slope).
-
"I can write the intercept form for y = 3x." The line y = 3x passes through the origin, so both its x-intercept and y-intercept are 0. You cannot write \frac{x}{0} + \frac{y}{0} = 1 because division by zero is undefined. Intercept form works only for lines that do not pass through the origin.
-
"(3, 2) and (2, 3) are the same solution." No. Ordered pairs are ordered — the first number is the x-coordinate and the second is the y-coordinate. (3, 2) is the point 3 units right and 2 units up; (2, 3) is a different point.
Going deeper
If you came here to learn how to graph a linear equation, find intercepts, and use the intercept form, you have everything you need. What follows is for readers who want to see how the geometry of lines connects to deeper algebraic ideas.
Every line is a level set
The equation ax + by = c can be read as: "find all points (x, y) where the function f(x, y) = ax + by takes the value c." This set of points is called a level set (or level curve) of f. Different values of c give different parallel lines — all with the same slope -a/b but shifted up or down. The family of lines ax + by = c, as c varies, fills the entire plane with parallel lines, like ruled paper.
The geometric meaning of slope
The slope m = -a/b is the tangent of the angle the line makes with the positive x-axis. A slope of 1 means the line rises at 45°. A slope of -1 means it falls at 45°. As the slope approaches infinity (in absolute value), the line approaches vertical. This is why vertical lines have undefined slope — the angle is 90°, and \tan 90° is undefined.
The slope also gives the rate of change: for every 1-unit increase in x, y changes by m units. In the delivery-rider example, the slope of x + 3y = 9 in the form y = -\frac{1}{3}x + 3 is -\frac{1}{3}: each extra hour of cycling lets the rider cut scooter time by \frac{1}{3} of an hour. The slope is the exchange rate between the two quantities.
From one equation to two: the idea of systems
A single equation in two unknowns has infinitely many solutions — a full line. If you add a second equation (with different slope), it defines a second line, and the two lines cross at exactly one point. That point is the only pair (x, y) that satisfies both equations simultaneously. This is the geometric picture behind systems of linear equations, which you meet in full in Systems of Linear Equations.
Lines in higher dimensions
The idea extends beyond two dimensions. A linear equation in three variables — ax + by + cz = d — describes a plane in three-dimensional space. Two such equations describe the intersection of two planes, which is typically a line in 3D. Three equations pin down a single point (if the planes are not parallel or coincident). The pattern is: each independent linear equation removes one degree of freedom from the solution set.
Where this leads next
Lines in the coordinate plane are the gateway to coordinate geometry and systems of equations.
- Linear Equations in One Variable — the simpler case where the solution is a single number, not a line.
- Systems of Linear Equations — what happens when you have two linear equations and need the single point that satisfies both.
- Coordinate Geometry Basics — distance, midpoint, and section formulas on the plane where these lines live.
- Straight Lines — the full theory of lines: angle between two lines, distance from a point to a line, family of lines through a point.
- Slope and Equation of a Line — slope-intercept form, point-slope form, and the general equation, studied in depth.