Skip to main content
guidealgebralinear equations

How to Find Equation of a Line: From Graphs, Points, and Word Problems

·14 min read·Solvify Team

Knowing how to find equation of a line is a fundamental algebra skill that shows up in everything from homework sets to standardized tests to real-world data analysis. Whether you are reading a graph, working from a pair of coordinates, interpreting a table of values, or translating a word problem, the process follows the same core logic: identify the slope, identify a point, and plug both into the right formula. This guide breaks down each starting scenario with full worked examples, highlights the mistakes students make most often, and gives you practice problems to build confidence.

What Does "Equation of a Line" Actually Mean?

An equation of a line is a mathematical rule that connects every x-value on the line to its matching y-value. If a point (x, y) satisfies the equation, it sits on the line. If it does not, the point is somewhere else on the coordinate plane. The most common way to write the equation of a line is slope-intercept form: y = mx + b. In this formula, m represents the slope — how steep the line is and whether it rises or falls — and b represents the y-intercept, which is where the line crosses the y-axis. A line with equation y = 3x − 2 rises 3 units for every 1 unit to the right and crosses the y-axis at (0, −2). Two other forms you should recognize are point-slope form, y − y₁ = m(x − x₁), and standard form, Ax + By = C. Point-slope form is a working tool — you use it mid-calculation when you know a slope and a point but still need to solve for b. Standard form is required by some textbooks and is useful for systems of equations. All three forms describe the same line; they are just different ways of packaging the same information. When someone asks you to find equation of a line, they are asking you to determine the specific values of m and b (or the equivalent coefficients in another form) that make the equation true for every point on that particular line.

y = mx + b tells you everything about a line: m says how steep it is, and b says where it starts on the y-axis.

How to Find Equation of a Line from a Graph

When students first learn how to find equation of a line, graphs are usually the starting point. The strategy is straightforward: pick two points where the line cleanly crosses grid intersections, calculate the slope, and then read the y-intercept directly from the graph.

1. Step 1: Identify two points on the line

Look for places where the line passes exactly through the corner of a grid square. These are the easiest coordinates to read accurately. Avoid estimating points between gridlines — small errors in reading the graph lead to wrong slopes. For example, suppose the line passes through (1, 2) and (4, 8).

2. Step 2: Calculate the slope

Use the slope formula: m = (y₂ − y₁) ÷ (x₂ − x₁). With points (1, 2) and (4, 8): m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2 The line rises 2 units for every 1 unit to the right.

3. Step 3: Read or calculate the y-intercept

Look at where the line crosses the y-axis (where x = 0). If you can read this directly, use that value as b. If the y-axis crossing is hard to read, substitute one of your points into y = mx + b and solve for b: 2 = 2(1) + b → 2 = 2 + b → b = 0 The y-intercept is 0, meaning the line passes through the origin.

4. Step 4: Write the equation

y = 2x + 0, which simplifies to y = 2x. Check with the second point: y = 2(4) = 8 ✓

Always pick points that land exactly on grid intersections. Estimating coordinates between gridlines is the number-one source of graph-reading errors.

How to Find Equation of a Line from Two Points

The most commonly tested scenario for how to find equation of a line uses two coordinate pairs. You are given two coordinate pairs and must produce the equation. The method uses two formulas in sequence: the slope formula and then point-slope form.

1. The 4-step process

1. Label the points: (x₁, y₁) and (x₂, y₂) 2. Calculate slope: m = (y₂ − y₁) ÷ (x₂ − x₁) 3. Substitute m and one point into y − y₁ = m(x − x₁) 4. Simplify to y = mx + b and verify with the second point

2. Example 1: Points (2, 5) and (6, 13)

Label: (x₁, y₁) = (2, 5), (x₂, y₂) = (6, 13) Slope: m = (13 − 5) ÷ (6 − 2) = 8 ÷ 4 = 2 Point-slope with (2, 5): y − 5 = 2(x − 2) Distribute: y − 5 = 2x − 4 Add 5: y = 2x + 1 Verify with (6, 13): y = 2(6) + 1 = 13 ✓ Equation: y = 2x + 1

