Writing Linear Equations: From Two Points, Graphs and Tables

#8th Grade Math#Expressions and Equations#Writing Linear Equations
TL;DR
Writing linear equations means finding a line's slope and y-intercept, then placing them in y=mx+by = mx + b. Two points, a graph, a table or a short story can each supply both numbers.
Bhanzu TeamLast updated on December 3, 202615 min read

Key Points

  • Writing linear equations in slope-intercept form comes down to finding two numbers, the slope mm and the y-intercept bb, for the equation y=mx+by = mx + b.
  • The slope of a non-vertical line is the change in yy divided by the change in xx, and similar triangles show it is the same between any two points.
  • The y-intercept of a line can be found from any one point once the slope is known, by putting that point into y=mx+by = mx + b and solving.
  • A point that was not used to find the y-intercept gives a real check, since the equation must turn that point's xx into its yy.

Two numbers that hold a whole line

A straight line never ends, yet two numbers can describe every point on it. That idea goes back to 1637, when René Descartes published La Géométrie and used algebra to describe geometry. Cartesian geometry, the math of describing lines and shapes with equations, grew from that book and carries his name.

Game designers use the same two numbers to slide a character across a screen. Road engineers use them to set how steeply a highway climbs.

In 8th grade, your child learns to find those two numbers from points, graphs, tables and short stories, then write the whole line as one equation.

Writing linear equations from two numbers, the slope 3 and y-intercept -2 of the line y = 3x - 2.
A coordinate grid with the line y = 3x - 2 passing through (0, -2), (1, 1), (2, 4) and (3, 7), labelled b = -2 at the y-axis and m = 3 for up 3, right 1.

What does writing a linear equation mean?

Writing linear equations means turning facts about a straight line, such as two of its points, into one equation that every point on the line obeys. In 8th grade that equation is almost always y=mx+by = mx + b.

A linear equation is an equation whose graph is a straight line. The version below is called slope-intercept form, because its two numbers are the slope and the y-intercept.

y=mx+by = mx + b
Symbol Meaning Units
xx the input, along the horizontal axis what xx counts, such as hours
yy the output, along the vertical axis what yy measures, such as inches
mm the slope, the change in yy when xx goes up by 1 units of yy per unit of xx
bb the y-intercept, the value of yy when x=0x = 0 units of yy

The form works because the line passes through (0,b)(0, b), and each step of 1 to the right changes yy by mm, so xx steps change it by mxmx.

For a line through the origin, (0,0)(0, 0), bb is 0 and the equation shrinks to y=mxy = mx. Common Core standard 8.EE.B.6 asks students to derive both forms, and 8.F.B.4 asks them to find the rate of change and initial value from a description, two points, a table or a graph.

Two names can confuse here: "rate of change" means the slope, and "initial value" means bb.

How do you write a linear equation from two points?

Find the slope first, then use one point to find bb, then check with the other point. Take the points (1,3)(1, 3) and (4,9)(4, 9).

  1. Find the slope. Call the points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). The slope is the rise (change in yy) over the run (change in xx).
m=y2−y1x2−x1=9−34−1=63=2m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{9 - 3}{4 - 1} = \frac{6}{3} = 2
  1. Put the slope and one point into y=mx+by = mx + b. With (1,3)(1, 3), that gives 3=2(1)+b3 = 2(1) + b. Subtract 2 from both sides to get b=1b = 1.

  2. Write the equation, y=2x+1y = 2x + 1.

  3. Check with the unused point. At x=4x = 4 the equation gives 2(4)+1=92(4) + 1 = 9, which matches.

Slope triangle showing rise 6 over run 3 between (1, 3) and (4, 9) on the line y = 2x + 1.
A slope triangle between the points (1, 3) and (4, 9) with rise 6 and run 3 labelled, m = 6/3 = 2, and the line continuing down to cross the y-axis at (0, 1) for y = 2x + 1.

Any pair of points on the line gives the same slope, because every slope triangle on one line has the same angles. Those similar triangles keep one ratio of rise to run. That idea is the core of slope and similar triangles.

Use the point with smaller numbers in step 2 (the arithmetic is lighter), and save the other one for the check.

The method breaks in one case. If both points share an xx-value, like (3,1)(3, 1) and (3,6)(3, 6), the run is 0 and the slope would need division by zero. That vertical line is x=3x = 3, with no y=mx+by = mx + b form. A horizontal line is fine, since its slope is 0 and its equation is y=by = b.

