Algebra 1

Slope-intercept form and how to write the equation of a line

Slope-intercept form is y=mx+by = mx + b. The number mm is the slope and bb is the y-intercept, where the line crosses the y-axis. To write the equation of a line, find the slope first, then plug in one point to find bb. Point-slope form, y−y1=m(x−x1)y - y_1 = m(x - x_1), is a faster start when you know a point. Standard form is Ax+By=CAx + By = C.

Updated

The key idea

y=mx+by = mx + b

Read it as: start at bb on the y-axis, then for every 1 step to the right, go up mm. In y=−2x+3y = -2x + 3, the line crosses the y-axis at (0,3)(0, 3) and drops 2 for every step right, so it also passes through (1,1)(1, 1) and (2,−1)(2, -1).

Three ways to write the same line
FormEquationBest when
Slope-intercepty=mx+by = mx + byou want to graph it or read the slope and y-intercept
Point-slopey−y1=m(x−x1)y - y_1 = m(x - x_1)you know a slope and any point
StandardAx+By=CAx + By = Cthe answer must have whole numbers, or you want both intercepts fast

All three describe the same line. You can move between them with ordinary algebra.

Worked examples

Example 1: a slope and a point

Problem Write the equation of the line with slope 4 that passes through (2,5)(2, 5).

  1. Start with y=4x+by = 4x + b. Put in the point: x=2x = 2 and y=5y = 5.
    5=4(2)+b5 = 4(2) + b
  2. Multiply.
    5=8+b5 = 8 + b
  3. Subtract 8.
    b=−3b = -3
  4. Write the full equation and check the point: 4(2)−3=54(2) - 3 = 5. It works.

Answer y=4x−3y = 4x - 3

Example 2: two points

Problem Write the equation of the line through (−2,7)(-2, 7) and (4,−5)(4, -5).

  1. Find the slope.
    m=−5−74−(−2)=−126=−2m = \frac{-5 - 7}{4 - (-2)} = \frac{-12}{6} = -2
  2. Use either point to find b. Here we use (−2,7)(-2, 7).
    7=−2(−2)+b7 = -2(-2) + b
  3. Simplify: 7=4+b7 = 4 + b, so subtract 4.
    b=3b = 3
  4. Check the other point: −2(4)+3=−5-2(4) + 3 = -5. It works.

Answer y=−2x+3y = -2x + 3

Example 3: point-slope form, then standard form

Problem Write the equation of the line through (3,−1)(3, -1) that is parallel to y=12x+6y = \frac{1}{2}x + 6. Give it in slope-intercept form and in standard form with whole numbers.

  1. Parallel lines have the same slope, so m=12m = \frac{1}{2}. Plug the point into point-slope form. Since y1=−1y_1 = -1, y−(−1)y - (-1) becomes y+1y + 1.
    y+1=12(x−3)y + 1 = \frac{1}{2}(x - 3)
  2. Distribute the 12\frac{1}{2} to both terms.
    y+1=12x−32y + 1 = \frac{1}{2}x - \frac{3}{2}
  3. Subtract 1, which is 22\frac{2}{2}.
    y=12x−52y = \frac{1}{2}x - \frac{5}{2}
  4. For standard form, multiply every term by 2 to clear the fractions.
    2y=x−52y = x - 5
  5. Move the x term to the left side. Standard form usually keeps A positive.
    x−2y=5x - 2y = 5

Answer y=12x−52y = \frac{1}{2}x - \frac{5}{2}, which is x−2y=5x - 2y = 5 in standard form.

Example 4 (test-hard): perpendicular line and its x-intercept

Problem A line passes through (4,1)(4, 1) and is perpendicular to 2x+3y=62x + 3y = 6. Where does it cross the x-axis?

  1. The given line has slope −AB=−23-\frac{A}{B} = -\frac{2}{3}. The perpendicular slope is the negative reciprocal, 32\frac{3}{2}. Use point-slope form.
    y−1=32(x−4)y - 1 = \frac{3}{2}(x - 4)
  2. Distribute and add 1.
    y=32x−5y = \frac{3}{2}x - 5
  3. The x-intercept is where y=0y = 0.
    0=32x−50 = \frac{3}{2}x - 5
  4. Add 5, then multiply by 23\frac{2}{3}.
    x=103x = \frac{10}{3}

Answer (103,0)\left(\frac{10}{3}, 0\right)

Common mistakes

  • Mixing up b and the x-intercept. bb is where the line crosses the y-axis, the value of y when x=0x = 0.
  • Sign slips in point-slope form. For the point (3,−1)(3, -1), you get y+1=m(x−3)y + 1 = m(x - 3). Fix: write y−(−1)y - (-1) first, then simplify.
  • Distributing to only one term. 12(x−3)\frac{1}{2}(x - 3) is 12x−32\frac{1}{2}x - \frac{3}{2}, not 12x−3\frac{1}{2}x - 3.
  • Reading the slope straight from standard form. In 2x+3y=62x + 3y = 6, the slope is −23-\frac{2}{3}, not 2.
  • Swapping x and y when you plug in a point. In (2,5)(2, 5), 2 is x and 5 is y. Fix: write x=2, y=5x = 2,\ y = 5 before substituting.

Quick methods

Practice

5 practice questions

  1. What are the slope and y-intercept of y=7−3xy = 7 - 3x?

    1. slope 77, y-intercept −3-3
    2. slope −3-3, y-intercept 77
    3. slope 33, y-intercept 77
    4. slope −3-3, y-intercept −7-7
    Show answer

    Answer: slope −3-3, y-intercept 77

    Rewrite it as y=−3x+7y = -3x + 7. The slope is the number multiplied by x, sign included, so it is −3-3. The order of the terms does not change which number is which.

  2. Which equation describes the line through (0,−4)(0, -4) and (2,2)(2, 2)?

    1. y=3x−4y = 3x - 4
    2. y=−4x+3y = -4x + 3
    3. y=13x−4y = \frac{1}{3}x - 4
    4. y=3x+4y = 3x + 4
    Show answer

    Answer: y=3x−4y = 3x - 4

    Slope: 2−(−4)2−0=62=3\frac{2 - (-4)}{2 - 0} = \frac{6}{2} = 3. The point (0,−4)(0, -4) is on the y-axis, so b=−4b = -4. The choice 13x\frac{1}{3}x uses run over rise, and −4x+3-4x + 3 swaps m and b.

  3. Which is an equation of the line with slope −2-2 through (−1,5)(-1, 5)?

    1. y−5=−2(x+1)y - 5 = -2(x + 1)
    2. y+5=−2(x−1)y + 5 = -2(x - 1)
    3. y−5=−2(x−1)y - 5 = -2(x - 1)
    4. y−1=−2(x+5)y - 1 = -2(x + 5)
    Show answer

    Answer: y−5=−2(x+1)y - 5 = -2(x + 1)

    Point-slope form is y−y1=m(x−x1)y - y_1 = m(x - x_1). With x1=−1x_1 = -1, x−(−1)x - (-1) becomes x+1x + 1. The other choices flip a sign or swap the coordinates.

  4. Which is y=23x−4y = \frac{2}{3}x - 4 written in standard form with whole numbers?

    1. 2x−3y=122x - 3y = 12
    2. 2x+3y=122x + 3y = 12
    3. 2x−3y=42x - 3y = 4
    4. 3x−2y=123x - 2y = 12
    Show answer

    Answer: 2x−3y=122x - 3y = 12

    Multiply every term by 3: 3y=2x−123y = 2x - 12. Subtract 2x2x and multiply by −1-1 so the x term is positive: 2x−3y=122x - 3y = 12. The choice ending in 4 forgot to multiply the −4-4 by 3.

  5. Which line is parallel to 6x−2y=86x - 2y = 8 and passes through (1,1)(1, 1)?

    1. y=3x−2y = 3x - 2
    2. y=−3x+4y = -3x + 4
    3. y=3x−4y = 3x - 4
    4. y=−13x+43y = -\frac{1}{3}x + \frac{4}{3}
    Show answer

    Answer: y=3x−2y = 3x - 2

    Solve for y: y=3x−4y = 3x - 4, so the slope is 3. That is the original line itself, and it misses (1,1)(1, 1). Use point-slope: y−1=3(x−1)y - 1 = 3(x - 1), so y=3x−2y = 3x - 2. The last choice is the perpendicular line through (1,1)(1, 1).

Frequently asked questions

What do m and b stand for in y = mx + b?

mm is the slope, how much y changes when x goes up by 1. bb is the y-intercept, the value of y when x is 0, which is where the line crosses the y-axis. The letters are just tradition; what matters is their position in the equation.

How do I find b if I know the slope and a point?

Put the slope and the point's x and y into y=mx+by = mx + b. Everything is a number except b, so solve that small equation. For slope 4 through (2,5)(2, 5): 5=8+b5 = 8 + b, so b=−3b = -3.

When should I use point-slope form?

Use it when you know a slope and a point that is not the y-intercept. You can write the equation right away with no solving. If your teacher wants slope-intercept form, distribute and solve for y afterward.

How do I change standard form to slope-intercept form?

Solve for y. Move the x term to the right side, then divide every term by the number in front of y. For 2x+3y=62x + 3y = 6: 3y=−2x+63y = -2x + 6, so y=−23x+2y = -\frac{2}{3}x + 2.

Try asking Ducky

  • “How do I write the equation of the line on this graph?”
  • “I got y = 4x + 13 for this one. Where did I go wrong finding b?”
  • “Can you show me how to graph 2x + 3y = 6 step by step?”

Free to start. The web app works in any browser, Chromebooks included; the Mac app can also draw on your real screen.