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

Canonical: https://duckyhelper.com/learn/algebra-1/slope-intercept-form/
Updated: 2026-10-01

Slope-intercept form is \(y = mx + b\). The number \(m\) is the slope and \(b\) 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 \(b\). Point-slope form, \(y - y_1 = m(x - x_1)\), is a faster start when you know a point. Standard form is \(Ax + By = C\).

## The key idea

$$
y = mx + b
$$

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

**Three ways to write the same line**

| Form | Equation | Best when |
| --- | --- | --- |
| Slope-intercept | \(y = mx + b\) | you want to graph it or read the slope and y-intercept |
| Point-slope | \(y - y_1 = m(x - x_1)\) | you know a slope and any point |
| Standard | \(Ax + By = C\) | the 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)\).

1. Start with \(y = 4x + b\). Put in the point: \(x = 2\) and \(y = 5\).

   $$
   5 = 4(2) + b
   $$
2. Multiply.

   $$
   5 = 8 + b
   $$
3. Subtract 8.

   $$
   b = -3
   $$
4. Write the full equation and check the point: \(4(2) - 3 = 5\). It works.

Answer: \(y = 4x - 3\)

**Example 2: two points**

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

1. Find the slope.

   $$
   m = \frac{-5 - 7}{4 - (-2)} = \frac{-12}{6} = -2
   $$
2. Use either point to find b. Here we use \((-2, 7)\).

   $$
   7 = -2(-2) + b
   $$
3. Simplify: \(7 = 4 + b\), so subtract 4.

   $$
   b = 3
   $$
4. Check the other point: \(-2(4) + 3 = -5\). It works.

Answer: \(y = -2x + 3\)

**Example 3: point-slope form, then standard form**

Problem: Write the equation of the line through \((3, -1)\) that is parallel to \(y = \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 = \frac{1}{2}\). Plug the point into point-slope form. Since \(y_1 = -1\), \(y - (-1)\) becomes \(y + 1\).

   $$
   y + 1 = \frac{1}{2}(x - 3)
   $$
2. Distribute the \(\frac{1}{2}\) to both terms.

   $$
   y + 1 = \frac{1}{2}x - \frac{3}{2}
   $$
3. Subtract 1, which is \(\frac{2}{2}\).

   $$
   y = \frac{1}{2}x - \frac{5}{2}
   $$
4. For standard form, multiply every term by 2 to clear the fractions.

   $$
   2y = x - 5
   $$
5. Move the x term to the left side. Standard form usually keeps A positive.

   $$
   x - 2y = 5
   $$

Answer: \(y = \frac{1}{2}x - \frac{5}{2}\), which is \(x - 2y = 5\) in standard form.

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

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

1. The given line has slope \(-\frac{A}{B} = -\frac{2}{3}\). The perpendicular slope is the negative reciprocal, \(\frac{3}{2}\). Use point-slope form.

   $$
   y - 1 = \frac{3}{2}(x - 4)
   $$
2. Distribute and add 1.

   $$
   y = \frac{3}{2}x - 5
   $$
3. The x-intercept is where \(y = 0\).

   $$
   0 = \frac{3}{2}x - 5
   $$
4. Add 5, then multiply by \(\frac{2}{3}\).

   $$
   x = \frac{10}{3}
   $$

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

## Common mistakes

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

## Quick methods

> **Tip: Graph standard form with the cover-up method**
>
> For \(2x + 3y = 6\): cover the x term to get \(3y = 6\), so the y-intercept is \((0, 2)\). Cover the y term to get \(2x = 6\), so the x-intercept is \((3, 0)\). Plot both and connect them. This works because each intercept has one coordinate equal to 0.

> **Note: Check with both points**
>
> When you write a line through two points, plug in the point you did not use to find b. If it fits, your equation is right. A graphing calculator like Desmos does the same check visually: type the points and your equation and see if the line hits both.

## Practice

**5 practice questions**

1. What are the slope and y-intercept of \(y = 7 - 3x\)?
   A. slope \(7\), y-intercept \(-3\)
   B. slope \(-3\), y-intercept \(7\)
   C. slope \(3\), y-intercept \(7\)
   D. slope \(-3\), y-intercept \(-7\)

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

2. Which equation describes the line through \((0, -4)\) and \((2, 2)\)?
   A. \(y = 3x - 4\)
   B. \(y = -4x + 3\)
   C. \(y = \frac{1}{3}x - 4\)
   D. \(y = 3x + 4\)

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

3. Which is an equation of the line with slope \(-2\) through \((-1, 5)\)?
   A. \(y - 5 = -2(x + 1)\)
   B. \(y + 5 = -2(x - 1)\)
   C. \(y - 5 = -2(x - 1)\)
   D. \(y - 1 = -2(x + 5)\)

   Answer: \(y - 5 = -2(x + 1)\). Point-slope form is \(y - y_1 = m(x - x_1)\). With \(x_1 = -1\), \(x - (-1)\) becomes \(x + 1\). The other choices flip a sign or swap the coordinates.

4. Which is \(y = \frac{2}{3}x - 4\) written in standard form with whole numbers?
   A. \(2x - 3y = 12\)
   B. \(2x + 3y = 12\)
   C. \(2x - 3y = 4\)
   D. \(3x - 2y = 12\)

   Answer: \(2x - 3y = 12\). Multiply every term by 3: \(3y = 2x - 12\). Subtract \(2x\) and multiply by \(-1\) so the x term is positive: \(2x - 3y = 12\). The choice ending in 4 forgot to multiply the \(-4\) by 3.

5. Which line is parallel to \(6x - 2y = 8\) and passes through \((1, 1)\)?
   A. \(y = 3x - 2\)
   B. \(y = -3x + 4\)
   C. \(y = 3x - 4\)
   D. \(y = -\frac{1}{3}x + \frac{4}{3}\)

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

## Frequently asked questions

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

\(m\) is the slope, how much y changes when x goes up by 1. \(b\) 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 + b\). Everything is a number except b, so solve that small equation. For slope 4 through \((2, 5)\): \(5 = 8 + b\), so \(b = -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 = 6\): \(3y = -2x + 6\), so \(y = -\frac{2}{3}x + 2\).

## Related

- [How to find the slope of a line](https://duckyhelper.com/learn/algebra-1/slope/)
- [How to solve systems of equations](https://duckyhelper.com/learn/algebra-1/systems-of-equations/)
- [Linear functions and slope on the SAT](https://duckyhelper.com/learn/sat-math/linear-functions/)
- [Algebra 1 study guides](https://duckyhelper.com/learn/algebra-1/)

## 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?"

## Get DuckyHelper

Free to start. The web app works in any browser, Chromebooks included; the Mac app can also draw on your real screen. [Try it free in your browser](https://app.duckyhelper.com/?utm_source=duckyhelper.com&utm_medium=learn) or [Get the Mac app](https://duckyhelper.com/download/)
