Differentiation From First Principles: A Four-Step Method
Learn differentiation from first principles with a repeatable four-step method, solved polynomial, reciprocal and square-root examples, and practice answers.
- 11th
You know that the derivative of x² is 2x. Then a question adds three words: from first principles.
Suddenly, writing 2x is not enough. You need to show where it comes from, and the expression involving f(x + h) can feel more confusing than the answer itself.
The good news is that most introductory questions follow the same four moves: shift, subtract, divide, and take the limit. The algebra changes, but the route stays familiar.
Let’s make that route dependable. We will start with a polynomial, handle fractions and square roots, and finish with a case where the derivative genuinely does not exist.
What does differentiation from first principles mean?
Differentiation from first principles means finding a derivative using its limit definition rather than applying a ready-made differentiation rule.
At an interior point of the function’s domain, the definition is:
f’(x) = lim as h → 0 of [f(x + h) - f(x)] / h, provided the two-sided limit exists as a finite number.
Read f’(x) as “f prime of x”. If y = f(x), you may also write the derivative as dy/dx.
Here is what each part does:
| Part | Meaning |
|---|---|
| x | The starting input, held fixed while h changes |
| h | A nonzero change in the input |
| x + h | The nearby input |
| f(x + h) - f(x) | The resulting change in the output |
| [f(x + h) - f(x)] / h | Average change in output per unit change in input |
| Limit as h → 0 | The instantaneous rate, if it exists |
On a graph, the quotient is the slope of a secant through two points. As the nearby point approaches the starting point, these slopes may approach the slope of the tangent. OpenStax’s definition of the derivative connects these two interpretations.
If limits still feel uncertain, first revisit left-hand limits, right-hand limits, and 0/0 forms.
The four-step setup you can reuse
Step 1: Shift the input
Find f(x + h) by replacing every x in f(x) with (x + h).
If f(x) = 3x² - 4x + 7, then:
f(x + h) = 3(x + h)² - 4(x + h) + 7.
It is not 3x² - 4x + 7 + h. We are changing the input before evaluating the function, not adding h to the old output.
Step 2: Subtract the original output
Form f(x + h) - f(x). Put the entire original expression in brackets:
[3(x + h)² - 4(x + h) + 7] - [3x² - 4x + 7].
Those brackets protect the signs. In particular, subtracting -4x gives +4x.
Step 3: Divide by h and simplify
Form the difference quotient:
[f(x + h) - f(x)] / h.
Expand, combine fractions, or rationalise as appropriate. For the algebraic examples here, the aim is to expose a common factor h that can be cancelled while h ≠ 0.
Step 4: Take the limit and state the domain
Find the limit of the simplified quotient as h → 0. Keep x fixed during this step.
If the simplified expression is continuous at h = 0, direct substitution now works. Finish with the derivative and any restrictions on x.
Worked example 1: A quadratic with several terms
Find the derivative of f(x) = 3x² - 4x + 7 from first principles.
Step 1: Shift.
f(x + h) = 3(x + h)² - 4(x + h) + 7
= 3x² + 6xh + 3h² - 4x - 4h + 7.
Step 2: Subtract.
f(x + h) - f(x)
= [3x² + 6xh + 3h² - 4x - 4h + 7] - [3x² - 4x + 7]
= 6xh + 3h² - 4h
= h(6x + 3h - 4).
Step 3: Divide.
For h ≠ 0,
[f(x + h) - f(x)] / h = 6x + 3h - 4.
Step 4: Take the limit.
f’(x) = lim as h → 0 of (6x + 3h - 4)
= 6x - 4, for all real x.
At x = 2, the slope is f’(2) = 8. Notice that f(2) = 11 is the height of the graph there; 8 is its slope. They answer different questions.
The tangent passes through (2, 11), so its equation is:
y - 11 = 8(x - 2), or y = 8x - 5.
A numerical check of the same answer
At x = 2, our simplified difference quotient is 8 + 3h.
| h | Difference quotient |
|---|---|
| -0.1 | 7.7 |
| -0.01 | 7.97 |
| 0.01 | 8.03 |
| 0.1 | 8.3 |
The values approach 8 from both directions. The table helps you see the result; the algebra establishes the exact limit.
Why can we cancel h if h approaches zero?
Because approaching zero and being zero are different conditions.
Before taking the limit, h is nonzero. Therefore h(6x + 3h - 4)/h and 6x + 3h - 4 agree for every permitted nonzero h near zero. They consequently have the same limit.
We never claim that the original quotient is defined at h = 0. We simplify on nearby inputs and then investigate what the simplified values approach.
Also, cancellation works with factors, not isolated pieces of a sum. You cannot simply cross out h wherever it appears. First show that the entire numerator has h as a factor.
Worked example 2: A cubic without using the power rule
Find the derivative of g(x) = x³ + 2x.
Start with the definition:
g’(x) = lim as h → 0 of {[(x + h)³ + 2(x + h)] - [x³ + 2x]} / h.
Expand the cube carefully:
(x + h)³ = x³ + 3x²h + 3xh² + h³.
So the difference in outputs is:
3x²h + 3xh² + h³ + 2h
= h(3x² + 3xh + h² + 2).
Divide by h, then take the limit:
g’(x) = lim as h → 0 of (3x² + 3xh + h² + 2) = 3x² + 2.
This holds for all real x. At x = -1, the derivative is 5, not -1. Squaring the negative input matters.
The common expansion error is to write (x + h)³ = x³ + h³. That drops both mixed terms, including the term that produces 3x² in the answer.
Worked example 3: A reciprocal needs a common denominator
Find the derivative of p(x) = 5/(x + 2) from first principles.
The original function requires x ≠ -2. While forming the quotient, x + h + 2 must also be nonzero.
Shift and subtract:
p(x + h) - p(x) = 5/(x + h + 2) - 5/(x + 2).
Combine the fractions:
= {5(x + 2) - 5(x + h + 2)} / [(x + h + 2)(x + 2)]
= -5h / [(x + h + 2)(x + 2)].
Divide this whole difference by h:
[p(x + h) - p(x)] / h = -5 / [(x + h + 2)(x + 2)].
Therefore:
p’(x) = -5/(x + 2)², for x ≠ -2.
As a check, p’(3) = -1/5. The negative sign tells us that the function decreases locally at x = 3.
Do not subtract the denominators. In general, A/B - C/D equals (AD - BC)/(BD), not (A - C)/(B - D).
Worked example 4: A square root needs its conjugate
Find the derivative of q(x) = √(2x + 5).
The function is real for x ≥ -5/2. Begin with x > -5/2 so that nearby inputs on both sides remain in its domain.
The difference quotient is:
[√(2x + 2h + 5) - √(2x + 5)] / h.
Multiply numerator and denominator by the conjugate:
√(2x + 2h + 5) + √(2x + 5).
The numerator becomes a difference of squares:
(2x + 2h + 5) - (2x + 5) = 2h.
Hence the quotient simplifies to:
2h / {h[√(2x + 2h + 5) + √(2x + 5)]}
= 2 / [√(2x + 2h + 5) + √(2x + 5)].
Now take the limit:
q’(x) = 2/[2√(2x + 5)] = 1/√(2x + 5), for x > -5/2.
At x = 2, q’(2) = 1/3.
What happens at the endpoint?
At a = -5/2, q(a) = 0. The right-hand difference quotient is:
[q(a + h) - q(a)]/h = √(2h)/h = √2/√h, with h > 0.
It grows without bound as h approaches zero. Thus there is no finite right-hand derivative there, and the ordinary two-sided derivative is unavailable at this domain endpoint.
This is why the derivative’s domain is x > -5/2, although the function itself includes x = -5/2.
Worked example 5: Differentiating sine from the definition
For trigonometric differentiation, use radians. The standard limit sin h / h → 1 assumes h is measured in radians.
Let f(x) = sin x. Then:
f’(x) = lim as h → 0 of [sin(x + h) - sin x]/h.
Use the angle-addition identity to rewrite the quotient as:
sin x [(cos h - 1)/h] + cos x [sin h/h].
The two standard limits are:
- lim as h → 0 of sin h/h = 1.
- lim as h → 0 of (cos h - 1)/h = 0.
Therefore f’(x) = sin x × 0 + cos x × 1 = cos x.
This derivation, including the two limits, is developed in OpenStax’s trigonometric derivatives lesson.
Here the four-step framework still works, but simplification uses an identity and known limits rather than polynomial expansion. If you test the calculation on a calculator, check its angle mode first.
Worked example 6: Finding the derivative at just one point
Suppose the question asks for the derivative of r(x) = x² + 3x - 2 at x = 4.
You can work directly at the given point:
r’(4) = lim as h → 0 of [r(4 + h) - r(4)]/h.
Since r(4) = 26,
r(4 + h) = (4 + h)² + 3(4 + h) - 2
= 26 + 11h + h².
Thus:
[r(4 + h) - r(4)]/h = (11h + h²)/h = 11 + h.
Taking the limit gives r’(4) = 11.
You could instead obtain r’(x) = 2x + 3 and then substitute x = 4. Both routes are valid. The point-specific route often saves writing when only one slope is requested.
Be careful with r’(4) and r(4): the first is 11; the second is 26.
Worked example 7: A corner where the derivative fails
Consider s(x) = |x - 2| at x = 2.
Here s(2) = 0 and s(2 + h) = |h|. The difference quotient becomes |h|/h.
For h > 0, this quotient equals 1. For h < 0, it equals -1.
The two sides disagree, so s’(2) does not exist. Averaging the slopes would not fix that disagreement.
The graph is continuous at 2, but has a corner there. Continuity alone does not guarantee differentiability, as explained in OpenStax’s discussion of derivatives and continuity.
Away from the corner, the derivative is -1 for x < 2 and 1 for x > 2.
This example also explains why replacing |h| with h too early is dangerous: it silently excludes negative h and checks only one direction.
A commerce application: Marginal cost versus an exact extra-unit cost
Imagine a small workshop whose cost model is:
C(q) = 900 + 30q + 0.5q² rupees, where q is output. We treat output as a continuous variable in this model.
At q = 20, C(20) = Rs 1,700. For an increment h,
C(20 + h) = 900 + 30(20 + h) + 0.5(20 + h)²
= 1,700 + 50h + 0.5h².
Therefore the average cost increase per added unit is:
[C(20 + h) - C(20)]/h = 50 + 0.5h.
As h → 0, this approaches C’(20) = Rs 50 per unit. That is the marginal cost at output 20 in this continuous model.
But the exact cost of moving from 20 to 21 units is:
C(21) - C(20) = Rs 50.50.
The derivative gives the local rate. Multiplying it by a one-unit increase gives an approximation to that finite change, not a promise of exact equality.
Choose the algebra before you start expanding
| Function type | Useful move | Watch out for |
|---|---|---|
| Polynomial | Expand and factor h | Missing mixed terms or subtraction signs |
| Reciprocal or fraction | Use a common denominator | Subtracting denominators |
| Square root | Multiply by the conjugate | Forgetting to multiply the denominator too |
| Trigonometric | Use identities and standard limits | Degrees instead of radians |
| Modulus or piecewise function | Compare the two sides at a join | Using only one branch |
For constant and linear functions, the calculation is short. If f(x) = 9, the numerator is 9 - 9 = 0, so f’(x) = 0. If f(x) = 7x - 3, the numerator is 7h, so f’(x) = 7.
The mathcentre workbook on first principles provides further practice linking these calculations to gradients.
How to write a complete answer without unnecessary lines
Start with the definition, substitute the correct function, show the algebra that removes the difficulty, and state the limit with its domain.
Three habits make your working easier to check:
- Bracket f(x) when subtracting it. Most sign errors begin before the limit calculation.
- Retain the limit notation until you evaluate it. A quotient for nonzero h is not yet the derivative.
- Use a differentiation rule only as a separate check. If the question asks for first principles, citing the power rule alone does not show the requested method.
Do not write 0/0 as your final answer. It is an indeterminate form, not a number. Also, do not simply “remove every h” from an unsimplified expression. You must justify the limit you eventually evaluate.
Practice: Try the four steps yourself
Use first principles for each question. For the last two, explain the conclusion in words as well.
- Find f’(x) if f(x) = 4x - 9.
- Find f’(x) if f(x) = 2x² + 5x - 1.
- Find f’(x) if f(x) = x³ - 4x.
- Find f’(x) if f(x) = 3/(x - 1). State its domain.
- Find f’(x) if f(x) = √(3x + 1). State where the derivative is finite.
- Find f’(2) directly if f(x) = 2x² - 3x + 6.
- Does f(x) = |x + 1| have a derivative at x = -1?
- For C(q) = 400 + 12q + q², compare C’(5) with C(6) - C(5).
Answers with checkpoints
1. f’(x) = 4. The difference in outputs is 4h. Dividing gives 4 for every nonzero h.
2. f’(x) = 4x + 5. Before taking the limit, your simplified quotient should be 4x + 2h + 5.
3. f’(x) = 3x² - 4. The quotient is 3x² + 3xh + h² - 4.
4. f’(x) = -3/(x - 1)², x ≠ 1. Combining fractions gives a numerator of -3h before division by h.
5. f’(x) = 3/[2√(3x + 1)], x > -1/3. Rationalising leaves 3 divided by the sum of the two square roots. At the endpoint there is no finite right-hand derivative.
6. f’(2) = 5. Since f(2) = 8 and f(2 + h) = 8 + 5h + 2h², the quotient is 5 + 2h.
7. No. At -1 the quotient is |h|/h. Its left-hand limit is -1 and its right-hand limit is 1.
8. C’(5) = Rs 22 per unit; the exact extra-unit cost is Rs 23. The quotient at q = 5 is 22 + h. Its limit uses h → 0, while the move from 5 to 6 uses h = 1.
If you made a mistake, return to the first incorrect line rather than rewriting the entire solution. A wrong sign in Step 2 needs a different repair from a missing conjugate in Step 3.
Frequently asked questions
What is the formula for differentiation from first principles?
It is f’(x) = lim as h → 0 of [f(x + h) - f(x)]/h, provided the limit exists as a finite number. At a specific point a, replace x with a.
Is first principles the same as the delta method?
Yes, in this introductory context. Many books write Δx in place of h. The change in output is then Δy = f(x + Δx) - f(x), and the derivative is the limit of Δy/Δx as Δx approaches zero.
Why is f(x + h) different from f(x) + h?
The first changes the input before applying the function. The second changes the output afterward. For f(x) = x², f(x + h) = x² + 2xh + h², while f(x) + h = x² + h.
Can I set h equal to zero immediately?
No. The original quotient divides by h, so it is undefined at zero. Simplify for nonzero h first, then evaluate the limit if it exists.
Must every first-principles problem involve cancelling h?
No. That is common in polynomial, reciprocal, and square-root examples. Trigonometric questions often use standard limits, while modulus questions at corners require separate one-sided calculations.
Does h always approach zero from the positive side?
No. An ordinary derivative at an interior point uses both sides. If only a right-hand or left-hand derivative is requested, the direction is specified separately.
Can I use the power rule when asked for first principles?
You can use it privately to check your result, but your written solution should establish the derivative from the difference quotient. A correct final formula alone does not demonstrate the requested derivation.
What is the difference between f’(x) and f’(a)?
The first gives the derivative as a function of x wherever it exists. The second is the value of that derivative at one particular input a. For f(x) = 3x² - 4x + 7, f’(x) = 6x - 4 and f’(2) = 8.
Does a continuous graph always have a derivative?
No. The graph of |x - 2| is continuous at 2, but the slopes from the two sides are different. A finite derivative requires more than the graph having no break.
How should I practise first principles efficiently?
Begin with a linear function and a quadratic, then solve one reciprocal and one square-root question. Write the four-step headings until the sequence becomes familiar. Finally, attempt a modulus example so you can recognise when the correct answer is that the derivative does not exist.
Looking for commerce tuitions?
Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.