Mathwords logoMathwords

Slope-Intercept Equation of a Line

Slope-Intercept Equation of a Line

y = mx + b, where m is the slope and b is the y-intercept. Slope-intercept is the form used most often as the simplified equation of a line.

 

 

See also

Point-slope, standard form, two intercept, vertical line, horizontal line

Key Formula

y=mx+by = mx + b
Where:
  • yy = The dependent variable (vertical coordinate on the graph)
  • xx = The independent variable (horizontal coordinate on the graph)
  • mm = The slope of the line — the ratio of vertical change (rise) to horizontal change (run)
  • bb = The y-intercept — the y-value where the line crosses the y-axis (i.e., the value of y when x = 0)

Worked Example

Problem: Write the equation of a line that has a slope of 3 and passes through the point (0, −2).
Step 1: Start with the slope-intercept form.
y=mx+by = mx + b
Step 2: Identify the slope. The problem states m = 3.
m=3m = 3
Step 3: Identify the y-intercept. The point (0, −2) lies on the y-axis, so b = −2.
b=2b = -2
Step 4: Substitute m and b into the formula.
y=3x+(2)=3x2y = 3x + (-2) = 3x - 2
Answer: The equation of the line is y = 3x − 2.

Another Example

This example differs because neither the slope nor the y-intercept is given directly. You must first compute the slope from two points, then solve for b — the most common real-homework scenario.

Problem: A line passes through the points (2, 5) and (6, 13). Write its equation in slope-intercept form.
Step 1: Calculate the slope using the two points.
m=y2y1x2x1=13562=84=2m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{13 - 5}{6 - 2} = \frac{8}{4} = 2
Step 2: Use one of the points and the slope to solve for b. Substitute (2, 5) into y = mx + b.
5=2(2)+b5 = 2(2) + b
Step 3: Solve for b.
5=4+b    b=15 = 4 + b \implies b = 1
Step 4: Write the final equation.
y=2x+1y = 2x + 1
Step 5: Check with the second point (6, 13): 2(6) + 1 = 13. ✓
y=2(6)+1=13y = 2(6) + 1 = 13 \checkmark
Answer: The equation of the line is y = 2x + 1.

Frequently Asked Questions

What is the difference between slope-intercept form and point-slope form?
Slope-intercept form is y = mx + b, which highlights the slope and the y-intercept. Point-slope form is y − y₁ = m(x − x₁), which highlights the slope and any specific point on the line. Both describe the same line; point-slope form is easier to write when you know a point that is not the y-intercept, while slope-intercept form is easier to graph.
How do you find the slope-intercept equation from a graph?
First, read the y-intercept directly from the graph — it is the point where the line crosses the y-axis, giving you b. Next, pick two clear points on the line and compute rise over run to find the slope m. Then substitute m and b into y = mx + b.
Can every line be written in slope-intercept form?
Almost every line can, but vertical lines cannot. A vertical line has an undefined slope, so it cannot be expressed as y = mx + b. Vertical lines are written in the form x = a, where a is a constant. Horizontal lines, however, work fine: they are written as y = b (with m = 0).

Slope-Intercept Form vs. Standard Form

Slope-Intercept FormStandard Form
Formulay = mx + bAx + By = C
What you read directlySlope (m) and y-intercept (b)Neither slope nor intercept without rearranging
Best used whenGraphing a line or identifying its slope quicklyWorking with integer coefficients or systems of equations
LimitationCannot represent vertical linesCan represent all lines, including vertical lines

Why It Matters

Slope-intercept form is the default way lines appear in algebra courses, standardized tests, and graphing calculators. You will use it constantly when graphing linear equations, solving systems of equations, and analyzing real-world relationships like cost-per-item or speed-over-time. Mastering this form also builds the foundation for understanding linear functions, regression lines in statistics, and eventually calculus.

Common Mistakes

Mistake: Confusing the slope and the y-intercept when reading y = mx + b. For example, seeing y = 4 + 3x and identifying 4 as the slope.
Correction: The slope is always the coefficient of x, regardless of the order the terms are written. In y = 4 + 3x, the slope is 3 and the y-intercept is 4. Rewriting as y = 3x + 4 can help avoid this error.
Mistake: Forgetting the negative sign on b. For instance, writing b = 5 when the equation is y = 2x − 5.
Correction: Remember that y = 2x − 5 is the same as y = 2x + (−5), so b = −5, not 5. The y-intercept is the point (0, −5), which is below the x-axis.

Related Terms