Unit 10 · Lesson 10.4

10.4Writing Equations for Lines of Best Fit

Write linear equations that model two-variable data. Interpret slope and y-intercept in context, and use equations to make predictions about real-world situations.

Why This Matters

Writing equations for trend lines connects your algebra skills to real data analysis. You'll use this in AP Statistics, Biology labs, and any field where you need to model and predict from observed data.

Workbook

Lesson, vocabulary, worked examples, and practice problems.

Essential Question

How do we write and interpret a linear equation that models real-world bivariate data?

Lesson Overview

Once a line of best fit is drawn on a scatter plot, we can write its equation in slope-intercept form: y = mx + b. To find the equation, we identify two points on the line, calculate the slope, and use point-slope form to write the equation. The slope m represents the rate of change — how much y changes for each 1-unit increase in x. The y-intercept b represents the starting value — the predicted y when x = 0. Both values must be interpreted in the context of the real-world situation.

Writing the Equation — Step-by-Step

1Identify two points on the lineChoose two points that the line of best fit passes through (not necessarily data points).
2Calculate the slopem = (y₂ − y₁) / (x₂ − x₁). This is the rate of change.
3Write point-slope formy − y₁ = m(x − x₁). Substitute one point and the slope.
4Simplify to slope-intercept formSolve for y: y = mx + b. Identify slope m and y-intercept b.
5Interpret in contextState what the slope and y-intercept mean using the variable names from the problem.
6Use to make predictionsSubstitute an x-value to predict y, or substitute a y-value to find x.

Annotated Line of Best Fit — y = 8x + 20

b=20run=1rise=8246820406080x (hours)y (score)

Interpreting Slope and y-Intercept in Context

Slope (m)

The rate of change. For every 1-unit increase in x, y changes by m units.

y = 5x + 45
m = 5 → "For each additional hour studied, the predicted score increases by 5 points."

y-Intercept (b)

The starting value. The predicted y-value when x = 0.

y = 5x + 45
b = 45 → "A student who studies 0 hours is predicted to score 45 points."
Context check: Always ask whether the y-intercept makes sense in context. If x=0 is not realistic (e.g., age=0 for adults), the y-intercept may not be meaningful.

Worked Examples

Example 1

A line of best fit passes through (2, 55) and (8, 85). Write the equation and interpret the slope and y-intercept in context (x = hours studied, y = test score).

m = (85 − 55) / (8 − 2) = 30 / 6 = 5

y − 55 = 5(x − 2) → y = 5x + 45

Slope: for each additional hour studied, the predicted score increases by 5 points.

y-intercept: a student who studies 0 hours is predicted to score 45 points.

Answer:y = 5x + 45. Slope = 5 (score increases 5 pts/hr). y-int = 45 (predicted score with 0 hours).
Example 2

A line of best fit for age of a car (x, years) vs. value (y, $1000s) passes through (1, 22) and (7, 10). Write the equation and predict the value at age 4.

m = (10 − 22) / (7 − 1) = −12 / 6 = −2

y − 22 = −2(x − 1) → y = −2x + 24

At x = 4: y = −2(4) + 24 = 16 → $16,000

Answer:y = −2x + 24. Predicted value at age 4: $16,000.
Example 3

The equation y = 12x + 50 models monthly savings (y, $) based on hours worked per week (x). Interpret the slope and y-intercept.

Slope = 12: for each additional hour worked per week, monthly savings increase by $12.

y-intercept = 50: even with 0 hours worked, the model predicts $50 in monthly savings (possibly from other income).

Answer:Slope: +$12 per hour/week. y-intercept: $50 baseline savings.
Example 4

Using y = 3x + 10, find the x-value that gives y = 40.

40 = 3x + 10

30 = 3x

x = 10

Answer:x = 10
Example 5

A scatter plot for outdoor temperature (°F) vs. hot chocolate sales ($) has a line of best fit through (20, 120) and (50, 30). Write the equation and predict sales at 35°F.

m = (30 − 120) / (50 − 20) = −90 / 30 = −3

y − 120 = −3(x − 20) → y = −3x + 180

At x = 35: y = −3(35) + 180 = −105 + 180 = 75

Answer:y = −3x + 180. Predicted sales at 35°F: $75.

Guided Practice

Guided Practice Video: Writing Equations for Lines of Best Fit

