letx=

Calculus basics

Difference quotient

The slope of a secant line over a small step h; its limit as h → 0 is the derivative.

f′(x)=limh→0f(x+h)−f(x)h

Calculator

The live calculator needs JavaScript. The worked example below shows the same steps it would.

See it move

−4−3−2−1123455101520
  • Secant slope Q = 6.1 (coral); tangent slope f′(x) = 6 (dashed). Slide h towards 0 and the secant turns into the tangent.

What the symbols mean

Q
the difference quotient: the slope of the secant through x and x + h
c3
the coefficient of x3 in f
c2
the coefficient of x2
c1
the coefficient of x
c0
the constant term
x
the point
h
the step (any non-zero number)

When to use it

Use it to differentiate from first principles (a standard exam question), to estimate a derivative from data or a table, and to see what a derivative is: the average rate of change over a shrinking interval. Try h = 0.1, 0.01, 0.001 in the calculator and watch Q approach the exact slope.

Worked example

For f(x) = x², find the difference quotient at x = 3 with h = 0.1 (c₃ = 0, c₂ = 1, c₁ = 0, c₀ = 0).

  1. The difference quotient is the slope of the secant line through (x, f(x)) and (x + h, f(x + h)):

    Q=f(x+h)−f(x)h
  2. The function is

    f(x)=x2
  3. Evaluate at x + h:

    f(3.1)=3.12
    =9.61
  4. Evaluate at x:

    f(3)=32
    =9
  5. Divide the rise by the run h:

    Q=f1−f0h
    =9.61−90.1
    =0.610.1
    =6.1
  6. Compare with the exact derivative, from the power rule:

    f′(x)=2⁢x
  7. f′(3)=2·3
    =6
  8. The difference is 0.1; make h smaller and Q approaches f′(x). That limit is the definition of the derivative.

Answer Q = 6.1, close to the exact slope f′(3) = 6

Why it works

Over a step h the curve rises f(x+h)−f(x), so the secant's slope is rise over run. As h shrinks, the second point slides towards the first and the secant turns into the tangent. For f(x)=x2 the quotient simplifies to 2x+h, which tends to 2x.

Common mistakes

  • Setting h = 0 straight away, which gives 0/0. Simplify first, then let h tend to 0.
  • Writing f(x)+h instead of f(x+h): for x2 the second is x2+2xh+h2.
  • Forgetting the minus applies to all of f(x) when it has several terms.