Try It Yourself

Drag the two points to any spots on the grid and watch the slope, the y-intercept and the equation y=mx+by = mx + b update as you move them. Then stack one point straight above the other and read what the box says about the slope.

How do you read the equation from a graph, a table or a sentence?

Each one hides the same two numbers, the slope and the value of yy when x=0x = 0.

On a graph, read bb where the line crosses the y-axis, then count rise and run between two points that sit exactly on grid corners.

Reading slope -1/2 and y-intercept 3 from a graph when writing linear equations.
A falling line on a labelled grid through (0, 3), (2, 2), (4, 1) and (6, 0), marked b = 3 at the y-axis and down 1, right 2 between points, giving m = -1/2.

This line crosses the y-axis at 3, so b=3b = 3. From (0,3)(0, 3) to (2,2)(2, 2) it goes down 1 and right 2, so the equation is y=−12x+3y = -\frac{1}{2}x + 3. A falling line has a negative slope. Kids who count squares where the line cuts between grid corners get a slope that is close but wrong.

In a table, compare how yy changes with how xx changes.

xx yy
0 5
2 11
4 17
6 23

Each time xx goes up 2, yy goes up 6, so m=62=3m = \frac{6}{2} = 3. The row where x=0x = 0 gives b=5b = 5, so the equation is y=3x+5y = 3x + 5. The usual first instinct is to call the slope 6, since most tables kids have met go up by 1.

In a story, decide what xx and yy stand for first. The slope is the change per hour or per minute, and bb is the amount at the start. Stories like these are the heart of linear models.

Words in the problem Math it means
"after 2 hours the water is 18 inches deep" the point (2,18)(2, 18)
"climbs at a steady rate" the slope mm is positive and fixed
"how deep it was at the start" bb, the value of yy when x=0x = 0
"when does the hiker reach 2,300 feet" set y=2300y = 2300 and solve for xx

Examples of writing linear equations

Example 1

A line passes through the origin and the point (4,10)(4, 10). Write its equation.

A line through the origin has b=0b = 0, so the equation is y=mxy = mx.

m=10−04−0=52m = \frac{10 - 0}{4 - 0} = \frac{5}{2}

The equation is y=52xy = \frac{5}{2}x, and it checks out, since 52⋅4=10\frac{5}{2} \cdot 4 = 10.

Example 2

Write the equation of the line through (2,9)(2, 9) and (6,1)(6, 1).

The tempting move is to subtract the smaller number from the bigger one in both places, giving 9−16−2=2\frac{9 - 1}{6 - 2} = 2, then b=5b = 5 and y=2x+5y = 2x + 5.

That fails the check, because at x=6x = 6 it gives 17, not 1. The top used the first point minus the second while the bottom used the second minus the first, and that mix flipped the sign.

Keep one order in both places.

m=1−96−2=−84=−2m = \frac{1 - 9}{6 - 2} = \frac{-8}{4} = -2

Then 9=−2(2)+b9 = -2(2) + b, so 9=−4+b9 = -4 + b. Add 4 to both sides to get b=13b = 13.

The equation is y=−2x+13y = -2x + 13, and the second point agrees, since −2(6)+13=1-2(6) + 13 = 1.

Example 3

When xx is 3, 6, 9 and 12, a table shows yy as 8, 10, 12 and 14. Write the equation.

Each step, xx goes up 3 and yy goes up 2, so m=23m = \frac{2}{3}.

There is no row for x=0x = 0, so work back from (3,8)(3, 8). That gives 8=23(3)+b8 = \frac{2}{3}(3) + b, so 8=2+b8 = 2 + b. Subtract 2 from both sides to get b=6b = 6.

The equation is y=23x+6y = \frac{2}{3}x + 6, and the last row agrees, since 23(12)+6=14\frac{2}{3}(12) + 6 = 14.

Example 4

Write the equation of the line through (−4,3)(-4, 3) and (2,−6)(2, -6).

m=−6−32−(−4)=−96=−32m = \frac{-6 - 3}{2 - (-4)} = \frac{-9}{6} = -\frac{3}{2}

Then 3=−32(−4)+b3 = -\frac{3}{2}(-4) + b, so 3=6+b3 = 6 + b. Subtract 6 from both sides to get b=−3b = -3.

The equation is y=−32x−3y = -\frac{3}{2}x - 3, and the other point agrees, since −32(2)−3=−6-\frac{3}{2}(2) - 3 = -6.

Example 5

A pool fills at a steady rate. After 2 hours the water is 18 inches deep, and after 5 hours it is 33 inches deep. Write an equation for the depth.

Let xx be hours and yy be depth in inches, so the points are (2,18)(2, 18) and (5,33)(5, 33).

m=33−185−2=153=5m = \frac{33 - 18}{5 - 2} = \frac{15}{3} = 5

Then 18=5(2)+b18 = 5(2) + b, so 18=10+b18 = 10 + b. Subtract 10 from both sides to get b=8b = 8.

The equation is y=5x+8y = 5x + 8, so the water rises 5 inches5\,\text{inches} an hour from a start of 8 inches8\,\text{inches}.

Example 6

A hiker climbs at a steady rate and is at 1,450 feet after 30 minutes and 1,900 feet after 75 minutes. Write the equation and find when the hiker reaches 2,300 feet.

Let xx be minutes and yy be height in feet, so the points are (30,1450)(30, 1450) and (75,1900)(75, 1900).

m=1900−145075−30=45045=10m = \frac{1900 - 1450}{75 - 30} = \frac{450}{45} = 10

Then 1450=10(30)+b1450 = 10(30) + b, so 1450=300+b1450 = 300 + b. Subtract 300 from both sides to get b=1150b = 1150.

The equation is y=10x+1150y = 10x + 1150. Now set y=2300y = 2300.

2300=10x+11502300 = 10x + 1150

Subtract 1150 from both sides, then divide both sides by 10, to get x=115x = 115.

The hiker reaches 2,300 feet after 115 minutes115\,\text{minutes}.

Why do people write lines as equations?

An equation answers questions about points nobody has plotted yet. Without one, each new question means a longer graph or more table rows.

  • Predicting past the page. The hiker's equation gave 115 minutes in two steps, with no graph needed.
  • Packing a pattern into two numbers. A hundred table rows shrink to one slope and one y-intercept.
  • Comparing at a glance. A line with slope 5 climbs faster than one with slope 3, which makes comparing linear functions quick.
  • Following real rules. The Internal Revenue Service set its business mileage rate at 76 cents a mile for July 1 to December 31, 2026, so the amount counted for xx business miles in that period follows y=0.76xy = 0.76x in dollars. Its charity rate stayed at 14 cents a mile in every period the IRS lists from 2020 to 2026, a flatter line, y=0.14xy = 0.14x.

Each of these uses rests on the same two numbers, mm and bb, which is why finding them is the whole job.

What most guides miss about writing linear equations

Most guides stop the moment bb appears. The step that catches sign and order errors comes after that.

Checking with the point you used to find bb can only catch a slip in solving for bb, because bb was built to fit that point. It can't catch a wrong slope. Two points fix exactly one line, so if the equation also hits the unused point, both mm and bb are right. Example 2 shows that check catching a wrong slope.

The starting value isn't the top row, either. Tables and stories often begin after x=0x = 0 (Example 3 starts at x=3x = 3), so bb is usually a value you work back to.

In Algebra 1, the same line also appears in point-slope form and standard form, and both still need the slope you learn to find now.

Where do kids trip up when writing linear equations?

Mistake 1: Subtracting the points in different orders

Where it slips in: Finding the slope from two points, as in Examples 2 and 4.

Don't do this: For (1,6)(1, 6) and (4,0)(4, 0), writing 0−61−4=2\frac{0 - 6}{1 - 4} = 2. The top starts with the second point, and the bottom starts with the first.

The correct way: Keep one order, 0−64−1=−2\frac{0 - 6}{4 - 1} = -2, so the line is y=−2x+8y = -2x + 8.

Wrong and right ways to subtract points when writing linear equations, slope 2 versus -2.
Wrong versus right slope for the points (1, 6) and (4, 0), with the mixed order (0 - 6)/(1 - 4) = 2 crossed out and the matching order (0 - 6)/(4 - 1) = -2 beside the falling line y = -2x + 8.

This one starts with a sensible wish. A child wants a positive bottom, flips it, and forgets the top.

Mistake 2: Putting the run on top

Where it slips in: Any slope from two points or a graph.