3. Example 2: Points (−3, 4) and (3, −2) — negative slope

Label: (x₁, y₁) = (−3, 4), (x₂, y₂) = (3, −2) Slope: m = (−2 − 4) ÷ (3 − (−3)) = −6 ÷ 6 = −1 Point-slope with (3, −2): y − (−2) = −1(x − 3) → y + 2 = −x + 3 Subtract 2: y = −x + 1 Verify with (−3, 4): y = −(−3) + 1 = 3 + 1 = 4 ✓ Equation: y = −x + 1

4. Example 3: Points (0, −7) and (4, 1) — starting from the y-intercept

Label: (x₁, y₁) = (0, −7), (x₂, y₂) = (4, 1) Slope: m = (1 − (−7)) ÷ (4 − 0) = 8 ÷ 4 = 2 Since one point is (0, −7), the y-intercept is already known: b = −7. Write directly: y = 2x − 7 Verify with (4, 1): y = 2(4) − 7 = 8 − 7 = 1 ✓ Shortcut: whenever one of your points has x = 0, you already have b and can skip point-slope form entirely.

Slope formula: m = (y₂ − y₁) ÷ (x₂ − x₁). Subtract coordinates in the same order — numerator and denominator must both go point 2 minus point 1 or both go point 1 minus point 2.

How to Find Equation of a Line from a Table of Values

Tables of x and y values are just organized pairs of points. The process is identical to the two-point method, but the table gives you extra points to check your work. Here is a concrete example. Suppose a table shows: | x | y | | 1 | 4 | | 3 | 10 | | 5 | 16 | | 7 | 22 | Pick any two rows. Using (1, 4) and (3, 10): m = (10 − 4) ÷ (3 − 1) = 6 ÷ 2 = 3 Now find b using (1, 4): 4 = 3(1) + b → b = 1 Equation: y = 3x + 1 Verify with the other rows: x = 5: y = 3(5) + 1 = 16 ✓ x = 7: y = 3(7) + 1 = 22 ✓ A useful check before you start: look at whether the y-values increase by a constant amount as x increases by a constant amount. In this table, x goes up by 2 each time and y goes up by 6 each time. The constant ratio 6 ÷ 2 = 3 confirms the relationship is linear with slope 3. If the differences are not constant, the data is not linear and cannot be described by y = mx + b.

Before calculating slope from a table, check that the differences in y are constant for equal differences in x. If they are not constant, the relationship is not linear.

How to Find Equation of a Line from a Word Problem

Word problems test how to find equation of a line without giving you coordinates directly. Instead, they describe a real-world situation, and you must translate the description into slope and y-intercept values. The slope represents a rate of change, and the y-intercept represents a starting value.

1. Example 1: Cell phone plan

Problem: A cell phone plan charges a $25 monthly base fee plus $0.10 per text message. Write an equation for the total monthly cost y in terms of the number of text messages x. Identify the slope: The cost increases by $0.10 for each additional text. So m = 0.10. Identify the y-intercept: When x = 0 (no texts), the cost is still $25. So b = 25. Equation: y = 0.10x + 25 Check: 100 texts → y = 0.10(100) + 25 = 10 + 25 = $35. That makes sense — $25 base plus $10 for 100 texts.

2. Example 2: Draining a pool

Problem: A swimming pool holds 12,000 gallons. A pump drains 500 gallons per hour. Write an equation for the water remaining y after x hours. Identify the slope: The water decreases by 500 gallons each hour. Since the quantity is going down, the slope is negative: m = −500. Identify the y-intercept: At time x = 0, the pool has 12,000 gallons. So b = 12,000. Equation: y = −500x + 12,000 Check: After 10 hours → y = −500(10) + 12,000 = −5,000 + 12,000 = 7,000 gallons remaining. After 24 hours → y = −500(24) + 12,000 = 0 gallons. The pool is fully drained in 24 hours.

3. Example 3: Two data points in context

