Lines & Graphs

Slope-Intercept Form (y = mx + b)

Slope-intercept form writes a line as y=mx+by = mx + b, where mm is the slope and bb is the y-intercept, the point (0,b)(0, b) where the line crosses the y-axis.

y=mx+by = mx + b

Try it with your numbers

Show every step

Because yy is already alone, the equation works like a machine: put in any xx and it returns yy. The two numbers it exposes, a starting value and a steady rate of change, are exactly what most line problems ask for.

What Is Slope-Intercept Form and What Do Its Parts Mean?

In y=3x−5y = 3x - 5, the slope is 33 and the y-intercept is −5-5. Signs travel with the number, so a subtracted constant is a negative bb. The slope 33 means 31\frac{3}{1}: each step of 1 to the right lifts the line by 3. The y-intercept is the value of yy when x=0x = 0, which is why word problems treat it as the starting amount.

The trap that costs the most points is reading mm and bb before yy is alone. In 2y=6x+42y = 6x + 4, the slope is not 66. Divide every term by 22 and you get y=3x+2y = 3x + 2, so the slope is 33. The order of terms does not matter either: y=5+2xy = 5 + 2x has slope 22 and intercept 55.

If you only know two points, the slope formula gives you mm, and the rest of this page shows how to get bb.

Quick check

What are the slope and y-intercept of y=6−4xy = 6 - 4x?

Where Does the Slope-Intercept Formula Come From?

Take any point (x,y)(x, y) on a line with slope mm and y-intercept (0,b)(0, b). The slope between those two points is rise over run:

m=y−bx−0m = \frac{y - b}{x - 0}

Multiply both sides by xx to get mx=y−bmx = y - b, then add bb:

y=mx+by = mx + b

So the formula is just the slope formula with one point pinned to the y-axis. Pin a different point (x1,y1)(x_1, y_1) instead and the same steps give y−y1=m(x−x1)y - y_1 = m(x - x_1), which is point-slope form. Slope-intercept form is the special case where x1=0x_1 = 0.

Why b is the intercept

Set x=0x = 0 and the term mxmx vanishes, leaving y=by = b. That single step is the reason bb is where the line meets the y-axis.

How Do You Graph a Line in Slope-Intercept Form?

Graphing takes four moves:

  1. Plot the y-intercept (0,b)(0, b).
  2. Write the slope as a fraction with the sign in the numerator: riserun\frac{\text{rise}}{\text{run}}.
  3. From the intercept, move that rise and run to plot a second point.
  4. Draw the line through both points, then plot one more point by moving the opposite way as a check.

Take y=−23x+1y = -\frac{2}{3}x + 1. Plot (0,1)(0, 1). The slope −23\frac{-2}{3} means down 2 and right 3, which lands on (3,−1)(3, -1). Going the opposite way (up 2, left 3) gives (−3,3)(-3, 3). Check the last point: −23(−3)+1=2+1=3-\frac{2}{3}(-3) + 1 = 2 + 1 = 3. It works.

Two slips to avoid: writing run over rise, and treating a whole-number slope as if it had no denominator. Always write 44 as 41\frac{4}{1}. When the intercept is a fraction or the slope is awkward, a table of values gives you exact points to plot instead.

Try this: Graph y=12x−3y = \frac{1}{2}x - 3 and y=2x−3y = 2x - 3 on the same axes. Both start at (0,−3)(0, -3), so only the tilt changes. Say which line is steeper before you draw it.

How Do You Convert Standard Form to Slope-Intercept Form?

Wrong versus right conversion of 3x − 4y = 8 showing the constant becomes −2 after dividing by −4
Dividing every term by −4 turns +8 into −2, so 3x − 4y = 8 becomes y = ¾x − 2.

Solving for yy is all it takes. Start with 3x−4y=83x - 4y = 8.

−4y=−3x+8-4y = -3x + 8

y=−3x+8−4=34x−2y = \frac{-3x + 8}{-4} = \frac{3}{4}x - 2

The trap is the division by a negative number. It flips the sign of every term, including the constant: 8÷(−4)=−28 \div (-4) = -2, not 22. Dividing only the xx term is the most common wrong answer.

There is a faster route. For Ax+By=CAx + By = C, the slope is m=−ABm = -\frac{A}{B} and the intercept is b=CBb = \frac{C}{B}. Here A=3A = 3, B=−4B = -4, C=8C = 8, so m=−3−4=34m = -\frac{3}{-4} = \frac{3}{4} and b=8−4=−2b = \frac{8}{-4} = -2. This matches, and it works because bb is what you get from finding the y-intercept by setting x=0x = 0. If you are working the other direction, the standard form of a line page covers the clean-up rules for integer coefficients.

Quick check

Write 2x+5y=152x + 5y = 15 in slope-intercept form.

How Do You Write an Equation From Two Points?

Find the slope first, then solve for bb with either point. Use (2,5)(2, 5) and (6,−3)(6, -3).

m=−3−56−2=−84=−2m = \frac{-3 - 5}{6 - 2} = \frac{-8}{4} = -2

Substitute m=−2m = -2 and the point (2,5)(2, 5) into y=mx+by = mx + b:

5=−2(2)+b⇒5=−4+b⇒b=95 = -2(2) + b \quad\Rightarrow\quad 5 = -4 + b \quad\Rightarrow\quad b = 9

So y=−2x+9y = -2x + 9. Test the other point to confirm: −2(6)+9=−3-2(6) + 9 = -3. Both points land on the line, and either one would have given the same bb.

If one of the points has x=0x = 0, skip the substitution: its y-coordinate is bb. For other approaches to the same task, see the equation of a line through two points.

Why Vertical Lines Cannot Be Written in Slope-Intercept Form

A vertical line such as x=4x = 4 has a run of 00, so its slope would be a rise divided by zero, which is undefined. With no slope there is no mm, and the line never crosses the y-axis (unless it is the y-axis itself), so there is no bb either.

The quick test

If an equation has no yy term, such as x=4x = 4 or 3x=123x = 12, it is vertical and slope-intercept form does not apply.

Horizontal lines are fine. The line y=3y = 3 is y=0x+3y = 0x + 3, with slope 00 and intercept 33. In standard form, a vertical line is the case B=0B = 0, which is exactly where the shortcut −AB-\frac{A}{B} breaks. The page on horizontal and vertical lines covers both in detail.

Slope-Intercept Form vs Point-Slope Form vs Standard Form

All three forms describe the same lines. They differ in what they make easy.

Form Equation Best when
Slope-intercept y=mx+by = mx + b You know the slope and y-intercept, or want to graph fast
Point-slope y−y1=m(x−x1)y - y_1 = m(x - x_1) You know the slope and any one point
Standard Ax+By=CAx + By = C You want integer coefficients, both intercepts, or a vertical line

A practical habit: write the first equation in whichever form the given information fits, then convert to y=mx+by = mx + b at the end. It is the best form for comparing lines, because slopes and intercepts can be read straight off. Outside the US you will see it written y=mx+cy = mx + c, which is identical.

Parallel and Perpendicular Lines in Slope-Intercept Form

Slope-intercept form makes line relationships visible. Parallel lines have equal slopes and different intercepts. Perpendicular lines have slopes whose product is −1-1, so each is the negative reciprocal of the other.

Find the line through (4,1)(4, 1) perpendicular to y=2x−5y = 2x - 5. The given slope is 22, so the new slope is −12-\frac{1}{2}.

1=−12(4)+b⇒1=−2+b⇒b=31 = -\frac{1}{2}(4) + b \quad\Rightarrow\quad 1 = -2 + b \quad\Rightarrow\quad b = 3

The line is y=−12x+3y = -\frac{1}{2}x + 3. Quick check: 2⋅(−12)=−12 \cdot \left(-\frac{1}{2}\right) = -1, and (4,1)(4, 1) gives −2+3=1-2 + 3 = 1. More cases, including the vertical and horizontal pair, are on the page for slopes of parallel and perpendicular lines.

Real-World Use: Starting Value Plus Rate of Change

Whenever something starts at a known amount and changes at a steady rate, y=mx+by = mx + b is the model. A tank holds 120 liters and drains at 8 liters per minute. The starting value is b=120b = 120 and the rate is m=−8m = -8, negative because the volume falls:

V=−8t+120V = -8t + 120

Set V=0V = 0 to find when it empties: 0=−8t+1200 = -8t + 120, so t=15t = 15 minutes. That answer is the x-intercept of the line, which is the “when does it run out” question.

The slope is the constant rate of change, and for a line it is the same between any two points. Sequences follow the same pattern with whole-number inputs only: the arithmetic sequence formula is a linear rule whose common difference plays the role of mm.

Quick check

A plumber charges a $45 call-out fee plus 30perhour.Writethecost30 per hour. Write the cost C$ after hh hours.

How Do You Check a Slope-Intercept Equation?

Three quick tests catch nearly every error:

  • Put x=0x = 0 into your equation. The output must be the y-intercept you expect.
  • Substitute each given point. Both sides must match.
  • Check the direction: a line rising from left to right needs m>0m > 0, and a falling line needs m<0m < 0.

The third test is the fastest and catches sign slips before any arithmetic. If you solved 4x+2y=64x + 2y = 6 and got a positive slope, the check says stop: the correct answer is y=−2x+3y = -2x + 3.

Once the line is right, it also sets up inequalities. For y>mx+by > mx + b, draw the line dashed and shade above it. For y<mx+by < mx + b, shade below. Remember to flip the inequality sign whenever you divide by a negative, as covered in graphing linear inequalities.

Practice problems

0 of 5 solved

  1. State the slope and y-intercept of y=−3x+7y = -3x + 7.

  2. Write the equation of the line with slope 12\frac{1}{2} that crosses the y-axis at (0,−4)(0, -4).

  3. Write 5x+2y=105x + 2y = 10 in slope-intercept form.

  4. Find the slope-intercept equation of the line through (1,7)(1, 7) and (3,1)(3, 1).

  5. Find the equation, in slope-intercept form, of the line through (3,5)(3, 5) that is parallel to 6x−3y=126x - 3y = 12.

Common questions

What is slope-intercept form?

Slope-intercept form is y=mx+by = mx + b, a way of writing a line so that yy is alone on one side. The number mm is the slope and bb is the y-intercept, the value of yy when x=0x = 0.

How do you find the slope and y-intercept from an equation?

Solve the equation for yy so that yy has a coefficient of 1. The coefficient of xx is then the slope, and the constant term is the y-intercept. In y=−4x+7y = -4x + 7, the slope is −4-4 and the intercept is 77.

How do you change an equation into slope-intercept form?

Isolate yy using inverse operations: move the xx term to the other side, then divide every term by the coefficient of yy. For Ax+By=CAx + By = C, the shortcut is m=−ABm = -\frac{A}{B} and b=CBb = \frac{C}{B}.

Can every line be written in slope-intercept form?

No. Vertical lines such as x=4x = 4 have an undefined slope and cannot be written as y=mx+by = mx + b. Every other line, including horizontal lines like y=3y = 3, can.

What is the difference between y = mx + b and y = mx + c?

Nothing. They are the same equation. Many textbooks outside the US use cc for the y-intercept, while US textbooks use bb.

What does it mean if b is 0?

The line passes through the origin (0,0)(0, 0) and the equation reduces to y=mxy = mx. That is a direct variation, where yy is proportional to xx.

Up next