Equation of a Line

A taxi charges £3 the moment you climb in, then £2 for every mile — jot that rule down and you have just described a straight line. Phone plans, gym memberships, delivery fees: a fixed amount plus a steady rate per unit shows up everywhere, and every one of them is a line you can capture in a single tidy equation.

Here is one of the best bargains in all of mathematics. A straight line goes on forever — it contains infinitely many points, more than you could ever list. And yet you can hand someone the entire line, every last point of it, with just two numbers:

y = mx + c

Think of it as a machine that draws a line. Feed it an x, and it multiplies by m, adds c, and out comes the y that sits on the line above (or below) that x. Run the machine for every x at once and the outputs trace a perfect straight line. It's a linear function wearing its graph on the outside.

The two dials on the machine are m, the gradient (how steeply the line tilts), and c, the y-intercept (where it crosses the y-axis). Change either one and the line tilts or slides. Every straight line on every graph you will ever meet — in maths, science, economics, anywhere — is just these two numbers in disguise. Learn to read them and write them, and lines hold no more secrets.

c — where the line crosses the y-axis

The number c is the y-intercept. Why does it live on the y-axis? Because the y-axis is exactly where x = 0, and if you feed x = 0 into the machine, the mx part vanishes:

y = m(0) + c = c.

So the line always passes through the point (0, c) — no exceptions, whatever m is doing. Raising c lifts the whole line straight up; lowering it drops the line down — like an elevator that moves the line without changing its tilt. That makes c the natural starting value in real problems: the taxi fare before you've moved, the water already in the tank, the money in your account on day zero.

m — how steeply the line tilts

The number m is the gradient: it says how much y changes for each step of 1 in x. If m = 2, every step right takes you two up. If m = -3, every step right takes you three down — the line runs downhill. And m = 0 means no rise at all: a perfectly flat, horizontal line. (Gradient is measured precisely as slope: rise over run.)

Now take the controls yourself. Drive the two sliders and watch the division of labour: c slides the line up and down while the tilt stays frozen; m pivots the line about its y-intercept like a propeller, while the crossing point stays nailed to the axis. Push m negative and watch the line flip downhill. Two dials, total control.

Worked example: from equation to line

Suppose you're asked to draw y = 2x - 1. Don't plot points at random — read the two numbers and follow the ritual:

  1. Read c. Here c = -1, so start your pencil at (0, -1) on the y-axis.
  2. Read m. Here m = 2: from your point, step 1 across and 2 up. Mark the new point.
  3. Repeat and join. Step the same staircase again, then draw the straight line through your points, extending it both ways.

Step through the figure to watch the ritual happen:

For a downhill line like y = -3x + 4 the ritual is identical — start at (0, 4), but each step across now goes 3 down, because m = -3.

Worked example: from line to equation

Now run the machine in reverse. Someone hands you a drawn line and asks for its equation. You need to extract the same two numbers — and each has its own trick:

Two habits keep this honest: always pick points the line passes through exactly (eyeballing "about 1.5" invites errors), and always sanity-check the sign — a line falling left-to-right must get a negative m.

The full ritual: from two points to the equation

Hardest version, and the one exams love: no picture at all, just two points. Find the equation of the line through (1, 5) and (3, 11). Two numbers to find, so two steps:

Step 1 — the gradient first. Divide the change in y by the change in x:

m = \frac{11 - 5}{3 - 1} = \frac{6}{2} = 3.

Step 2 — substitute one point to find c. The equation so far is y = 3x + c, and the point (1, 5) must sit on the line, so its coordinates must fit:

5 = 3(1) + c \quad\Rightarrow\quad c = 2.

The equation is y = 3x + 2. And here's the professional touch — check with the point you didn't use: does (3, 11) fit? 3(3) + 2 = 11. ✓ It does. If it hadn't, you'd know a slip happened somewhere.

Once more, faster, with a downhill line — through (-1, 7) and (2, 1):

m = \frac{1 - 7}{2 - (-1)} = \frac{-6}{3} = -2, \qquad 7 = -2(-1) + c \;\Rightarrow\; c = 5,

so the line is y = -2x + 5. (Check: -2(2) + 5 = 1. ✓) Watch the double negative in the run: subtracting a negative coordinate is the classic place marks leak away.

Is this point on that line?

The equation isn't just a drawing recipe — it's a membership test. Think of the line as a club and the equation as the bouncer at the door: a point (x, y) gets in only if its two coordinates satisfy the equation. To check, substitute both coordinates and see if the two sides agree.

Is (4, 10) on the line y = 3x - 2? Substitute x = 4: the right side gives 3(4) - 2 = 10, which matches the point's y-coordinate exactly. Yes — it's on the line.

Is (5, 12) on the same line? Now 3(5) - 2 = 13, but the point claims y = 12. The sides disagree, so no — the point sits one unit below the line. No graph paper needed; the algebra answers instantly, even for a point like (1000, 2998) that no sheet of paper could hold.

Once you can see m and c, you start spotting y = mx + c everywhere money or measurement moves at a steady rate. The pattern is always: a starting amount, plus a fixed rate times how much you use.

That's the real reason this one page matters so much: master y = mx + c once, and you've mastered every steady-rate situation you'll ever meet — you just have to spot which number is playing m and which is playing c.

Reading a line's equation at a glance

With practice, an equation becomes a portrait. y = 3x - 2? A steep uphill line (m = 3) crossing the axis just below the origin at (0, -2). y = -\tfrac{1}{2}x + 4? A gentle downhill slope starting high at (0, 4). You can sketch either in five seconds without plotting a single table of values.

And to find y at any particular x, just run the machine: for y = 3x - 2 at x = 2, y = 3(2) - 2 = 4. Khan Academy walks through slope-intercept form here: