Calculus · Grade 12 and undergraduate

The Derivative: Slope of the Tangent Line and Rate of Change

Quick answer

The average rate of change of f from a to a + h is the slope of a secant line, (f(a + h) − f(a))/h. Letting h shrink to 0 turns secants into the tangent line and averages into an instantaneous rate: that limit is the derivative f′(a). Computed at every x it gives a new function, f′(x), also written dy/dx. A function is not differentiable at a corner, a cusp, a vertical tangent or a discontinuity; differentiability implies continuity, but not the reverse.

What you'll learn

  • Compute an average rate of change as the slope of a secant line
  • Find a derivative from the limit definition
  • Write the equation of a tangent line
  • Identify where a function is not differentiable, and why

Average rate of change

Over an interval from aa to a+ha + h, a function changes by f(a+h)−f(a)f(a + h) - f(a) while the input changes by hh. The ratio

f(a+h)−f(a)h\frac{f(a + h) - f(a)}{h}

is the average rate of change, called the difference quotient. It is the slope of the secant line through (a,f(a))\big(a, f(a)\big) and (a+h,f(a+h))\big(a + h, f(a + h)\big).

From secant to tangent

Take f(x)=x2f(x) = x^2 and a=1a = 1. As hh shrinks, the secant lines pivot around (1,1)(1, 1) and settle onto the tangent line.

Secant lines settling onto the tangent The parabola y = x squared with three lines through the point (1, 1): a dashed secant through (2, 4) with slope 3, a dashed secant through (1.5, 2.25) with slope 2.5, and the tangent line y = 2x − 1 with slope 2. -1123-2246xy (1, 1)
  • y = x²
  • secant, h = 1
  • secant, h = 0.5
  • tangent
Secant lines settling onto the tangent
hh110.50.50.10.10.010.010.0010.001
secant slope332.52.52.12.12.012.012.0012.001

The slopes approach 22, and algebra confirms it: (1+h)2−1h=2h+h2h=2+h→2\tfrac{(1 + h)^2 - 1}{h} = \tfrac{2h + h^2}{h} = 2 + h \to 2.

The definition

The derivative of ff at aa is

f′(a)=lim⁡h→0f(a+h)−f(a)hf'(a) = \lim_{h \to 0} \frac{f(a + h) - f(a)}{h}

when this limit exists. Geometrically it is the slope of the tangent line at (a,f(a))\big(a, f(a)\big). Physically it is the instantaneous rate of change of ff at aa, measured in units of output per unit of input.

The tangent line itself is

y−f(a)=f′(a)(x−a)y - f(a) = f'(a)(x - a)

Why the derivative has to be a limit

“The rate of change at an instant” sounds like a paradox. A rate compares two changes, and at a single instant nothing has changed: setting h=0h = 0 in the difference quotient gives 00\tfrac{0}{0}.

That is precisely the kind of expression limits were built for. The limit never sets h=0h = 0. It asks what the averages over ever shorter intervals are heading toward. When they close in on a single number, that number is the only sensible meaning of the instantaneous rate. The derivative is the limit of average rates, because no single average can capture an instant.

The derivative as a function

Letting the point vary gives a new function, the derivative:

f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}

For f(x)=x2f(x) = x^2 the same algebra gives f′(x)=2xf'(x) = 2x. Other common notations are

f′(x),y′,dydx,ddxf(x)f'(x), \qquad y', \qquad \frac{dy}{dx}, \qquad \frac{d}{dx} f(x)

The dydx\tfrac{dy}{dx} notation, due to Leibniz, recalls where the derivative came from: a small change in yy over a small change in xx.

Where the derivative fails

A differentiable function is continuous: if f′(a)f'(a) exists, then f(a+h)−f(a)=h⋅f(a+h)−f(a)h→0⋅f′(a)=0f(a + h) - f(a) = h \cdot \tfrac{f(a + h) - f(a)}{h} \to 0 \cdot f'(a) = 0. The converse is false. A function can be continuous and still have no derivative at a point:

Continuous but not differentiable at 0 Three graphs through the origin: y = |x| with a sharp corner, y = x to the two-thirds with a pointed cusp, and y = cube root of x with a vertical tangent line. -3-2-1123-2-1123xy
  • y = |x| (corner)
  • y = x^(2/3) (cusp)
  • y = ∛x (vertical tangent)
Continuous but not differentiable at 0
  • Corner: the one-sided slopes differ (−1-1 and 11 for ∣x∣|x|).
  • Cusp: the one-sided slopes go to +∞+\infty and −∞-\infty.
  • Vertical tangent: the slopes go to ∞\infty from both sides.
  • Discontinuity: a function that is not continuous at aa cannot be differentiable there.

Worked examples

Common mistakes

