Difference Quotient

The difference quotient of a function f is \frac{f(x + h) - f(x)}{h}, with h \ne 0. It gives the slope of the secant line between the points at x and x + h, which is the average rate of change over that interval. To simplify it, find f(x + h), subtract f(x), and cancel the factor of h.

Before this lesson: You should know Function Notation, Average Rate of Change and Multiplying Binomials.

What the Difference Quotient Means

Pick a point on a graph at x, then a second point a small step h to the right. The run between them is h, and the rise is f(x + h) - f(x). Rise over run is the slope of the line through the two points, called a secant line.

The difference quotient is that slope written for any x and any step h. In calculus, you will let h shrink toward 0. The secant line then turns into the tangent line, and the difference quotient becomes the derivative. That is why simplifying it carefully matters now.

Graph of the parabola y = f(x) in solid blue. Two green points, (x, f(x)) and (x + h, f(x + h)), are joined by a dashed orange secant line. Dashed green segments show the run h and the rise f(x + h) − f(x).
The difference quotient is rise over run: f(x + h) − f(x) divided by h, the slope of the secant line.

The Difference Quotient Formula

\frac{f(x + h) - f(x)}{h}, \quad h \ne 0
  1. Find f(x + h) by replacing every x in the rule with (x + h). Expand and simplify.
  2. Subtract f(x). Use parentheses so every sign changes. The terms without h should cancel.
  3. Factor h out of every term on top, then cancel it with the h on the bottom.

If a term without h is left on top after subtracting, look for a mistake. For fractions, combine them over a common denominator first. For square roots, multiply by the conjugate.

Worked Examples

Example 1: A linear function

Find and simplify the difference quotient for f(x) = 3x + 5.

f(x + h) = 3(x + h) + 5 = 3x + 3h + 5

Find f(x + h).

f(x + h) - f(x) = (3x + 3h + 5) - (3x + 5)

Subtract f(x).

3x + 3h + 5 - 3x - 5 = 3h

Distribute the minus sign and combine like terms.

\frac{3h}{h} = 3

Divide by h.

Answer: 3. A line has the same slope everywhere, so its difference quotient is just its slope.

Example 2: A quadratic function

Find and simplify the difference quotient for f(x) = 2x^2 - 3x + 1.

(x + h)^2 = x^2 + 2xh + h^2

Square the binomial (see special products of binomials)

2(x^2 + 2xh + h^2) - 3(x + h) + 1

Find f(x + h).

f(x + h) = 2x^2 + 4xh + 2h^2 - 3x - 3h + 1

Distribute.

(2x^2 + 4xh + 2h^2 - 3x - 3h + 1) - (2x^2 - 3x + 1)

Subtract f(x).

4xh + 2h^2 - 3h

Cancel 2x^2, -3x and 1.

h(4x + 2h - 3)

Factor out h (see factoring out the GCF)

\frac{h(4x + 2h - 3)}{h} = 4x + 2h - 3

Divide by h.

Answer: 4x + 2h - 3

Example 3: A reciprocal function

Find and simplify the difference quotient for f(x) = \frac{1}{x}.

\frac{\frac{1}{x + h} - \frac{1}{x}}{h}

Write the quotient.

\frac{1}{x + h} - \frac{1}{x} = \frac{x - (x + h)}{x(x + h)}

Subtract the fractions over the common denominator x(x + h) (see adding and subtracting rational expressions)

Simplify the top: x - x - h = -h, so the difference is \frac{-h}{x(x + h)}

\frac{-h}{x(x + h)} \cdot \frac{1}{h}

Divide by h, which means multiplying by \frac{1}{h}.

-\frac{1}{x(x + h)}

Cancel h.

Answer: -\frac{1}{x(x + h)}

Example 4: A square root function

Find and simplify the difference quotient for f(x) = \sqrt{x}.

\frac{\sqrt{x + h} - \sqrt{x}}{h}

Write the quotient.

\frac{(\sqrt{x + h} - \sqrt{x})(\sqrt{x + h} + \sqrt{x})}{h(\sqrt{x + h} + \sqrt{x})}

Multiply the top and bottom by the conjugate \sqrt{x + h} + \sqrt{x} (see rationalizing the denominator)

