FreeMathCamp
Course Articles

Free Math Camp

A free course in the maths you need before calculus. Short lessons, interactive visuals, practice that adapts to you, and a record of progress on your account.

freemathcamp.app

Made by Adam Richard Turner

hello@adamrichardturner.dev

Course

  • Foundations
  • Articles
  • Start free
  • Sign in

Legal

  • Privacy
  • Terms
  • Do not sell or share

Copyright © Adam Richard Turner. All rights reserved.

  1. Articles
  2. /
  3. Graphs & Functions
Graphs & Functions

Equation of a Straight Line: y = mx + b and Point-Slope Form

How to read slope and intercept from y=mx+by = mx + by=mx+b, how to graph a line from its equation, and how to write the equation of a line from a point and a slope or from two points, including parallel and perpendicular lines.

3 min read Supports 4 lessons
In short

Every non-vertical straight line can be written y=mx+by = mx + by=mx+b, where mmm is the slope and bbb is the yyy-intercept, the height where the line crosses the yyy-axis.

A straight line is fixed by two facts: how steep it is, and where it is. The equation y=mx+by = mx + by=mx+b stores exactly those two facts.

Slope-intercept form
y=mx+by = mx + by=mx+b

mmm is the slope. bbb is the yyy-intercept: the line passes through (0,b)(0, b)(0,b). In the UK this is often written y=mx+cy = mx + cy=mx+c.

Move the sliders and watch how each number controls the line.

Changing mmm swings the line around its intercept. Changing bbb slides the whole line up or down without changing its steepness.

Graphing from the equation

Key idea

Plot (0,b)(0, b)(0,b). Then step run 1, rise mmm to find more points, and join them up.

Worked example

Graph y=−2x+3y = -2x + 3y=−2x+3.

  1. 1

    Start at the intercept, (0,3)(0, 3)(0,3).

Rearranging into this form

Equations are not always given as y=…y = \dotsy=…. Solve for yyy and the slope and intercept appear.

  1. 6x+2y=86x + 2y = 86x+2y=8

    Find the slope and yyy-intercept.

1/4

Writing the equation of a line

If you know the slope mmm and any one point (x1,y1)(x_1, y_1)(x1​,y1​) on the line, point-slope form gives the equation straight away.

Point-slope form
y−y1=m(x−x1)y - y_1 = m(x - x_1)y−y1​=m(x−x1​)
Worked example

Find the line through (2,5)(2, 5)(2,5) and (4,11)(4, 11)(4,11).

  1. 1

    Slope.

    m=11−54−2=3m = \frac{11 - 5}{4 - 2} = 3m=4−211−5​=3
Tip

Check by substituting the other point: 3(4)−1=113(4) - 1 = 113(4)−1=11 ✓.

Parallel and perpendicular lines

Parallel & perpendicular
parallel: m1=m2perpendicular: m1⋅m2=−1\text{parallel: } m_1 = m_2 \qquad \text{perpendicular: } m_1 \cdot m_2 = -1parallel: m1​=m2​perpendicular: m1​⋅m2​=−1

Same slope: parallel. Slopes 222 and −12-\frac{1}{2}−21​: at right angles.

Watch out

Vertical lines cannot be written as y=mx+by = mx + by=mx+b, because their slope is undefined. Their equations look like x=3x = 3x=3.

Common questions

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

mmm is the slope (rise over run) and bbb is the yyy-intercept, the yyy-value where the line crosses the yyy-axis.

Is y = mx + c the same as y = mx + b?

Yes. The UK usually writes ccc for the intercept and the US writes bbb. The meaning is identical.

Practise equation of a line

The Slope-Intercept Form lesson has worked examples and unlimited practice that adapts to you.

Open the lesson

On this page

  1. Graphing from the equation
  2. Rearranging into this form
  3. Writing the equation of a line
  4. Parallel and perpendicular lines
  5. Common questions
Lessons on this
  • Slope-Intercept FormGraphs & Linear Equations
  • Writing Equations of LinesGraphs & Linear Equations
  • Systems of Linear EquationsGraphs & Linear Equations
  • ProportionsRatios & Proportions
Related reading4
Ideas this article builds on or leads to.
  • Graphs & Functions
    Slope (Gradient) of a Line: Rise Over Run Explained

    The slope, or gradient, of a line measures its steepness: how much yyy changes for each step of 111 in xxx. Between two points, m=riserun=y2−y1x2−x1m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1}m=runrise​=x2​−x1​y2​−y1​​.

  • Graphs & Functions
    The Coordinate Plane: Axes, Quadrants and Plotting Points

    The coordinate plane is a grid made by two perpendicular number lines, the xxx-axis and the yyy-axis. Every point has an address (x,y)(x, y)(x,y): how far across, then how far up.

  • Graphs & Functions
    Systems of Equations: Solving by Substitution, Elimination and Graphing

    A system of equations (or simultaneous equations) is a set of equations that must all be true at once. For two linear equations, the solution is the point where their lines intersect.

  • Ratio & Proportion
    Direct Proportion and Cross-Multiplication

    A proportion says two ratios are equal, such as 37.50=5x\frac{3}{7.50} = \frac{5}{x}7.503​=x5​. Two quantities are directly proportional when one is always the same multiple of the other: y=kxy = kxy=kx.