Study Blocks

World map › Linear functions & gradient › Lesson 4

y = mx + c: the recipe for a straight line

⏱ about 50 min · MYP criteria A, B, C, D

By the end of this lesson you can…
🌍 The big question

You are packing for a trip to the United States. The weather app says tomorrow will be 77 °F. Shorts, or a jacket?

Most of the world measures temperature in degrees Celsius, but the US uses Fahrenheit. The two scales are linked by a formula:

F=1.8 C+32F = 1.8\,C + 32

So 77 °F is… well, what is it? And here is the deeper question: why 1.8, and why 32? Those two numbers are not random. By the end of this lesson you will be able to say exactly what each one means — and you will be able to read any straight-line equation the same way.

In Lessons 2 and 3 you measured the gradient of a line — how steep it is. But a gradient alone doesn’t pin a line down: lots of lines have gradient 2, all parallel, like a stack of identical ramps at different heights. To fix one particular line, we need one more number. Let’s find out which.

🧪 Explore — try it, no scoring

Try these first. Nothing is marked: just have a go.

no hints, nothing is marked

A line has the rule y=4x−3y = 4x - 3.

Work out yy when x=5x = 5, and again when x=6x = 6. By how much does yy go up?

no hints, nothing is marked

The line y=4x−3y = 4x - 3 crosses the yy-axis at one point. What is the yy-coordinate of that point?

no hints, nothing is marked

A line has the rule y=10−2xy = 10 - 2x.

Work out yy when x=3x = 3, and again when x=4x = 4. By how much does yy change? (Give a negative number if yy goes down.)

Now the explorer. The graph below draws the line y=mx+cy = mx + c. You control mm and cc with the sliders (or the − / + buttons).

  1. Set c=0c = 0 and move only mm. What happens to the line? What stays fixed?
  2. Now keep mm fixed and move only cc. What changes, and what stays the same?
  3. Watch the orange slope triangle. Its run is always 1. What is its rise?
  4. Turn on challenge mode and solve as many as you can. Try to predict mm and cc before you touch the sliders.
🎯 Predict first

Start with y=2x+1y = 2x + 1. If you change cc from 1 to 4 (and leave m=2m = 2), what happens to the line?

y=2x+1y = 2x + 1gradient m=2m = 2 · yy-intercept c=1c = 1
● yy-intercept (0,c)(0, c)▲ slope triangle: run 1, rise mm

m=2m = 2: for every 1 step to the right, yy goes up by 22.
c=1c = 1: when x=0x = 0, y=1y = 1 — the line crosses the yy-axis at (0,1)(0, 1).

🔎 What do you notice?
  • mm controls the tilt. Positive mm: the line goes up from left to right. Negative mm: it goes down. m=0m = 0: flat. The bigger ∣m∣|m|, the steeper the line.
  • cc slides the line up and down without tilting it. Lines with the same mm and different cc are parallel.
  • The slope triangle with run 1 always has rise mm: each step of 1 to the right changes yy by exactly mm. That is the rate of change from Lesson 1.
  • Try-first 1: for y=4x−3y = 4x - 3, going from x=5x = 5 to x=6x = 6 took yy from 1717 to 2121, up 44: the number multiplying xx. Try-first 3: for y=10−2xy = 10 - 2x, going from x=3x = 3 to x=4x = 4 took yy from 44 to 22, down 22: again the number multiplying xx, sign included, even though it was written second.
  • The line always crosses the yy-axis at the point (0,c)(0, c). That’s no accident: put x=0x = 0 into y=mx+cy = mx + c and you get y=m×0+c=cy = m \times 0 + c = c. Try-first 2 did exactly this: on the yy-axis x=0x = 0, so y=4×0−3=−3y = 4 \times 0 - 3 = -3, the number on its own.
  • Changing mm makes the line pivot around the red point (0,c)(0, c) — the yy-intercept stays put.
📐 Key idea

The gradient–intercept form y = mx + c

Every straight line that is not vertical has an equation that can be written as

y=mx+cy = mx + c

  • mm is the gradient: the change in yy for each increase of 1 in xx (rise ÷ run). In a real context it is a rate, with units such as “dollars per km”.
  • cc is the yy-intercept: the value of yy when x=0x = 0. The line crosses the yy-axis at the point (0,c)(0, c). In a real context it is often a fixed or starting amount.

American books and videos write the same form as y=mx+by = mx + b and call it slope–intercept form: their bb is our cc, and their “slope” is our gradient.

Reading mm and cc — the conditions. You can read mm and cc straight off the equation only when it says "y=…y = \ldots" with yy on its own (coefficient 1). The terms can come in either order, and each sign belongs to the number after it:

y=5−3x⟹m=−3,  c=5y = 5 - 3x \quad\Longrightarrow\quad m = -3,\; c = 5

🔍 Why it works

