‹ Back to Xavier's Dig Site

Linear Functions Study Guide

Building a function from the slope and y-intercept, finding b from a point, and graphing.

1. Slope-intercept form

A linear function built from a slope and a y-intercept always takes this form:

f(x) = mx + bm = slope  ·  b = y-intercept

2. Create a function from the slope and y-intercept

  1. Find the slope (m). Write it as a fraction if you can (rise/run). A slope of 2 is the same as 2/1: up 2, right 1.
  2. Find the y-intercept (b). This is the value of y when x = 0.
  3. Put them into the template. Replace m and b in f(x) = mx + b.
  4. Clean up the signs. If b is negative, write it as subtraction: f(x) = 3x + (−4) becomes f(x) = 3x − 4.
  5. Check it. Plug in x = 0 and you should get b. Plug in x = 1 and you should get b + m.

Example 1: slope 2, y-intercept 1

  1. m = 2
  2. b = 1
  3. f(x) = 2x + 1
  4. No sign cleanup needed.
  5. Check: f(0) = 2(0) + 1 = 1 ✓ and f(1) = 2(1) + 1 = 3 ✓

Start at the intercept, then each step goes right 1 and up 2.

f(x) = 2x + 1, stepping with rise 2 / run 1

Example 2: slope −1/2, y-intercept 3

  1. m = −1/2
  2. b = 3
  3. f(x) = −(1/2)x + 3
  4. No sign cleanup needed.
  5. Check: f(0) = 3 ✓ and f(2) = −1 + 3 = 2 ✓

A negative slope means the line goes down as you move right. From (0, 3), go right 2 and down 1 to reach (2, 2).

Both lines cross the y-axis exactly at their b values

Example 3: slope 3, y-intercept −4

f(x) = 3x + (−4), which you write as f(x) = 3x − 4.
Check: f(0) = −4 ✓

Example 4: slope 0, y-intercept 5

f(x) = 0x + 5, which is just f(x) = 5. A slope of 0 means no rise, so the line is flat at y = 5.

Quick tips Positive m goes up to the right, negative m goes down to the right. A bigger number (ignoring the sign) means a steeper line. The number multiplied by x is always the slope, so don't swap m and b.

3. Find the y-intercept from a point (x, y)

You need the slope plus one point on the line. If you only have two points, find the slope first (Case 2).

Case 1: You know the slope and one point

  1. Write the template: y = mx + b
  2. Substitute the slope for m.
  3. Substitute the point's x and y values. The point (x, y) means "when x is this, y is that."
  4. Solve for b. Multiply first, then move that number to the other side.
  5. Write the function with your m and b.
  6. Check by plugging the original x back in. You should get the original y.

Example: slope 3, through (2, 11)

  1. y = mx + b
  2. y = 3x + b
  3. 11 = 3(2) + b
  4. 11 = 6 + b, so b = 11 − 6 = 5
  5. f(x) = 3x + 5
  6. Check: f(2) = 3(2) + 5 = 11 ✓

Why it works: the slope lets you "walk back" from your point to the y-axis. Each step left of 1 drops y by 3. Two steps left lands you on x = 0 at y = 5.

Walking back from (2, 11) to the y-intercept

Example with negatives: slope −2, through (−3, 4)

  1. y = −2x + b
  2. 4 = −2(−3) + b
  3. 4 = 6 + b, so b = 4 − 6 = −2
  4. f(x) = −2x − 2
  5. Check: f(−3) = −2(−3) − 2 = 6 − 2 = 4 ✓
Watch the signsNegative times negative is positive, so −2(−3) = +6.

Case 2: You know two points but no slope

  1. Find the slope with the slope formula: m = (y₂ − y₁) / (x₂ − x₁)
  2. Pick either point and follow Case 1 to find b.

Example: through (1, 4) and (3, 10)

  1. m = (10 − 4) / (3 − 1) = 6 / 2 = 3
  2. Use (1, 4): 4 = 3(1) + b, so b = 4 − 3 = 1
  3. f(x) = 3x + 1
  4. Check with the other point: f(3) = 3(3) + 1 = 10 ✓

Checking with the point you did not use is a good habit. If it works for both points, the function is correct.

Rise and run measured between the two given points

b = y − mxShortcut: for slope 3 through (2, 11), b = 11 − 3(2) = 5

4. Graph a linear function

Two points are enough to draw a straight line. Plotting a third point is a free check: if the three don't line up, something went wrong.

Method 1: Slope and y-intercept (fastest for f(x) = mx + b)

  1. Identify m and b.
  2. Plot the y-intercept at (0, b).
  3. Write the slope as a fraction rise/run. A whole number like 2 becomes 2/1.
  4. Move from the intercept: go right by the run, then up by the rise if it's positive or down if it's negative. Plot that point.
  5. Repeat once more to get a third point.
  6. Draw a straight line through the points with a ruler, with arrows on both ends.

Example: f(x) = −(2/3)x + 4

  1. m = −2/3, b = 4
  2. Plot (0, 4)
  3. Rise = −2, run = 3
  4. Right 3, down 2 → (3, 2)
  5. Right 3, down 2 → (6, 0)
  6. Connect the points

Using the full denominator as the run keeps every point on whole numbers, which is much easier than moving right 1 and down 2/3.

Right 3, down 2, repeated from the intercept

Method 2: Table of values (works for any linear function)

  1. Pick 3 to 5 x values. Include 0 and a few small positives and negatives.
  2. Plug each x into the function to get y.
  3. Plot each (x, y) pair.
  4. Draw the line through them.

Example: f(x) = 2x − 3

xWorkf(x)Point
−12(−1) − 3−5(−1, −5)
02(0) − 3−3(0, −3)
12(1) − 3−1(1, −1)
22(2) − 31(2, 1)
32(3) − 33(3, 3)

The y values go up by 2 each time x goes up by 1. That's the slope showing up in the table, so the table also checks your slope.

Every row of the table is one plotted point

Method 3: x- and y-intercepts (handy for Ax + By = C)

  1. Find the y-intercept: set x = 0 and solve for y.
  2. Find the x-intercept: set y = 0 and solve for x.
  3. Plot both points on the axes and connect them.

Example: 2x + 3y = 12

  1. x = 0: 3y = 12, so y = 4 → (0, 4)
  2. y = 0: 2x = 12, so x = 6 → (6, 0)
  3. Connect them

This is the same line as the Method 1 example. Solving 2x + 3y = 12 for y gives y = −(2/3)x + 4.

Both intercepts sit right on the axes

Special cases

  • Horizontal line, f(x) = b (slope 0): a flat line through (0, b).
  • Vertical line, x = a: a straight up-and-down line through (a, 0). This is not a function, because one x value has infinitely many y values. It fails the vertical line test.
  • Line through the origin, f(x) = mx (b = 0): start at (0, 0) and use the slope.

Horizontal, vertical, and through the origin

Common mistakes to watch for

5. Try it yourself

Move the sliders to change the slope and y-intercept. Watch where the line crosses the y-axis and how the green step changes.

xf(x)Point