(\sqrt{x + h})^2 - (\sqrt{x})^2 = (x + h) - x = h

Multiply the top as a difference of squares.

\frac{h}{h(\sqrt{x + h} + \sqrt{x})}

Rewrite.

\frac{1}{\sqrt{x + h} + \sqrt{x}}

Cancel h.

Answer: \frac{1}{\sqrt{x + h} + \sqrt{x}}

Example 5: Word problem with a thrown ball

A ball’s height is s(t) = -16t^2 + 64t feet after t seconds. Find the difference quotient, then use it to find the ball’s average velocity from t = 1 to t = 1.5.

-16(t + h)^2 + 64(t + h) = -16(t^2 + 2th + h^2) + 64t + 64h

Find s(t + h).

s(t + h) = -16t^2 - 32th - 16h^2 + 64t + 64h

Distribute.

Subtract s(t) = -16t^2 + 64t: the -16t^2 and 64t cancel, leaving -32th - 16h^2 + 64h

\frac{h(-32t - 16h + 64)}{h} = -32t - 16h + 64

Factor out h and cancel.

-32(1) - 16(0.5) + 64

Use t = 1 and h = 1.5 - 1 = 0.5.

-32 - 8 + 64 = 24

Multiply, then add.

Answer: The difference quotient is -32t - 16h + 64, and the average velocity from 1 to 1.5 seconds is 24 feet per second. Check: s(1.5) = 60 and s(1) = 48, and \frac{60 - 48}{0.5} = 24.

Common Mistakes

MistakeExample of the errorFix
Writing f(x) + h for f(x + h)For f(x) = x^2, using x^2 + hReplace every x with (x + h): (x + h)^2.
Squaring a sum wrong(x + h)^2 = x^2 + h^2(x + h)^2 = x^2 + 2xh + h^2.
Not distributing the minus sign2x^2 + 4xh - 2x^2 - 3x + 1Put f(x) in parentheses and change every sign.
Canceling h from only one term\frac{4xh + 2h^2 - 3h}{h} = 4x + 2h^2 - 3Factor h out of every term first, then cancel.
Letting h = 0 too earlyPlugging in h = 0 before simplifyingYou can’t divide by 0. Simplify first; h = 0 only comes later, in calculus.

Related Methods

Average rate of change

Between x = a and x = b, the average rate of change is \frac{f(b) - f(a)}{b - a}. That is the difference quotient with x = a and h = b - a.

Toward the derivative

In Example 2, letting h get closer and closer to 0 turns 4x + 2h - 3 into 4x - 3. That expression is the slope of the tangent line, the derivative you will meet in calculus.

The other form

Some books use \frac{f(x) - f(a)}{x - a} instead. It finds the same secant slope, between a and x.

Practice Problems

Find and simplify the difference quotient \frac{f(x + h) - f(x)}{h} for each function.

  1. f(x) = 7x - 2
  2. f(x) = x^2 + 4
  3. f(x) = -x^2 + 5x
  4. f(x) = 3x^2 - x + 6
  5. f(x) = x^3
  6. f(x) = \frac{2}{x}
  7. f(x) = \frac{1}{x + 1}
  8. f(x) = \sqrt{x + 3}
  9. For f(x) = x^2, find the value of the difference quotient at x = 3 with h = 0.1.
  10. A company’s cost is C(x) = 0.5x^2 + 20x dollars for x items. Find the difference quotient, then the average cost per extra item from x = 10 to x = 11.
Show answers

1.

f(x + h) = 7(x + h) - 2 = 7x + 7h - 2

Find f(x + h): substitute x + h and expand.

(7x + 7h - 2) - (7x - 2) = 7h

Subtract.

\frac{7h}{h} = 7

Divide by h.

Answer: 7

2.

f(x + h) = (x + h)^2 + 4 = x^2 + 2xh + h^2 + 4

Find f(x + h): substitute x + h and expand.

(x^2 + 2xh + h^2 + 4) - (x^2 + 4) = 2xh + h^2

Subtract.

\frac{h(2x + h)}{h} = 2x + h

Factor and cancel.

Answer: 2x + h

3.

