You know a line has one slope everywhere and how to compute it. That is enough to write an equation that every point on the line satisfies.
Why it works
Take a line with slope $m$ that crosses the $y$-axis at $(0, b)$. Pick any other point $(x, y)$ on it. The slope from $(0, b)$ to $(x, y)$ must be $m$: $$\frac{y - b}{x - 0} = m$$ Multiply both sides by $x$: $y - b = mx$, so $y = mx + b$.
Key idea
In $y = mx + b$, $m$ is the slope (the rate of change) and $b$ is the $y$-intercept (the starting value, where $x = 0$).
Worked examples
Worked example: Read m and b
Find the slope and $y$-intercept of $y = -2x + 5$ and of $y = 4 - \frac{1}{3}x$.
- $y = -2x + 5$: $m = -2$, $b = 5$.
- $y = 4 - \frac{1}{3}x$ is $y = -\frac{1}{3}x + 4$ written in a different order: $m = -\frac{1}{3}$, $b = 4$.
Answer: $m = -2, b = 5$; and $m = -\frac{1}{3}, b = 4$
Worked example: Graph from the equation
Graph $y = \frac{2}{3}x - 1$.
- Start at the $y$-intercept, $(0, -1)$.
- The slope $\frac{2}{3}$ means up 2 for every 3 to the right: the next point is $(3, 1)$.
- Draw the line through them.
Answer: the line through $(0, -1)$ and $(3, 1)$
Worked example: Equation from points
A line crosses the $y$-axis at $(0, 3)$ and passes through $(2, -1)$. Write its equation.
- $b = 3$.
- $m = \frac{-1 - 3}{2 - 0} = \frac{-4}{2} = -2$.
Answer: $y = -2x + 3$
Common mistake
Taking the wrong number. In $y = 4 - 2x$ the slope is $-2$ (the number multiplying $x$), not 4, even though 4 is written first. And $b$ is where the line crosses the $y$-axis; the point where it crosses the $x$-axis is a different number.