Don't do this: For (0,1)(0, 1) and (2,7)(2, 7), writing m=26=13m = \frac{2}{6} = \frac{1}{3}.

The correct way: The rise goes on top, so m=62=3m = \frac{6}{2} = 3 and the line is y=3x+1y = 3x + 1.

Because xx comes first in every coordinate pair, it feels natural to put it first in the fraction too.

Mistake 3: Reading the first row of a table as b

Where it slips in: Tables and stories that begin after x=0x = 0, as in Example 3.

Don't do this: Seeing (3,8)(3, 8) at the top and writing y=23x+8y = \frac{2}{3}x + 8, or guessing b=0b = 0.

The correct way: Work back to x=0x = 0 with 8=23(3)+b8 = \frac{2}{3}(3) + b, which gives b=6b = 6 and y=23x+6y = \frac{2}{3}x + 6.

The phrase "starting value" invites a child to grab the first number in sight, even when that row sits at x=3x = 3.

Key Takeaways

  • Every line that isn't vertical comes down to two numbers, and writing linear equations is the work of finding them.
  • From two points, the slope comes first, because bb can only be worked out once mm is known.
  • Only a point you did not use to find bb can catch a wrong slope in the finished equation.
  • Tables and stories hide bb at x=0x = 0, a row or a moment that often isn't shown.
  • For more practice turning two points into a line with a teacher who spots the mixed-order slope slip, explore Bhanzu's 8th grade math curriculum or an algebra tutor.

A Practical Next Step

Write the equation for each line below, then check it with the point you did not use.

  1. The line through (0,−3)(0, -3) and (4,5)(4, 5).
  2. The line through (−1,7)(-1, 7) and (3,−1)(3, -1).
  3. The line through the table values x=4,8,12x = 4, 8, 12 and y=3,6,9y = 3, 6, 9.

Answers: 1. y=2x−3y = 2x - 3, 2. y=−2x+5y = -2x + 5, 3. y=34xy = \frac{3}{4}x.

Practice these to solidify your understanding. If the sign of the slope catches you, return to Mistake 1. Want a live Bhanzu trainer to walk through more writing linear equations problems? Book a free demo class, online globally, or in person at our McKinney, TX center.

Read More

Research Behind This Article

  1. J J O'Connor and E F Robertson, MacTutor History of Mathematics, René Descartes (2014). mathshistory.st-andrews.ac.uk
  2. Common Core State Standards Initiative, Grade 8, Expressions and Equations (2010). thecorestandards.org
  3. Common Core State Standards Initiative, Grade 8, Functions (2010). thecorestandards.org
  4. Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, OpenStax, Elementary Algebra 2e, 4.6 Find the Equation of a Line (2020). openstax.org
  5. Internal Revenue Service, Standard mileage rates (2026). irs.gov
  6. OpenStax, Algebra 1, 4.7.3 Writing Linear Equations (2025). openstax.org

Quick Quiz: Check Yourself

Three levels, new numbers every time: a slope through the origin, a y-intercept from two points, then a two-point story.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the difference between writing and solving a linear equation?
Writing linear equations in slope-intercept form builds the rule y=mx+by = mx + b from facts about a line, while solving finds the value of a variable that makes an equation true.
Why is the slope called mm in y=mx+by = mx + b?
The letter is a naming habit, not a rule, and the slope means the same thing whichever letter holds it.
Is a writing linear equations worksheet enough practice?
No, not on its own. A worksheet gives repetition, but the habit that makes answers right is checking each equation with the unused point, and the problems in A Practical Next Step build that habit.
Can my child use a writing linear equations calculator?
Yes, for checking work already done by hand, but not in place of it, because a calculator skips the exact steps where sign and order mistakes happen.
My child can find the slope but gets stuck on bb. How can I help?
Start at home by asking what yy is when xx is 0. If your child answers from a graph but not from a table, the gap is the substitution step, and a few minutes a day with one point and one slope gives it steady practice. If the trouble shows up only in word problems, or your child freezes before starting, that is usually reading or confidence rather than math, so tell the classroom teacher first. A tutor is worth considering if the gap runs back about two grade levels, for example to solving two-step equations.
What should my child know about writing linear equations by the end of 8th grade?
Your child should be able to write a linear equation from a table, two points, a graph or a short story, and say what mm and bb mean in that story. Point-slope and standard form usually wait for Algebra 1.
✍️ Written By
Bhanzu Team
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →