The average rate of change of $f$ between two inputs is rise over run. If the inputs are $x$ and $x + h$, that slope has a general formula. Simplifying it is the first step toward calculus, and it relies on evaluating a function at an expression like $x + h$.
Key idea
The difference quotient $$\frac{f(x + h) - f(x)}{h}, \quad h \ne 0,$$ is the slope of the secant line through $(x, f(x))$ and $(x + h, f(x + h))$. To simplify: find $f(x + h)$ by replacing every $x$ with $(x + h)$, subtract $f(x)$, then divide out the factor $h$.
Why it works
The two points are $h$ apart horizontally (the run) and $f(x + h) - f(x)$ apart vertically (the rise). As $h$ shrinks, the second point slides toward the first and the secant line turns into the tangent line. Calculus studies exactly what the difference quotient approaches as $h \to 0$, so getting it into a form where $h$ is not in the denominator is the key move.
Worked examples
Worked example: A quadratic
For $f(x) = x^2 + 3x$, simplify the difference quotient.
- $$f(x + h) = (x + h)^2 + 3(x + h) = x^2 + 2xh + h^2 + 3x + 3h.$$
- Subtract $f(x) = x^2 + 3x$: $2xh + h^2 + 3h$.
- Divide by $h$: $2x + h + 3$.
Answer: $2x + h + 3$
Worked example: A reciprocal
For $f(x) = \dfrac{1}{x}$, simplify the difference quotient.
- $$f(x + h) - f(x) = \dfrac{1}{x + h} - \dfrac{1}{x} = \dfrac{x - (x + h)}{x(x + h)} = \dfrac{-h}{x(x + h)}.$$
- Divide by $h$.
Answer: $-\frac{1}{x(x + h)}$
Worked example: With numbers
For $f(x) = x^2$, find the slope of the secant from $x = 3$ to $x = 3.1$.
- $\dfrac{f(3.1) - f(3)}{0.1} = \dfrac{9.61 - 9}{0.1}$.
- $= 6.1$. The formula $2x + h$ with $x = 3$, $h = 0.1$ agrees.
Answer: $6.1$
Common mistake
Writing $f(x + h)$ as $f(x) + h$ or as $f(x) + f(h)$. Replace every $x$ in the formula with $(x + h)$, parentheses included. Check with numbers: for $f(x) = x^2$, $f(2 + 1) = 9$, but $f(2) + 1 = 5$ and $f(2) + f(1) = 5$.