Review how to write the equation of a line of best fit from two points on a scatter plot — including calculating slope and y-intercept from data — before completing the guided problems below.

Video by Sang Real Math

Watch on YouTube ↗
Guided Problem 1

A line of best fit passes through (1, 8) and (5, 24). Write the equation in slope-intercept form.

Hint: Find slope first: m=(24−8)/(5−1). Then use point-slope form.

Guided Problem 2

The equation y = 6x + 15 models weekly earnings (y, $) based on hours worked (x). Interpret the slope and y-intercept.

Hint: Slope: how much do earnings change per hour? y-intercept: what are earnings at 0 hours?

Guided Problem 3

Using y = 4x + 10, predict y when x = 7. Then find x when y = 50.

Hint: For prediction: substitute x=7. For finding x: set y=50 and solve.

Guided Problem 4

A line of best fit for study hours (x) vs. GPA (y) passes through (0, 1.5) and (8, 3.9). Write the equation and predict GPA for 5 hours of study.

Hint: The line passes through (0, 1.5), so b=1.5 directly. Find slope, then write y=mx+b.

Guided Problem 5

Error Analysis: A student writes the equation for a line through (2, 10) and (6, 18) as y = 2x + 4. Check their work and correct any errors.

Hint: Calculate slope: m=(18−10)/(6−2). Then find b using one point.

Key Vocabulary

Slope-Intercept Form

y = mx + b. m is the slope (rate of change); b is the y-intercept (starting value).

Rate of Change (Slope)

How much y changes for each 1-unit increase in x. m = (y₂−y₁)/(x₂−x₁).

y-Intercept

The value of y when x = 0. The starting value of the model.

Linear Model

A linear equation used to represent and predict real-world data.

Point-Slope Form

y − y₁ = m(x − x₁). Used to write the equation when slope and one point are known.

Prediction

Using the equation to estimate a y-value for a given x, or an x-value for a given y.

Interactive Practice — 5 Questions

1

A line passes through (2, 7) and (6, 19). What is the slope?

2

Using y = 5x + 3, what is y when x = 4?

3

The equation y = 2x + 10 models hours worked (x) vs. earnings (y, $). What does the slope represent?

4

Using y = −3x + 30, what is x when y = 9?

5

A line passes through (0, 15) and (5, 40). What is the y-intercept?

Independent Practice

Independent Practice

1

Write the equation for a line through (3, 12) and (7, 28). Show all steps.

2

Using y = 3x + 7, predict y when x = 9. Then find x when y = 52.

3

A line through (2, 40) and (10, 80) models hours of practice (x) vs. free throw % (y). Write the equation and interpret the slope in context.

4

The equation y = 0.5x + 2 models plant height (y, cm) after x days. What does the slope mean? What does the y-intercept mean? Predict height at day 14.

5

Error Analysis: A student says the slope of the line through (1, 5) and (4, 11) is 2. Is this correct? Show your work and correct any errors.

⚠️

Common Mistakes

Calculating slope as (x₂ − x₁) / (y₂ − y₁) — flipping rise and run.

Slope = rise/run = (y₂ − y₁) / (x₂ − x₁). Always put the change in y in the numerator.

Misidentifying the y-intercept as the x-value where the line crosses the x-axis.

The y-intercept is where the line crosses the y-axis (x = 0). Set x = 0 and solve for y.

Interpreting the slope as a total instead of a rate — e.g., saying 'the total is $6 per hour' instead of 'earnings increase by $6 per hour'.

Slope is a rate of change: for every 1-unit increase in x, y changes by the slope amount.

Extrapolating far beyond the data range and treating the prediction as reliable.

Extrapolation becomes less reliable the farther you go from the data range. Always note when a prediction is an extrapolation.

💡

Math Tips

📌

The y-intercept is the predicted y-value when x = 0. Always check whether x = 0 is realistic in context.

📌

The slope is the rate of change: for every 1-unit increase in x, y changes by m units.

📌

Steps: (1) find slope m = (y₂−y₁)/(x₂−x₁), (2) use point-slope y−y₁=m(x−x₁), (3) simplify to y=mx+b.

📌

If the line passes through (0, b), you can read the y-intercept directly — no calculation needed.

📌

Always interpret slope and y-intercept in context using the variable names from the problem.