Problem: A candle is 12 inches tall after burning for 1 hour and 9 inches tall after burning for 3 hours. Find the equation for the candle's height y after x hours of burning. Extract points: (1, 12) and (3, 9) Slope: m = (9 − 12) ÷ (3 − 1) = −3 ÷ 2 = −1.5 The candle loses 1.5 inches per hour. Point-slope with (1, 12): y − 12 = −1.5(x − 1) → y − 12 = −1.5x + 1.5 → y = −1.5x + 13.5 Check with (3, 9): y = −1.5(3) + 13.5 = −4.5 + 13.5 = 9 ✓ The original height (at x = 0) was 13.5 inches.

In word problems, the slope is the rate of change (per hour, per item, per mile) and the y-intercept is the starting value (initial cost, initial height, initial amount).

Common Mistakes When Finding the Equation of a Line

These are the errors that cost students the most points. Recognizing them before they happen is half the battle.

1. Mixing up the subtraction order in the slope formula

For points (2, 3) and (5, 9), the correct slope is m = (9 − 3) ÷ (5 − 2) = 2. A common mistake is subtracting in different orders: (9 − 3) ÷ (2 − 5) = 6 ÷ (−3) = −2. The sign flip gives you a line that slopes the wrong direction. Rule: always subtract in the same direction. Either (point 2) − (point 1) for both, or (point 1) − (point 2) for both.

2. Forgetting to distribute the slope in point-slope form

Given m = 3 and point (2, 4), the point-slope equation is y − 4 = 3(x − 2). A frequent error: writing y − 4 = 3x − 2 instead of y − 4 = 3x − 6. The slope must multiply both x and the constant inside the parentheses. Missing this distribution step produces the wrong y-intercept every time.

3. Confusing negative coordinates in point-slope form

If the point is (−3, 5) and m = 2, the substitution gives y − 5 = 2(x − (−3)), which simplifies to y − 5 = 2(x + 3). Students sometimes write y − 5 = 2(x − 3) by dropping the negative sign of the x-coordinate. Double-check: subtracting a negative number means adding.

4. Reading the wrong axis for the y-intercept on a graph

The y-intercept is where the line crosses the vertical axis (x = 0), not the horizontal axis. Some students read the x-intercept by mistake and plug it in as b. If you read b from a graph, make sure you are looking at the y-axis.

5. Not checking the answer with the second point

After finding the equation, always substitute the point you did not use into the final equation. If it does not produce a true statement, you made an arithmetic error somewhere. This 10-second check catches most mistakes.

Practice Problems with Full Solutions

Try each problem on your own first, then check the solution. Problems range from straightforward to challenging.

1. Problem 1: Find the equation of the line through (3, 7) and (9, 19)

Slope: m = (19 − 7) ÷ (9 − 3) = 12 ÷ 6 = 2 Point-slope with (3, 7): y − 7 = 2(x − 3) → y − 7 = 2x − 6 → y = 2x + 1 Check with (9, 19): 2(9) + 1 = 19 ✓ Answer: y = 2x + 1

2. Problem 2: Find the equation of the line through (−4, 3) and (2, −9)

Slope: m = (−9 − 3) ÷ (2 − (−4)) = −12 ÷ 6 = −2 Point-slope with (2, −9): y − (−9) = −2(x − 2) → y + 9 = −2x + 4 → y = −2x − 5 Check with (−4, 3): −2(−4) − 5 = 8 − 5 = 3 ✓ Answer: y = −2x − 5

3. Problem 3: A line has slope 3/4 and passes through (8, 5). Find its equation.

Point-slope: y − 5 = (3/4)(x − 8) Distribute: y − 5 = (3/4)x − 6 Add 5: y = (3/4)x − 1 Check: at x = 8, y = (3/4)(8) − 1 = 6 − 1 = 5 ✓ Answer: y = (3/4)x − 1

4. Problem 4: From a table — x: 2, 4, 6, 8 and y: 3, 7, 11, 15

Check constant differences: y increases by 4 each time x increases by 2. Slope: m = 4 ÷ 2 = 2 Using (2, 3): 3 = 2(2) + b → 3 = 4 + b → b = −1 Equation: y = 2x − 1 Check all rows: 2(4) − 1 = 7 ✓, 2(6) − 1 = 11 ✓, 2(8) − 1 = 15 ✓ Answer: y = 2x − 1

5. Problem 5: Word problem — taxi fare