f(x + h) = -(x + h)^2 + 5(x + h) = -x^2 - 2xh - h^2 + 5x + 5h

Find f(x + h): substitute x + h and expand.

-2xh - h^2 + 5h

Subtract -x^2 + 5x.

\frac{h(-2x - h + 5)}{h} = -2x - h + 5

Factor and cancel.

Answer: -2x - h + 5

4.

f(x + h) = 3(x^2 + 2xh + h^2) - (x + h) + 6 = 3x^2 + 6xh + 3h^2 - x - h + 6

Find f(x + h): substitute x + h and expand.

6xh + 3h^2 - h

Subtract 3x^2 - x + 6.

\frac{h(6x + 3h - 1)}{h} = 6x + 3h - 1

Factor and cancel.

Answer: 6x + 3h - 1

5.

(x + h)^3 = x^3 + 3x^2 h + 3xh^2 + h^3

Expand.

3x^2 h + 3xh^2 + h^3

Subtract x^3.

\frac{h(3x^2 + 3xh + h^2)}{h} = 3x^2 + 3xh + h^2

Factor and cancel.

Answer: 3x^2 + 3xh + h^2

6.

\frac{2}{x + h} - \frac{2}{x} = \frac{2x - 2(x + h)}{x(x + h)} = \frac{-2h}{x(x + h)}

Subtract.

\frac{-2h}{x(x + h)} \cdot \frac{1}{h} = -\frac{2}{x(x + h)}

Divide by h.

Answer: -\frac{2}{x(x + h)}

7.

\frac{1}{x + h + 1} - \frac{1}{x + 1} = \frac{(x + 1) - (x + h + 1)}{(x + 1)(x + h + 1)} = \frac{-h}{(x + 1)(x + h + 1)}

Subtract.

Divide by h and cancel
Answer: -\frac{1}{(x + 1)(x + h + 1)}

8.

\frac{(\sqrt{x + h + 3} - \sqrt{x + 3})(\sqrt{x + h + 3} + \sqrt{x + 3})}{h(\sqrt{x + h + 3} + \sqrt{x + 3})}

Multiply by the conjugate.

(x + h + 3) - (x + 3) = h

Simplify the top. The square roots cancel.

Cancel h
Answer: \frac{1}{\sqrt{x + h + 3} + \sqrt{x + 3}}

9.

From Problem 2’s pattern, the quotient is 2x + h

2(3) + 0.1 = 6.1

Substitute.

Check: \frac{3.1^2 - 3^2}{0.1} = \frac{9.61 - 9}{0.1} = 6.1
Answer: 6.1

10.

C(x + h) = 0.5(x^2 + 2xh + h^2) + 20(x + h) = 0.5x^2 + xh + 0.5h^2 + 20x + 20h

Find C(x + h): substitute x + h and expand.

xh + 0.5h^2 + 20h

Subtract C(x).

x + 0.5h + 20

Factor and cancel.

10 + 0.5 + 20 = 30.5

Substitute x = 10, h = 1.

Answer: x + 0.5h + 20; about $30.50 per extra item

FAQ

What is the difference quotient used for?

It gives the slope of a secant line, the average rate of change of a function over a small interval. In calculus, its limit as h approaches 0 defines the derivative.

Why can’t h equal 0?

The formula divides by h, and dividing by 0 is undefined. With h = 0, the two points would also be the same point, so there would be no secant line.

How do you simplify a difference quotient with fractions?

Subtract the fractions over a common denominator, simplify the top so a factor of h appears, then cancel it with the h you divide by.

How do you simplify a difference quotient with a square root?

Multiply the top and bottom by the conjugate. The top becomes a difference of squares, the square roots disappear, and a factor of h cancels.

Summary

  • The difference quotient is \frac{f(x + h) - f(x)}{h}, with h \ne 0.
  • It is the slope of the secant line, the average rate of change from x to x + h.
  • Replace every x with (x + h), subtract f(x) in parentheses, then factor out and cancel h.
  • Use a common denominator for fractions and the conjugate for square roots.
  • As h approaches 0, it becomes the derivative.

Previous lesson: Even and Odd Functions

Next lesson: Rates of Change of Functions

Back to the Precalculus Index