Equation of a line

The equation of a line is the equation that every point (x, y) on the line satisfies. It is usually written y=ax+by = ax + b (many US books write y=mx+by = mx + b). Here a is the slope (how much y goes up when x goes up by 1) and b is the y-intercept (the y-coordinate where the line crosses the y-axis).

Chalcack concept card · Reviewed by the Chalcack team ·

On the line y = 2x + 1, y goes up 4 when x goes up 2, so the slope is 2.

Formulas

  • y=ax+b(a: slope, b: y-intercept)y = ax + b \quad (a\text{: slope},\ b\text{: } y\text{-intercept})
  • slope=change in ychange in x=y2−y1x2−x1\text{slope} = \frac{\text{change in } y}{\text{change in } x} = \frac{y_2 - y_1}{x_2 - x_1}
  • y−y1=a(x−x1)y - y_1 = a(x - x_1)

When to use it

Use it when you are given the slope and one point, or two points, and need the equation of the line.

Worked example

Find the line through (1, 3) and (3, 7). The slope is 7−33−1=42=2\frac{7-3}{3-1} = \frac{4}{2} = 2. Plugging in the point (1, 3) gives y−3=2(x−1)y - 3 = 2(x - 1), so y=2x+1y = 2x + 1.

Common mistake

A common mistake is subtracting in a different order on top and bottom. As in 7−33−1\frac{7-3}{3-1}, subtract the other point's coordinates from the same point (3, 7) in both the numerator and the denominator.

Related concepts

All 181 math concepts