🧮 Algebra

📈Equation of a Straight Line

Every line carries an ID card — m says how it climbs, b says where it starts.

Every line a ruler can draw — steep or flat — fits into one short formula. Read it well and two letters will tell you what the whole line looks like. The letters mm and bb work exactly like the variables you trained in Variables & the Function Machine.

y = mx + b: every letter has a job

y=mx+by = mx + b

  • mm is the slope: how steeply the line climbs;
  • bb is the intercept: where the line meets the y-axis — its starting point when x=0x = 0;
  • Plot every point (x,y)(x, y) that satisfies the formula and they line up, perfectly straight.

Take y=2x+1y = 2x + 1: when x=0x = 0, y=1y = 1, so the line sets off from (0,1)(0, 1); each time xx grows by 1, yy grows by 2.

Slope m: rise over run

Slope answers one question: for each step forward, how far do you climb?

m=ΔyΔxm = \frac{\Delta y}{\Delta x}

The Greek letter Δ\Delta (delta) means "change": Δy\Delta y is how much y changed, Δx\Delta x is how much x changed. For example, a line passing through (1,3)(1, 3) and (4,9)(4, 9):

m=9341=63=2m = \frac{9 - 3}{4 - 1} = \frac{6}{3} = 2

One step right, two steps up. The bigger mm is, the steeper the line: with m>0m > 0 the line climbs to the right, with m<0m < 0 it slides downhill.

Why the line is straight

Pick any two points on the line and the slope comes out the same. A rate of change that never wavers is what "straight" means in algebra.

Horizontal and vertical lines

Two lines deserve a closer look:

  • Horizontal lines, like y=3y = 3: x moves, y never budges, so the slope is m=0m = 0 — no tilt at all;
  • Vertical lines, like x=2x = 2: y moves, x never budges. This is the one line y=mx+by = mx + b cannot write — Δx=0\Delta x = 0, and dividing by zero has no meaning, so a vertical line has no slope.

m and b in real life

A phone plan: 19 yuan per month, plus 3 yuan per GB of data. Let xx be the GB used and yy the bill:

y=3x+19y = 3x + 19

m=3m = 3 is the rate of change: each extra GB costs 3 more yuan. b=19b = 19 is the starting point: the monthly fee you pay even with zero data. At 10 GB, y=3×10+19=49y = 3 \times 10 + 19 = 49 yuan.

Plenty of real situations share this shape: bb is the fixed base, mm is the pay-per-use part.

Line Lab

InteractiveLine Lab

y = x + 2

y-intercept

(0, 2)

x-intercept

(-2, 0)

Drag the sliders for mm and bb. Move only bb first and watch the whole line slide; then move only mm and watch it pivot around the intercept — flatter, steeper, uphill to downhill.

Check yourself

Quick quiz

  1. 1. A line passes through (0, 5) and rises 2 for every 1 it moves right. What is its equation?

  2. 2. Which line is steepest?

  3. 3. The plan is 19 yuan per month plus 3 yuan per GB. What does 10 GB cost?