Difference Quotient Calculator (Simplified, with Steps)
- Free
- No sign-up
- Works on phones
- Shows the working
This difference quotient calculator works through ( frac{f(x+h) – f(x)}{h} ) the way a teacher expects on homework: it writes ( f(x + h) ), expands ( f(x+h) – f(x) ), cancels the h, and then lets ( h to 0 ) to give the derivative. Enter an x-value and an h-value as well if you want a number.
It’s free and needs no sign-up.

How to use it
- Type ( f(x) ), for example
x^2 + 3xor2x^3 - x + 5. Use x as the variable; h is reserved for the step. - Optionally enter a value of x and of h to evaluate the quotient numerically.
- Press Simplify.
For polynomials the calculator shows every expansion and the fully simplified quotient. For other functions (roots, fractions, trig) it shows the quotient before simplifying and gives the limit, which is the derivative.
Formula
$$frac{f(x + h) - f(x)}{h}$$
The difference quotient is the slope of the secant line between ( (x, f(x)) ) and ( (x + h, f(x + h)) ). Its limit as ( h to 0 ) is the derivative:
$$f'(x) = lim_{h to 0} frac{f(x+h) - f(x)}{h}$$
Worked example: f(x) = x² + 3x
Step 1. Replace every x with ( (x + h) ):
$$f(x + h) = (x + h)^2 + 3(x + h) = x^2 + 2xh + h^2 + 3x + 3h$$
Step 2. Subtract ( f(x) = x^2 + 3x ). The ( x^2 ) and ( 3x ) cancel:
$$f(x+h) - f(x) = 2xh + h^2 + 3h$$
Step 3. Divide by h. Every term has a factor of h:
$$frac{2xh + h^2 + 3h}{h} = 2x + h + 3$$
Step 4. Let ( h to 0 ): ( f'(x) = 2x + 3 ). As a result, that matches the power rule.
Worked example: a cubic
For ( f(x) = 2x^3 – x + 5 ), expanding ( 2(x + h)^3 ) with the binomial pattern ( (x+h)^3 = x^3 + 3x^2h + 3xh^2 + h^3 ) gives
$$f(x+h) - f(x) = 6x^2h + 6xh^2 + 2h^3 - h$$
Dividing by h:
$$frac{f(x+h) - f(x)}{h} = 6x^2 + 6xh + 2h^2 - 1$$
As a result, the limit is ( f'(x) = 6x^2 – 1 ). With ( x = 1 ) and ( h = 0.1 ), the quotient is ( 6 + 0.6 + 0.02 – 1 = 5.62 ), close to ( f'(1) = 5 ).
Worked example: f(x) = 1/x
Fractions need a common denominator:
$$frac{frac{1}{x+h} - frac{1}{x}}{h} = frac{x - (x + h)}{h,x(x+h)} = frac{-h}{h,x(x+h)} = -frac{1}{x(x+h)}$$
As ( h to 0 ) this becomes ( -frac{1}{x^2} ).
Worked example: f(x) = √x
Multiply by the conjugate to clear the root from the numerator:

$$frac{sqrt{x+h} - sqrt{x}}{h} cdot frac{sqrt{x+h} + sqrt{x}}{sqrt{x+h} + sqrt{x}} = frac{h}{h(sqrt{x+h} + sqrt{x})} = frac{1}{sqrt{x+h} + sqrt{x}}$$
As ( h to 0 ) this becomes ( frac{1}{2sqrt{x}} ).
Common mistakes
- Writing ( f(x) + h ) instead of ( f(x + h) ). Substitute ( (x + h) ) for x everywhere, with brackets.
- Expanding ( (x+h)^2 ) as ( x^2 + h^2 ). However, the middle term ( 2xh ) is essential.
- Forgetting to distribute the minus sign when subtracting ( f(x) ).
- Setting h = 0 too early. You must cancel the h in the denominator first, or you get ( frac{0}{0} ).
Step-by-step method
- Write ( f(x + h) ) by replacing every x with ( (x + h) ), keeping the brackets.
- Expand and simplify ( f(x + h) ).
- Subtract ( f(x) ), distributing the minus sign to every term.
- Check that every remaining term has a factor of h (if not, look for an algebra slip).
- Divide by h.
- To get the derivative, set h = 0 in the simplified result.
Worked example: f(x) = 3x² − 5x + 2
$$f(x + h) = 3(x^2 + 2xh + h^2) - 5x - 5h + 2 = 3x^2 + 6xh + 3h^2 - 5x - 5h + 2$$
Subtracting ( f(x) = 3x^2 – 5x + 2 ) leaves ( 6xh + 3h^2 – 5h ), and dividing by h:
$$frac{f(x + h) - f(x)}{h} = 6x + 3h - 5$$
Letting ( h to 0 ) gives ( f'(x) = 6x – 5 ).
Evaluating at a point
For ( f(x) = x^2 ) at ( x = 3 ) with ( h = 0.1 ):
$$frac{f(3.1) - f(3)}{0.1} = frac{9.61 - 9}{0.1} = 6.1$$
The simplified quotient ( 2x + h ) gives the same ( 2(3) + 0.1 = 6.1 ), and as h shrinks the value approaches the derivative ( f'(3) = 6 ).
Why use a difference quotient calculator to find the difference quotient
- It defines the derivative. For example, every derivative rule, from the power rule to the product rule, is proved by simplifying a difference quotient.
- Numerical derivatives. Computers estimate derivatives with small-h difference quotients when no formula is available.
- Finite differences. Engineers and data scientists use the same idea on measured data, such as estimating speed from positions recorded every second.
Practice problems
- ( f(x) = 4x – 7 ).
- ( f(x) = x^3 ).
- ( f(x) = frac{2}{x} ).
Answers: 1. ( frac{4(x + h) – 7 – (4x – 7)}{h} = 4 ): a line has the same slope everywhere. 2. ( 3x^2 + 3xh + h^2 ), which tends to ( 3x^2 ). 3. ( -frac{2}{x(x + h)} ), which tends to ( -frac{2}{x^2} ).
Difference quotient of sin x
Using ( sin(x + h) = sin xcos h + cos xsin h ):
$$frac{sin(x + h) - sin x}{h} = sin x cdot frac{cos h - 1}{h} + cos x cdot frac{sin h}{h}$$
As ( h to 0 ), ( frac{sin h}{h} to 1 ) and ( frac{cos h – 1}{h} to 0 ), so the derivative of ( sin x ) is ( cos x ). The limit of sin x over x explains the first of those limits.
Forward, backward and central differences
| Name | Formula | Accuracy |
|---|---|---|
| Forward | ( frac{f(x + h) – f(x)}{h} ) | error about proportional to h |
| Backward | ( frac{f(x) – f(x – h)}{h} ) | error about proportional to h |
| Central | ( frac{f(x + h) – f(x – h)}{2h} ) | error about proportional to ( h^2 ) |
Related guides
Further reading
- Difference quotient (Wikipedia) — definition and its role in the derivative.
FAQ
What is the difference quotient?
The expression ( frac{f(x+h) – f(x)}{h} ): the slope of the secant line between x and ( x + h ) on the graph of f.
Why do we simplify the difference quotient?
So that the h in the denominator cancels. Then you can let ( h to 0 ) without dividing by zero, and the result is the derivative.
What is the difference quotient of x²?
( frac{(x+h)^2 – x^2}{h} = 2x + h ), which tends to ( 2x ) as ( h to 0 ).
Is the difference quotient the derivative?
Not quite. However, the derivative is its limit as ( h to 0 ). For a non-zero h, the difference quotient is an average rate of change.
What is the difference quotient of a linear function?
The slope m, with no h left over: for ( f(x) = mx + b ), ( frac{f(x + h) – f(x)}{h} = m ).
What is the symmetric difference quotient?
( frac{f(x + h) – f(x – h)}{2h} ). However, it uses points on both sides and usually approximates the derivative more accurately for the same h.
