Learn · Algebra 1

Write the equation of a line

Write the equation of a line from a graph, a table or a description, in slope-intercept, point-slope or standard form, and change one form into another.

Lesson 1 of 6About 30 minutesMA.912.AR.2.2

Written with AI assistance. No teacher has reviewed these lessons and questions yet.

01 · Learn the idea

One line, three ways to write it

A linear equation in two variables describes a straight line: every pair (x, y) that makes the equation true is a point on the line. To write the equation you need two pieces of information, usually the slope and one point.

The slope is the change in y divided by the change in x between any two points on the line. It says how much y changes each time x goes up by 1.

Slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept, the value of y when x = 0. Use it when you know the slope and where the line crosses the y-axis.

Point-slope form is y − y₁ = m(x − x₁), where m is the slope and (x₁, y₁) is any point on the line. Use it when the point you know is not on the y-axis.

Standard form is Ax + By = C, with the x and y terms on one side and a constant on the other. A, B and C are usually written as integers.

Here is one line written all three ways. It has slope 2 and passes through (1, 5). Point-slope: y − 5 = 2(x − 1). Slope-intercept: y = 2x + 3. Standard: 2x − y = −3. Test the point (1, 5) in each: 5 − 5 = 2(1 − 1), 5 = 2(1) + 3, and 2(1) − 5 = −3. All three are true.

y − y₁ = m(x − x₁)

02 · Build understanding

Worked example: from a graph

The graph shows a line through (0, −2) and (4, 1). Write its equation.

Step 1: Pick two points whose coordinates you can read exactly. Here (0, −2) and (4, 1) sit on grid crossings.

Step 2: Find the slope. From (0, −2) to (4, 1), y rises 1 − (−2) = 3 while x runs 4 − 0 = 4. The slope is 3/4.

Step 3: Read the y-intercept. The line crosses the y-axis at (0, −2), so b = −2.

Step 4: Write slope-intercept form: y = (3/4)x − 2.

Step 5: Check with the point you did not use for b. At x = 4, (3/4)(4) − 2 = 3 − 2 = 1, which matches (4, 1).

(0, −2)(4, 1)
  • y = (3/4)x − 2
A line rising from (0, −2) on the y-axis to (4, 1): up 3 for every 4 to the right.

03 · Build understanding

Worked example: from a table

A table gives x: 2, 5, 8, 11 and y: 17, 11, 5, −1. Write an equation for the line through these points.

Step 1: Confirm the table is linear. Each step, x goes up 3 and y goes down 6, so the rate is constant.

Step 2: Find the slope. −6/3 = −2.

Step 3: The table has no row for x = 0, so use point-slope form with any row. With (2, 17): y − 17 = −2(x − 2).

Step 4: To get slope-intercept form, distribute and solve for y. y − 17 = −2x + 4, so y = −2x + 21.

Step 5: Check with a row you did not use. At x = 8, −2(8) + 21 = −16 + 21 = 5, which matches the table.

04 · Build understanding

Worked example: from a description

A climbing gym charges a one-time gear fee plus the same price for every visit. After 3 visits Dana has paid $41 in all. After 7 visits she has paid $73 in all. Write an equation for the total cost y, in dollars, after x visits.

Step 1: Turn the description into points (visits, total dollars): (3, 41) and (7, 73).

Step 2: Find the slope. (73 − 41)/(7 − 3) = 32/4 = 8. Each visit costs $8.

Step 3: Use point-slope form with (3, 41): y − 41 = 8(x − 3).

Step 4: Solve for y. y − 41 = 8x − 24, so y = 8x + 17. The y-intercept 17 is the gear fee in dollars: what Dana pays before any visits.

Step 5: Check with the other point. 8(7) + 17 = 56 + 17 = 73.

Some descriptions lead straight to standard form. A school play sells adult tickets for $9 and student tickets for $6, and takes in $540. With x adult tickets and y student tickets, the equation is 9x + 6y = 540. Two different things add up to a total, so standard form is the natural fit.

05 · Build understanding

Worked example: changing forms

All three forms describe the same line, so you can move between them with ordinary algebra. Start with y − 4 = −(2/3)(x − 6).

Step 1: Distribute the slope. −(2/3)(x − 6) = −(2/3)x + 4, so y − 4 = −(2/3)x + 4.

Step 2: Add 4 to both sides to get slope-intercept form: y = −(2/3)x + 8.

Step 3: For standard form, clear the fraction by multiplying every term by 3: 3y = −2x + 24.

Step 4: Move the x term to the left by adding 2x to both sides: 2x + 3y = 24.

Step 5: Check the point (6, 4) from the original equation in the last one. 2(6) + 3(4) = 12 + 12 = 24.

To go the other way, solve standard form for y. From 9x + 6y = 540, subtract 9x and divide by 6: y = −1.5x + 90.

06 · Build understanding

Four mistakes to watch for

Turning the slope upside down. Between (0, −2) and (4, 1), the change in y is 3 and the change in x is 4. The slope is 3/4, not 4/3. The change in y always goes on top.

Dropping a sign in point-slope form. For a line with slope 5 through (−3, 4), the form is y − 4 = 5(x − (−3)), which is y − 4 = 5(x + 3). Writing y − 4 = 5(x − 3) puts the line through (3, 4) and misses (−3, 4).

Using the first row of a table as the y-intercept. In the table x: 2, 5, 8, 11 and y: 17, 11, 5, −1, the first y-value is 17, but that goes with x = 2. The y-intercept is the value of y at x = 0, which is 21.

Multiplying only some terms when clearing a fraction. From y = −(2/3)x + 8, multiplying by 3 gives 3y = −2x + 24. Writing 3y = −2x + 8 forgets to multiply the 8.

Apply and explain

Your turn

A table has x: 4, 6, 8 and y: 1, 6, 11. Rico writes the equation y = (5/2)x + 1. Explain what Rico did wrong and write the correct equation in slope-intercept form.

Use paper or explain your thinking aloud before opening the solution.

Check your reasoning

Rico found the right slope: y rises 5 each time x rises 2, so the slope is 5/2. His mistake was using the first y-value, 1, as the y-intercept. That 1 goes with x = 4, not x = 0. Use point-slope form with (4, 1): y − 1 = (5/2)(x − 4), so y = (5/2)x − 10 + 1 = (5/2)x − 9. Check with the last row: (5/2)(8) − 9 = 20 − 9 = 11.

  • Confirms the slope is 5/2 from the table.
  • Says the y-value 1 belongs to x = 4, so it is not the y-intercept.
  • Writes y = (5/2)x − 9 and checks it with a row of the table.

Ready to practice?

Try the questions, get feedback, and review your reasoning.

Write the equation of a line: practice →