Practice problems

  1. Find the average rate of change of f(x)=x3f(x) = x^3 from x=1x = 1 to x=3x = 3.

    Answer

    1313

    Full solution

    f(3)−f(1)3−1=27−12=13\tfrac{f(3) - f(1)}{3 - 1} = \tfrac{27 - 1}{2} = 13.

  2. Use the definition to find f′(2)f'(2) for f(x)=3x2−xf(x) = 3x^2 - x.

    Answer

    1111

    Full solution

    f(2+h)−f(2)=3(4+4h+h2)−(2+h)−10=11h+3h2f(2 + h) - f(2) = 3(4 + 4h + h^2) - (2 + h) - 10 = 11h + 3h^2. Divided by hh: 11+3h→1111 + 3h \to 11.

  3. Use the definition to find f′(x)f'(x) for f(x)=5x+2f(x) = 5x + 2.

    Answer

    55

    Full solution

    5(x+h)+2−(5x+2)h=5hh=5\tfrac{5(x + h) + 2 - (5x + 2)}{h} = \tfrac{5h}{h} = 5. A line has the same slope everywhere.

  4. Find the tangent line to y=x2y = x^2 at x=−1x = -1.

    Answer

    y=−2x−1y = -2x - 1

    Full solution

    f′(x)=2xf'(x) = 2x, so the slope is −2-2 and the point is (−1,1)(-1, 1). Then y−1=−2(x+1)y - 1 = -2(x + 1), so y=−2x−1y = -2x - 1.

  5. Use the definition to find f′(x)f'(x) for f(x)=x3f(x) = x^3.

    Answer

    3x23x^2

    Full solution

    (x+h)3−x3=3x2h+3xh2+h3(x + h)^3 - x^3 = 3x^2h + 3xh^2 + h^3. Divided by hh: 3x2+3xh+h2→3x23x^2 + 3xh + h^2 \to 3x^2.

  6. A ball’s height is s(t)=20t−5t2s(t) = 20t - 5t^2 meters after tt seconds. Find its velocity at t=1t = 1.

    Answer

    1010 meters per second

    Full solution

    s(1+h)−s(1)=20h−5(2h+h2)=10h−5h2s(1 + h) - s(1) = 20h - 5(2h + h^2) = 10h - 5h^2. Divided by hh: 10−5h→1010 - 5h \to 10.

  7. Use the definition to find f′(x)f'(x) for f(x)=1x+2f(x) = \tfrac{1}{x + 2}.

    Answer

    −1(x+2)2-\tfrac{1}{(x + 2)^2}

    Full solution

    1x+h+2−1x+2=−h(x+h+2)(x+2)\tfrac{1}{x + h + 2} - \tfrac{1}{x + 2} = \tfrac{-h}{(x + h + 2)(x + 2)}. Divided by hh: −1(x+h+2)(x+2)→−1(x+2)2\tfrac{-1}{(x + h + 2)(x + 2)} \to -\tfrac{1}{(x + 2)^2}.

  8. Is f(x)=∣x−2∣f(x) = |x - 2| differentiable at x=2x = 2? At x=5x = 5?

    Answer

    Not at 22; yes at 55 (with f′(5)=1f'(5) = 1).

    Full solution

    At 22 the graph has a corner: the one-sided slopes are −1-1 and 11. Near 55, f(x)=x−2f(x) = x - 2, a line with slope 11.

  9. The limit lim⁡h→0(2+h)4−16h\lim_{h \to 0} \tfrac{(2 + h)^4 - 16}{h} is f′(a)f'(a) for which function ff and number aa?

    Answer

    f(x)=x4f(x) = x^4 and a=2a = 2

    Full solution

    It matches f(a+h)−f(a)h\tfrac{f(a + h) - f(a)}{h} with f(a+h)=(2+h)4f(a + h) = (2 + h)^4 and f(a)=16=24f(a) = 16 = 2^4.

  10. A student finds the tangent line to y=x2y = x^2 at x=1x = 1 as y−1=2x(x−1)y - 1 = 2x(x - 1). What went wrong?

    Hint

    Is that equation a line?

    Answer

    The slope must be the number f′(1)=2f'(1) = 2, not the function 2x2x. The tangent is y=2x−1y = 2x - 1.

    Full solution

    y−1=2x(x−1)y - 1 = 2x(x - 1) is a parabola. A tangent line needs one fixed slope: the derivative evaluated at the point.

    With f′(1)=2f'(1) = 2: y−1=2(x−1)y - 1 = 2(x - 1), so y=2x−1y = 2x - 1.

Frequently asked questions

What is the derivative?

The limit of the difference quotient: f′(a) = lim as h → 0 of (f(a + h) − f(a))/h. It is the slope of the tangent line at a and the instantaneous rate of change of f there.

What is the difference between average and instantaneous rate of change?

The average rate is the change over an interval, the slope of a secant line. The instantaneous rate is the limit of those averages as the interval shrinks to a point.

How do I find the equation of a tangent line?

Find the point (a, f(a)) and the slope f′(a), then use point-slope form: y − f(a) = f′(a)(x − a).

Where is a function not differentiable?

At corners, cusps, vertical tangents and discontinuities — anywhere the difference quotient has no finite limit.

Does differentiable mean continuous?

Yes, a differentiable function is continuous. The reverse fails: |x| is continuous at 0 but has a corner there.

What to learn next