Grade by Grade
A. Rate of Change · Derivatives and Differentiation Rules

The Derivative from First Principles

A2.3About 70 minutes
Learning goals
  • I can state the definition of the derivative as a limit of a difference quotient.
  • I can differentiate polynomial functions from first principles by simplifying before taking the limit.
  • I can use the notations f′(x), y′, dy/dx and d/dx.
  • I can explain where a function is not differentiable.

Words to know

first principles
Finding a derivative directly from its definition, f′(x) = lim (h → 0) [f(x + h) − f(x)] ÷ h.
differentiation
The process of finding a derivative.
differentiable
A function is differentiable at x = a if f′(a) exists (the limit of the difference quotient exists there).
Leibniz notation
The notation dy/dx for the derivative of y with respect to x.
limit
The value an expression approaches as the variable gets closer and closer to a given value.

One calculation for every point

In the unit Limits and Rates of Change you found the slope of a tangent at one point, such as x = 3, by computing

lim (h → 0) [f(3 + h) − f(3)] ÷ h.

To get the slope at another point, you had to start over. In the last lesson you saw patterns in tables that suggested f′(x) = 2x for x². Now you will prove those patterns with algebra, by doing the limit calculation once with a letter x instead of a number.

The definition of the derivative

The derivative of f with respect to x is

f′(x) = lim (h → 0) [f(x + h) − f(x)] ÷ h

provided this limit exists. Finding a derivative this way is called differentiating from first principles.

Read "lim (h → 0)" as "the limit as h approaches 0". It means: what value does the expression get closer and closer to as h gets very close to 0 (from either side), without ever equalling 0?

Other notations. If y = f(x), all of these mean the same thing:

  • f′(x) (Lagrange notation, "f prime of x")
  • y′ ("y prime")
  • dy/dx (Leibniz notation, "dee y by dee x"). It reminds you of rise over run: a tiny change in y divided by a tiny change in x.
  • d/dx [f(x)] ("the derivative of f(x) with respect to x")

The process of finding a derivative is called differentiation, and a function that has a derivative at a point is differentiable there.

xy(x, f(x))(x + h, f(x + h))run = hrise = f(x + h) − f(x)xx + hsolid line: secantdashed line: tangent at xsecant slope =[f(x + h) − f(x)] ÷ hAs h → 0, the point(x + h, f(x + h)) slidestoward (x, f(x)) and thesecant turns into thetangent.
The difference quotient is the slope of the secant through (x, f(x)) and (x + h, f(x + h)). Letting h approach 0 turns the secant into the tangent, so the limit is the tangent slope f′(x).
1. Expandf(x + h)(x + h)³ = x³ + 3x²h+ 3xh² + h³2. Subtractf(x + h) − f(x)3x²h + 3xh² + h³3. Divide by h(h ≠ 0)3x² + 3xh + h²4. Let h → 0terms with h vanishf′(x) = 3x²f(x) = x³
The four steps of differentiating from first principles, shown for f(x) = x³. You must divide by h before letting h approach 0; substituting h = 0 at the start gives the meaningless 0 ÷ 0.
Worked example

Example 1: The derivative of x²

Use first principles to find f′(x) for f(x) = x².

  1. f(x + h) = (x + h)² = x² + 2xh + h².
  2. f(x + h) − f(x) = x² + 2xh + h² − x² = 2xh + h².
  3. Divide by h: (2xh + h²) ÷ h = 2x + h.
  4. f′(x) = lim (h → 0) (2x + h) = 2x.

f′(x) = 2x, which proves the pattern from the slope table in the last lesson.

Worked example

Example 2: A general quadratic

Differentiate f(x) = 3x² − 5x + 2 from first principles.

  1. f(x + h) = 3(x² + 2xh + h²) − 5(x + h) + 2 = 3x² + 6xh + 3h² − 5x − 5h + 2.
  2. Subtract f(x) = 3x² − 5x + 2: f(x + h) − f(x) = 6xh + 3h² − 5h.
  3. Divide by h: 6x + 3h − 5.
  4. Let h → 0: f′(x) = 6x − 5.

f′(x) = 6x − 5. Notice the constant 2 cancelled in the subtraction: constants never affect the slope.

Worked example

Example 3: The derivative of x³

Show that the derivative of y = x³ is dy/dx = 3x².

  1. (x + h)³ = (x + h)²(x + h) = (x² + 2xh + h²)(x + h) = x³ + 3x²h + 3xh² + h³.
  2. Subtract x³: 3x²h + 3xh² + h³.
  3. Divide by h: 3x² + 3xh + h².
  4. As h → 0, 3xh → 0 and h² → 0, leaving 3x².

dy/dx = 3x²

Worked example

Example 4: Using the derivative for a tangent line

Let f(x) = x³ − 2x. (a) Find f′(x) from first principles. (b) Find the equation of the tangent at x = 2.

  1. (a) f(x + h) = x³ + 3x²h + 3xh² + h³ − 2x − 2h.
  2. f(x + h) − f(x) = 3x²h + 3xh² + h³ − 2h. Divide by h: 3x² + 3xh + h² − 2.
  3. Let h → 0: f′(x) = 3x² − 2.
  4. (b) Slope: f′(2) = 3(4) − 2 = 10. Point: f(2) = 8 − 4 = 4.
  5. Tangent: y − 4 = 10(x − 2), so y = 10x − 16.

(a) f′(x) = 3x² − 2; (b) y = 10x − 16. One derivative now gives the tangent slope at every point: f′(0) = −2, f′(1) = 1, and so on.

When the derivative does not exist

The limit in the definition must exist, so some functions are not differentiable at some points. In Limits and Rates of Change you saw why there is no single tangent slope at a corner. The same thing happens at:

  • a corner or cusp (left and right slopes disagree, as for y = |x| at 0),
  • a vertical tangent (the slope grows without bound, as for y = ∛x at 0),
  • a discontinuity (a jump, a hole or a vertical asymptote).

Polynomials have none of these, so every polynomial is differentiable at every real number.

x-111slope −1slope 1y = |x|x-11y′ = 1y′ = −1undefined at x = 0derivative of |x|
y = |x| has a corner at the origin: slopes on the left are −1 and on the right are 1. The two one-sided limits of the difference quotient disagree, so the derivative does not exist at x = 0 (shown by the open circles).

Keep the limit until the end

Write "lim (h → 0)" on every line until the line where you actually let h approach 0. Dropping it early, or writing "= 0" for h at the start, is the most common way to lose marks on first-principles questions.

Just for fun

Gottfried Wilhelm Leibniz, who invented the dy/dx notation in the 1600s, chose his symbols very carefully because he believed good notation does half the thinking for you. Every calculus student who has "cancelled" the dx's in a hurry agrees that it can do a little too much thinking.

Hands-on activity

Shrinking h in a spreadsheet or on paper

You need: a scientific calculator (or a free spreadsheet such as Google Sheets or LibreOffice Calc), and paper.

  1. Take f(x) = x² at x = 1.5. Calculate the difference quotient [f(1.5 + h) − f(1.5)] ÷ h for h = 1, 0.1, 0.01 and 0.001.
  2. Now use the simplified form from Example 1, 2x + h, with x = 1.5 and the same h-values. Compare the two columns.
  3. Try h = −0.1 and h = −0.01 too.
  4. Explain in one sentence why both columns approach the same number, and what that number is.

What to look for: both columns give 4, 3.1, 3.01, 3.001 (and 2.9, 2.99 for the negative h-values). They are identical because the simplified form 2x + h is just the difference quotient after cancelling h. Both approach 3 = 2(1.5), the value of f′(1.5).

Your turn

1

Write the definition of f′(x) as a limit.

2

Use first principles to differentiate f(x) = 5x − 1.

3

Use first principles to differentiate f(x) = x² + 4x.

4

Use first principles to differentiate g(x) = −2x².

5

For y = x² + 4x, find dy/dx at x = −3 and explain what it means.

6

Why can't you substitute h = 0 directly into [f(x + h) − f(x)] ÷ h?

7

Name three kinds of points where a function is not differentiable.

More practice: warm-up

1

Expand (x + h)².

2

Simplify (6xh + h²) ÷ h, for h ≠ 0.

3

What is lim (h → 0) (4x − 3h)?

4

Write dy/dx in words.

5

Is f(x) = x⁵ − 3x + 1 differentiable at x = 2? Why?

More practice: on your own

1

Differentiate f(x) = 4x² − x + 7 from first principles.

2

Differentiate f(x) = 2x³ from first principles.

3

Differentiate f(x) = 1 − x³ from first principles, then find the slope at x = −1.

4

Find the equation of the tangent to y = x² − 3x at x = 4, using a derivative from first principles.

5

A student writes: lim (h → 0) (x² + 2xh + h² − x²)/h = (x² + 0 + 0 − x²)/0 = 0/0. What went wrong, and what is the right answer?

Challenge

1

Use first principles to show that the derivative of x⁴ is 4x³. (Use (x + h)⁴ = x⁴ + 4x³h + 6x²h² + 4xh³ + h⁴.)

2

Use first principles to find the derivative of f(x) = 1/x (x ≠ 0).

3

Use first principles to find the derivative of f(x) = √x (x > 0). Hint: multiply the top and bottom of the difference quotient by √(x + h) + √x.

Check your understanding

Quiz

1.

Which expression is the definition of f′(x)?

2.

For f(x) = x² − 7x, the simplified difference quotient is 2x + h − 7. What is f′(x)?

3.

Which notation does NOT mean the derivative of y = f(x)?

4.

Where is y = |x − 2| not differentiable?

5.

Using first principles, what is the derivative of f(x) = x³?

6.

The tangent to y = x² at x = 5 has slope:

For parents and teachers

Big idea (A2.3): the derivative is defined as a limit, f′(x) = lim (h → 0) [f(x + h) − f(x)] ÷ h. For polynomials, your teen expands, subtracts, divides by h and then lets h approach 0.

How to help: Ask your teen to talk through the four steps out loud for f(x) = x² while you write. The key question to ask is "Why can't you just put h = 0 at the start?" (Answer: it gives 0 ÷ 0.)

Common difficulties:

  • Expanding (x + h)² as x² + h² (the middle term 2xh is missing).
  • Sign errors when subtracting f(x), especially with negative coefficients: put f(x) in brackets.
  • Dropping "lim (h → 0)" too early, or forgetting to write it at all.
  • Thinking dy/dx is an ordinary fraction. For now it is one symbol meaning "the derivative of y with respect to x".