Why is cc where the line crosses the yy-axis? Every point on the yy-axis has x=0x = 0. Put x=0x = 0 into y=mx+cy = mx + c:

y=m×0+c=cy = m \times 0 + c = c

So the line meets the yy-axis at (0,c)(0, c), whatever mm is. That was Try-first 2.

Why is mm the gradient? Compare the yy-values at any xx and at the next one, x+1x + 1. Multiply out the bracket, m(x+1)=mx+mm(x + 1) = mx + m, and subtract:

m(x+1)+c⏟y at x+1  −  (mx+c)⏟y at x  =  mx+m+c−mx−c  =  m\underbrace{m(x + 1) + c}_{y \text{ at } x + 1} \;-\; \underbrace{(mx + c)}_{y \text{ at } x} \;=\; mx + m + c - mx - c \;=\; m

Everything else cancels. So every step of 1 to the right changes yy by exactly mm (Try-first 1 and 3), whichever xx you start from. The same works for any two points with different xx-values x1x_1 and x2x_2:

y2−y1=(mx2+c)−(mx1+c)=mx2−mx1=m(x2−x1),soy2−y1x2−x1=my_2 - y_1 = (mx_2 + c) - (mx_1 + c) = mx_2 - mx_1 = m(x_2 - x_1), \quad\text{so}\quad \frac{y_2 - y_1}{x_2 - x_1} = m

(Multiply out the bracket m(x2−x1)m(x_2 - x_1) and you get back mx2−mx1mx_2 - mx_1, so writing it as m(x2−x1)m(x_2 - x_1) is right. Dividing both sides by x2−x1x_2 - x_1, which is not 00, gives mm.)

Every pair of points gives the same gradient mm. A constant gradient is exactly what makes the graph a straight line.

The letters are only a name. Calling the gradient mm and the intercept cc is a convention (an agreement), which is why American books can use bb instead. The reasons above work whatever the letters are.

📐 Key idea

Points on a line, and special lines

Points on a line. A point (p,q)(p, q) lies on the line exactly when its coordinates make the equation true: q=mp+cq = mp + c.

Is (3,10)(3, 10) on y=4x−1y = 4x - 1? Substitute x=3x = 3: 4×3−1=114 \times 3 - 1 = 11. Since 11≠1011 \ne 10, no — the point is 1 unit below the line.

Finding coordinates. Given xx, substitute and calculate yy. Given yy, substitute and solve for xx.

Special lines.

equationwhat it looks likemmcc
y=cy = c, e.g. y=3y = 3horizontal0033
y=mxy = mx, e.g. y=2xy = 2xthrough the origin (proportional)2200
x=kx = k, e.g. x=4x = 4verticalundefinednone — it never meets the yy-axis (unless k=0k = 0, when it is the yy-axis)

Vertical lines are the only lines that can’t be written as y=mx+cy = mx + c: the run is 0, and you can’t divide by 0.

🔍 Why it works

Why does substituting test a point? The graph of y=4x−1y = 4x - 1 is the picture of every pair (x,y)(x, y) that makes the equation true: that is what “the graph of an equation” means. So a point is on the line exactly when its coordinates pass the test. A drawing can only show “close”; the equation is exact.

Why can’t a vertical line be written as y=mx+cy = mx + c? In y=mx+cy = mx + c each value of xx gives exactly one value of yy. The vertical line x=4x = 4 contains (4,0)(4, 0), (4,1)(4, 1), (4,−3)(4, -3) and many more: one xx with many yy-values. No choice of mm and cc can do that.

⚠️ Watch out

Get yy on its own first. In 2y=4x+62y = 4x + 6 the gradient is not 4. Divide every term by 2:

2y=4x+6⟹y=2x+32y = 4x + 6 \quad\Longrightarrow\quad y = 2x + 3

so m=2m = 2 and c=3c = 3. Two more traps:

  • cc is where the line crosses the yy-axis, not the xx-axis. (y=2x+3y = 2x + 3 crosses the xx-axis at x=−1.5x = -1.5.)
  • Keep the sign with its number: y=4x−7y = 4x - 7 has c=−7c = -7, not 7.

Plot three points, not two. When you draw a line from its equation, work out three points. Two points always fit some straight line, so a slip in one of them stays hidden. With three, a slip shows up at once: the points don’t line up. Then check your arithmetic. The equation is not to blame: every y=mx+cy = mx + c is a straight line.

🧱 Worked example

The burning candle

A candle is 24 cm tall when it is lit, and it burns down 1.5 cm every hour. (Illustrative numbers — real candles vary.) Let hh be the height in cm and tt the time in hours since it was lit.

Step 1 — Identify m and c, with units

The starting height is the value when t=0t = 0, so c=24c = 24 cm. The height falls by 1.5 cm each hour, so the rate of change is m=−1.5m = -1.5 cm per hour. Negative, because the candle gets shorter.