A taxi charges $3.50 when you get in plus $2.25 per mile. Write an equation for the total fare y after x miles. Slope (rate per mile): m = 2.25 Y-intercept (starting fare): b = 3.50 Equation: y = 2.25x + 3.50 Check: A 10-mile ride costs 2.25(10) + 3.50 = 22.50 + 3.50 = $26.00 Answer: y = 2.25x + 3.50

Every practice problem should end with a verification step. Plug your answer back in and confirm both points (or the given conditions) check out.

Quick-Reference Decision Chart

Not sure how to find equation of a line for your specific problem? Here is a decision chart based on what information you are given. If you have the slope and y-intercept: write y = mx + b directly. No extra calculation needed. If you have the slope and one point: use point-slope form y − y₁ = m(x − x₁), then simplify to slope-intercept form. If you have two points: calculate slope first with m = (y₂ − y₁) ÷ (x₂ − x₁), then use point-slope form with either point. If you have a table of values: pick any two rows, calculate slope, then find b. Verify with remaining rows. If you have a graph: read two clear grid-intersection points, calculate slope, read or calculate the y-intercept. If you have a word problem: identify the rate of change (slope) and the starting value (y-intercept) from the context. If both x-coordinates are the same: the line is vertical. Write x = h (no slope-intercept form exists). If both y-coordinates are the same: the line is horizontal. Write y = k (slope is zero). Regardless of the method, every approach ends the same way: you need a slope and a y-intercept (or a slope and a point) to write the equation. The only difference is where those values come from.

Every method for finding the equation of a line produces two things: a slope and a y-intercept. The starting information determines which formula you use to extract them.

Frequently Asked Questions

1. How do you find the equation of a line with just one point?

One point alone is not enough — infinitely many lines pass through any single point. You also need either the slope or a second point. If the problem says the line is parallel to another line, use the same slope. If it says perpendicular, use the negative reciprocal. If you have a graph, the second piece of information is the visual slope you can calculate from the graph.

2. What if the slope is a fraction?

Fractional slopes work exactly the same way. A slope of 2/3 means the line rises 2 units for every 3 units to the right. When you distribute in point-slope form, keep the fraction throughout and simplify at the end. For example, with m = 2/3 and point (6, 1): y − 1 = (2/3)(x − 6) → y − 1 = (2/3)x − 4 → y = (2/3)x − 3.

3. How do you convert between slope-intercept and standard form?

From y = mx + b to standard form Ax + By = C: move the x-term to the left side. If there are fractions, multiply every term by the LCD. Make sure A is positive. Example: y = (2/5)x + 3 → multiply by 5: 5y = 2x + 15 → rearrange: −2x + 5y = 15 → multiply by −1: 2x − 5y = −15.

4. Can you find the equation of a vertical line using y = mx + b?

No. Vertical lines have undefined slope because the run (change in x) is zero, and dividing by zero is undefined. Vertical lines are written as x = h, where h is the constant x-value. For example, a vertical line through (4, 2) and (4, −7) is simply x = 4.

5. What is the fastest way to check my answer?

Substitute both original points (or conditions) into your final equation. Both should produce true statements. For the equation y = 3x − 2 with points (1, 1) and (3, 7): check 3(1) − 2 = 1 ✓ and 3(3) − 2 = 7 ✓. This takes about 10 seconds and catches almost every arithmetic error.

Next Steps: Build Speed and Confidence

Finding the equation of a line is one of those skills that gets faster with repetition. Once the slope formula and point-slope form become automatic, most problems take under a minute. If you are preparing for a test, focus on the two-point method and word problem translations — those appear most frequently. For extra practice, try making up your own problems: pick two random points, find the equation, then graph it to confirm. Working backwards (from equation to graph and back) builds real understanding rather than just formula memorization. If you get stuck on a problem or want to verify your work, Solvify can walk you through any line equation step by step — just scan the problem and follow along with the solution.

Tags:
guidealgebralinear equations

Get Homework Help Now

Join millions of students using our AI math solver for homework help. Get instant solutions to math problems, step-by-step explanations, and 24/7 homework assistance.

Available for iOS and Android devices