Writing Linear Equations From Graphs

TipLearning Objectives

By the end of this lesson, you’ll be able to:

  • Extract slope and y-intercept directly from a graph.
  • Determine slope from two clear points on a graph.
  • Write the linear equation of a graphed line in slope-intercept form.

Key Ideas

There are two main strategies for writing the equation of a line from a graph.

1. Use slope and y-intercept

If the graph clearly shows:

  • where the line crosses the y-axis → this gives \(b\)
  • any two points you can use to count rise/run → this gives \(m\)

Then substitute into:

\[ y = mx + b \]

2. Use two points on the line

If the intercept is unclear, choose any two visible points and compute slope:

\[ m = \frac{y_2 - y_1}{x_2 - x_1} \]

Then plug into point-slope or slope-intercept form to find \(b\).

A line with a clear y-intercept and two grid-aligned points.

Common Problem Types

1. Equation from slope and intercept

You can read \(b\) directly from the graph.
Then use rise/run between two grid points to get \(m\).

2. Equation from two points on the graph

Pick any two clean points, compute slope, then use \(y = mx + b\).

3. Equation when line slopes downward

Negative slopes are common—make sure you count down for rise when appropriate.


Strategies

  • Start by identifying exact lattice points (points with integer coordinates).
  • If the line rises as it moves right → slope is positive; if it falls → negative.
  • Use a second point far from the intercept to avoid small counting mistakes.
  • Always verify your equation by plugging one point back in.

Worked Examples

Example 1 — Using slope & intercept

A graph shows a line crossing the y-axis at \(-2\) and passing through \((3, 4)\).

Step 1: Identify intercept
\[ b = -2 \]

Step 2: Compute slope

\[ m = \frac{4 - (-2)}{3 - 0} = \frac{6}{3} = 2 \]

Step 3: Write equation

\[ y = 2x - 2 \]


Example 2 — Using two points

A graph shows points \((1, 1)\) and \((5, 9)\).

Step 1: Compute slope

\[ m = \frac{9 - 1}{5 - 1} = \frac{8}{4} = 2 \]

Step 2: Find intercept

Plug \((1,1)\) into \(y = mx + b\):

\[ 1 = 2(1) + b \Rightarrow b = -1 \]

Step 3: Equation

\[ y = 2x - 1 \]


WarningCommon Mistakes
  • Reading the y-intercept off the x-axis.
  • Counting slope as run/rise rather than rise/run.
  • Using two points but mixing the order of subtraction.
  • Forgetting that a downward slope is negative.

Practice Problems

For each situation, write the linear equation.

  1. A line has slope \(-1\) and y-intercept \(3\).
  2. A line passes through \((0, -2)\) and \((3, 4)\).
  3. A line passes through \((2, -3)\) and \((6, 5)\).
  4. A line on a graph crosses the y-axis at \(5\) and goes through \((4, 1)\).
  5. A line rises 2 for every 3 units right and passes through \((1, 4)\).

1.
\[ y = -x + 3 \]


2.
Slope:
\[ m = \frac{4 - (-2)}{3 - 0} = 2 \]
Equation:
\[ y = 2x - 2 \]


3.
\[ m = \frac{5 - (-3)}{6 - 2} = \frac{8}{4} = 2 \Rightarrow y = 2x - 7 \]


4.
Slope:
\[ m = \frac{1 - 5}{4 - 0} = -1 \]
Equation:
\[ y = -x + 5 \]


5.
Slope = \(\frac{2}{3}\)
Use point \((1,4)\):
\[ 4 = \frac{2}{3}(1) + b \Rightarrow b = \frac{10}{3} \]
Equation:
\[ y = \frac{2}{3}x + \frac{10}{3} \]


Summary

  • Use slope and intercept when the graph makes them obvious.
  • If not, use any two points and compute slope.
  • Substitute into \(y = mx + b\) and check with a point.
  • Count slope using large, easy-to-read steps on the graph grid.
  • If intercept is messy, switch to the two-point method.
  • Always write slope as a fraction when graphing.