Step 2 — Write the equation

h=−1.5t+24(or h=24−1.5t)h = -1.5t + 24 \qquad (\text{or } h = 24 - 1.5t)

Step 3 — Find the output: how tall after 6 hours?

Substitute t=6t = 6: h=24−1.5×6=24−9=15 cmh = 24 - 1.5 \times 6 = 24 - 9 = 15 \text{ cm}

Step 4 — Find the input: when is it 3 cm tall?

The safety label says: do not burn below 3 cm. Substitute h=3h = 3 and solve: 3=24−1.5t  ⟹  1.5t=21  ⟹  t=211.5=14 hours3 = 24 - 1.5t \;\Longrightarrow\; 1.5t = 21 \;\Longrightarrow\; t = \frac{21}{1.5} = 14 \text{ hours}

Step 5 — Is the answer sensible?

Check by substituting back: 24−1.5×14=24−21=324 - 1.5 \times 14 = 24 - 21 = 3 ✓.

Check against reality: 14 hours is a believable burn time for a tall candle, and 3 cm is less than 15 cm (the height at 6 h), as it should be — the candle keeps shrinking.

Check the limits: the model says h=0h = 0 at t=16t = 16, and at t=20t = 20 it gives h=−6h = -6 cm — a candle can’t have negative height! So this equation only makes sense for 0≤t≤160 \le t \le 16. A good model comes with its “valid from … to …” label.

Foundation

What is the yy-intercept of the line y=3x−5y = 3x - 5?

Foundation

Does the point (−2,3)(-2, 3) lie on the line y=−2x−1y = -2x - 1?

🎬 Another explanation

Still stuck after the example? Hearing it from another teacher often helps. This video was checked against this lesson. Try the questions again afterwards.

Equation of a line - Corbettmaths · corbettmaths · about 3 min

What the two numbers in y = mx + c tell you: the gradient (how much the line goes up for each 1 across) and where it crosses the y-axis, including negative values and lines through the origin.

🤔 Pause and think

A popular shortcut for converting Celsius to Fahrenheit is “double it and add 30”. Write the shortcut as F=__ C+__F = \_\_\,C + \_\_. How do its gradient and its intercept compare with the exact formula F=1.8C+32F = 1.8C + 32? Is the shortcut ever exactly right? (Hint: try a few temperatures — or think about where the two lines cross. We’ll meet crossing lines properly in Lesson 6.)

Back to the Hook. In F=1.8C+32F = 1.8C + 32:

⛏ Practice — choose your level

What is the gradient of the line y=−2x+7y = -2x + 7?

🏗 Build project — real-life task

What will the taxi cost?

A ride-hailing app in a city shows this fare rule (illustrative prices):

Base fare $3.50, then $1.80 per km.

You and your friends are planning trips around the city. Let dd be the distance in km and FF the fare in dollars. Answer the questions in order — and keep asking whether the answers make sense for a real taxi.

FoundationCriterion C

Write an equation for the fare FF dollars for a trip of dd km. (Use the letters FF and dd.)

FoundationCriterion D

How much does a 12.5 km trip from the train station to the stadium cost?

$
IB StandardCriterion D

You have exactly $20 for a taxi. What is the furthest whole number of kilometres you can travel?

km
ExtensionCriterion D

The model F=1.8d+3.5F = 1.8d + 3.5 predicts that a 0 km trip costs $3.50 and that a 200 km trip to another city costs $363.50.

Is this straight-line model reasonable for every trip? Describe at least two ways real taxi fares might differ from the model, and say for which trips you would trust it.

📓 Work it out in your notebook first — sketch, calculate, then write your answer here in full sentences. A model answer appears after you submit, so you can compare.

🔗 Connections

The pattern total = rate × amount + fixed part turns up everywhere:

  • Science: a spring stretched by a hanging mass (within its elastic limit) has length L=k×mass+L0L = k \times \text{mass} + L_0, where L0L_0 is its natural length — that’s y=mx+cy = mx + c with c=L0c = L_0.
  • Business: total cost = cost per item × number of items + fixed costs (rent, machines).
  • Temperature: F=1.8C+32F = 1.8C + 32, as you’ve seen.

Next lesson we’ll look at the same relationship four ways — words, table, graph and equation — and learn to write y=mx+cy = mx + c from any of them.

🪞 Reflect

Explain to a friend who missed today what mm and cc tell you about a line. Use one real example with units.

Which mistake are you most likely to make — reading mm from 2y=4x+62y = 4x + 6 without dividing, mixing up the signs, or swapping mm and cc? What will you do to catch it?

📖 Read more in your book
  • Introduction to Algebra (Art of Problem Solving) — Chapter 8, section 8.5 — slope-intercept form (our gradient–intercept form $y = mx + c$)

The book goes deeper and its problems are harder. Read it after this lesson, with a pencil in your hand.