Linear functions · Lesson 2

From a table or graph to an equation

To write f(x)=mx+bf(x) = mx + b you need two numbers: the slope mm and the intercept bb. A table or a graph gives you points. Your job is to turn them into those two numbers.

Slope from two points. For points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}: the change in output over the change in input, or rise over run. Subtract in the same order on top and bottom. From (1,4)(1, 4) to (5,16)(5, 16): m=16−45−1=124=3m = \frac{16 - 4}{5 - 1} = \frac{12}{4} = 3.

**In a table, check the step in xx.** If xx goes 0, 2, 4 and f(x)f(x) goes 3, 7, 11, the output rises 4 from row to row, but each row is 2 units of xx, so m=42=2m = \frac{4}{2} = 2.

The intercept. If a point has x=0x = 0, its yy-value is bb. Otherwise, substitute any point into y=mx+by = mx + b and solve: with m=3m = 3 and the point (1,4)(1, 4), 4=3(1)+b4 = 3(1) + b, so b=1b = 1. A graph described in words gives the same information. A line that crosses the yy-axis at (0,5)(0, 5) has b=5b = 5. An xx-intercept at (6,0)(6, 0) is just another point, where the output is 0.

Check with both points. Substitute each given point into your equation. A choice built from a wrong slope often still passes through the point used to find bb, so only the other point catches it.

Worked example Easy

The table shows three values of the linear function ff.

xxf(x)f(x)
03
27
411

Which equation defines ff?

  1. f(x)=4x+3f(x) = 4x + 3
  2. f(x)=12x+3f(x) = \frac{1}{2}x + 3
  3. f(x)=2x+3f(x) = 2x + 3Answer
  4. f(x)=2x+7f(x) = 2x + 7

How to solve it

  1. Find the slope from two rows. From (0,3)(0, 3) to (2,7)(2, 7): m=7−32−0=42=2m = \frac{7 - 3}{2 - 0} = \frac{4}{2} = 2.
  2. The row with x=0x = 0 gives the intercept: f(0)=3f(0) = 3, so b=3b = 3.
  3. So f(x)=2x+3f(x) = 2x + 3. Check the third row: 2(4)+3=112(4) + 3 = 11.

Why each choice is right or wrong

  • A. Incorrect. 4 is the change in f(x)f(x) from one row to the next, but xx goes up by 2 in each row. The slope is 42=2\frac{4}{2} = 2. This function gives f(2)=11f(2) = 11, not 7.
  • B. Incorrect. This divides the change in xx by the change in f(x)f(x), 24\frac{2}{4}, which is run over rise. Slope is the change in output over the change in input: 42=2\frac{4}{2} = 2.
  • C. Correct. From (0,3)(0, 3) to (2,7)(2, 7), the slope is 7−32−0=2\frac{7 - 3}{2 - 0} = 2, and f(0)=3f(0) = 3 gives b=3b = 3. Check: f(4)=2(4)+3=11f(4) = 2(4) + 3 = 11.
  • D. Incorrect. This uses f(2)=7f(2) = 7 as the intercept. The intercept is the output when x=0x = 0, which the table gives as 3. This function gives f(0)=7f(0) = 7.

Worked example Medium

The graph of the linear function ff in the xyxy-plane is a line that passes through the points (−2,9)(-2, 9) and (4,−3)(4, -3).

Which equation defines ff?

  1. f(x)=−2x+5f(x) = -2x + 5Answer
  2. f(x)=2x+13f(x) = 2x + 13
  3. f(x)=−12x+8f(x) = -\frac{1}{2}x + 8
  4. f(x)=−2x+9f(x) = -2x + 9

How to solve it

  1. Slope: m=−3−94−(−2)=−126=−2m = \frac{-3 - 9}{4 - (-2)} = \frac{-12}{6} = -2.
  2. Substitute one point into y=−2x+by = -2x + b. Using (−2,9)(-2, 9): 9=−2(−2)+b=4+b9 = -2(-2) + b = 4 + b, so b=5b = 5.
  3. So f(x)=−2x+5f(x) = -2x + 5. Check the other point: −2(4)+5=−3-2(4) + 5 = -3. Both points fit.

Why each choice is right or wrong

  • A. Correct. The slope is −3−94−(−2)=−2\frac{-3 - 9}{4 - (-2)} = -2, and 9=−2(−2)+b9 = -2(-2) + b gives b=5b = 5. Both points fit: f(−2)=9f(-2) = 9 and f(4)=−3f(4) = -3.
  • B. Incorrect. This subtracts in opposite orders on top and bottom, −3−9−2−4=2\frac{-3 - 9}{-2 - 4} = 2, then finds bb from 9=2(−2)+b9 = 2(-2) + b. The line passes through (−2,9)(-2, 9) but gives f(4)=21f(4) = 21, not −3-3.
  • C. Incorrect. This puts the change in xx over the change in yy, 6−12=−12\frac{6}{-12} = -\frac{1}{2}, then finds bb from 9=−12(−2)+b9 = -\frac{1}{2}(-2) + b. The line passes through (−2,9)(-2, 9) but gives f(4)=6f(4) = 6, not −3-3.
  • D. Incorrect. The slope is right, but 9 is the yy-value at x=−2x = -2, not at x=0x = 0, so it isn't the intercept. This function gives f(−2)=13f(-2) = 13, not 9.

Trap Run over rise

Slope is the change in output divided by the change in input. Putting the change in xx on top gives the reciprocal, such as 12\frac{1}{2} instead of 2, and the SAT often lists it among the choices.

Trap Mismatched subtraction order

If you subtract y2−y1y_2 - y_1 on top, subtract x2−x1x_2 - x_1 on the bottom. Mixing the orders flips the sign of the slope. A quick sense check: if the outputs rise as the inputs rise, the slope is positive.

Trap Using the wrong point for b

The intercept is the output when x=0x = 0. The first value in a table, or the yy-value of the first point you're given, is the intercept only if its xx-value is 0. Otherwise, substitute the point into y=mx+by = mx + b and solve for bb.

Desmos When Desmos is faster

Use a regression. Click the + in the top left and choose table. Type the xx-values in the x1x_1 column and the outputs in the y1y_1 column. On a new line, type y1 ~ mx1 + b, using the tilde key (~) between the two sides.

Desmos fits a line to the points and lists the values of mm and bb under that line. When the points lie exactly on a line, the fit is exact (r2=1r^2 = 1), so mm is the slope and bb is the intercept. This works for two points from a graph described in words, too: put both points in the table.

Desmos shows the results as decimals. A slope of 23\frac{2}{3} appears as a rounded decimal such as 0.666667, so compare it with the choices as decimals. For a clean two-row table, the slope formula by hand is just as quick.