Prerequisites: lines, exponents, logs, trig

Equation of a line, y=a(x−p)+q

If you know the slope and one point, the line is y=a(x−p)+qy=a(x-p)+q.

y=a(x−p)+qy=a(x-p)+q

A line with slope aa through the point (p, q)(p,\,q) is y=a(x−p)+qy=a(x-p)+q. Expanding gives y=ax+(q−ap)y=ax+(q-ap), the y=ax+by=ax+b form, where bb is the yy-intercept.

Given two points (x1, y1)(x_1,\,y_1) and (x2, y2)(x_2,\,y_2), first find the slope, then substitute either point as (p, q)(p,\,q).

a=y2−y1x2−x1a=\frac{y_2-y_1}{x_2-x_1}

The tangent line y=f′(a)(x−a)+f(a)y=f'(a)(x-a)+f(a) is exactly this form, with slope f′(a)f'(a) through (a, f(a))(a,\,f(a)).

xy(x₁, y₁)(x₂, y₂)x₂ − x₁y₂ − y₁
The slope a is rise over run. One point plus the slope determines the line.Drag the dot

Examples

  1. 01Slope 2, through (0, −2). What is the y-intercept?\displaystyle AnswerHide
    Answer−2\displaystyle -2
  2. 02The line through these two points has slope −2. Write it as y=ax+b:(0, −1),(2, −5)\displaystyle (0,\ -1),\quad (2,\ -5)AnswerHide
    Answery=−2x−1\displaystyle y=-2x-1
  3. 03The line through these two points has slope −3. Write it as y=ax+b:(−3, 0),(−1, −6)\displaystyle (-3,\ 0),\quad (-1,\ -6)AnswerHide
    Answery=−3x−9\displaystyle y=-3x-9
  4. 04The line through these two points has slope 3. Write it as y=ax+b:(1, −3),(2, 0)\displaystyle (1,\ -3),\quad (2,\ 0)AnswerHide
    Answery=3x−6\displaystyle y=3x-6
  5. 05The line through these two points has slope 2. Write it as y=ax+b:(2, 2),(5, 8)\displaystyle (2,\ 2),\quad (5,\ 8)AnswerHide
    Answery=2x−2\displaystyle y=2x-2
  6. 06The line through these two points has slope 3. Write it as y=ax+b:(−2, 1),(1, 10)\displaystyle (-2,\ 1),\quad (1,\ 10)AnswerHide
    Answery=3x+7\displaystyle y=3x+7

FAQ

When should I use y=ax+b versus y=a(x−p)+q?
They describe the same line. y=a(x−p)+qy=a(x-p)+q shows the slope aa and a point (p,q)(p,q) directly; y=ax+by=ax+b shows the y-intercept bb. Expand to convert: b=q−apb=q-ap.

Published 2026-09-04 · Updated 2026-09-05