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

100x + 200y = 1000

or, after dividing by 100,

x + 2y = 10

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

ax + by + c = 0

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.

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:

y = \frac{12 - 2x}{3}

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.

Three solution points of 2x + 3y = 12 lying on a straight line, and one non-solution off the lineA coordinate plane with axes from negative 2 to 8 on x and negative 1 to 6 on y. Three red dots mark the solutions (0,4), (3,2), and (6,0), all lying on the straight line 2x + 3y = 12. A hollow circle marks the non-solution (1,1), which is below the line. The line is drawn through the three solution points. x y 0 1 2 3 4 5 6 1 2 3 4 5 (0, 4) (3, 2) (6, 0) (1, 1) ✗
The equation $2x + 3y = 12$ plotted as a line. Three solutions — $(0, 4)$, $(3, 2)$, $(6, 0)$ — are marked as filled red dots on the line. The non-solution $(1, 1)$ is an open circle below the line: $2(1) + 3(1) = 5$, not $12$. A point is on the line if and only if its coordinates satisfy the equation.

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:

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:

m = -\frac{a}{b}

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.

Slope triangle on the line 2x + 3y = 12 showing rise over runA coordinate plane showing the line 2x plus 3y equals 12, passing through (0,4) and (6,0). A right triangle is drawn between the points (0,4) and (3,2), with the horizontal leg labelled run equals 3 and the vertical leg labelled rise equals negative 2. The slope is labelled as negative two-thirds. x y 0 1 2 3 4 5 6 1 2 3 4 (0, 4) (3, 2) (6, 0) run = 3 rise = −2 slope = −2/3
The slope triangle for $2x + 3y = 12$. Moving from $(0, 4)$ to $(3, 2)$, the run is $3$ units right and the rise is $2$ units down (i.e., $-2$). Slope $= \text{rise}/\text{run} = -2/3$. The negative sign tells you the line falls as you move right.

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

\frac{x}{p} + \frac{y}{q} = 1

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:

\frac{x}{6} + \frac{y}{4} = 1

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:

300x + 500y = 3600 \quad \text{and} \quad x + y = 10

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:

15x + 10y = 55

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:

10x + 30y = 150 \implies x + 3y = 15

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.

Interactive graph of 3x + 2y = 12 with a draggable point showing coordinatesA coordinate plane showing the line 3x plus 2y equals 12, passing through (0,6) and (4,0). A draggable red point on the line displays its current x and y values. The reader can drag the point along the line to see different solutions of the equation. x y 0 1 2 3 4 5 1 2 3 4 5 6 ↔ drag the red point along the line
The line $3x + 2y = 12$. Drag the red point to see different solutions. At the $y$-intercept $(0, 6)$: $3(0) + 2(6) = 12$. At the $x$-intercept $(4, 0)$: $3(4) + 2(0) = 12$. At any position in between, the readout confirms that $3x + 2y$ stays equal to $12$. Every point on the line is a solution; every point off the line is not.

Two worked examples

Example 1: Graph $4x + 5y = 20$ using intercepts

Step 1. Find the x-intercept. Set y = 0:

4x + 5(0) = 20 \implies 4x = 20 \implies x = 5

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:

4(0) + 5y = 20 \implies 5y = 20 \implies y = 4

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:

4(2.5) + 5y = 20 \implies 10 + 5y = 20 \implies 5y = 10 \implies y = 2

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.

\frac{x}{5} + \frac{y}{4} = 1

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.

Graph of 4x + 5y = 20 with intercepts and a verification pointA coordinate plane showing the line 4x plus 5y equals 20. Red dots mark the x-intercept (5,0), the y-intercept (0,4), and the verification point (2.5,2). All three lie on a straight line. The intercept form x/5 + y/4 = 1 is written near the top. x y 0 1 2 3 4 5 1 2 3 4 (0, 4) (5, 0) (2.5, 2) x/5 + y/4 = 1
Three points confirm the line $4x + 5y = 20$. The intercepts $(5, 0)$ and $(0, 4)$ are enough to draw it; the third point $(2.5, 2)$ verifies that the line is correct. The intercept form $\frac{x}{5} + \frac{y}{4} = 1$ names the line by its crossings.

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.

12x + 36y = 108

Divide both sides by 12:

x + 3y = 9

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:

x + 3(2) = 9 \implies x = 9 - 6 = 3

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.

Graph of x + 3y = 9 with cycling and scooter hours on the axesA coordinate plane with x-axis labelled cycling hours (0 to 10) and y-axis labelled scooter hours (0 to 4). The line x plus 3y equals 9 passes through (9,0) and (0,3). A highlighted point at (3,2) is marked with an annotation showing that 3 hours cycling plus 2 hours scooter gives 108 km. cycling hours (x) scooter hours (y) 0 1 2 3 4 5 6 7 8 9 1 2 3 (0, 3) (9, 0) (3, 2) 12(3) + 36(2) = 108 km ✓
The line $x + 3y = 9$ in the context of cycling and scooter hours. Every point on the line represents a valid time-split that covers $108$ km. The highlighted point $(3, 2)$ is the answer to the specific question: $3$ hours cycling, $2$ hours on the scooter. In this context only the part of the line in the first quadrant ($x \ge 0$, $y \ge 0$) makes physical sense — you cannot spend negative hours on a vehicle.

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

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.