gl/ripetizioni
Learn Visually · Maths

The derivative, to be seen: the secant that becomes a tangent.

The definition as the limit of the difference quotient is learned by heart in a minute and stays obscure for months. Yet it says something you can see: take two points on the curve, join them with a line and bring the second close to the first. The line turns and settles on a single position, the tangent, and its slope is the derivative. Here you move the two points yourself, and the figure calculates the numbers.

The derivative of f at x₀ is the limit, as h tends to zero, of the difference quotient [f(x₀ + h) − f(x₀)] / h. Geometrically it is the slope of the line tangent to the graph at the point with abscissa x₀.

The definition

The interactive figure

Use the arrows on the figure (or swipe) to follow the reasoning one piece at a time, then drag P and Q along the curve, or use the sliders under the figure. On a keyboard: Tab reaches P and Q; on Q the arrow keys change h by 0.01 and Page Up / Page Down jump to 1, 0.5, 0.1, 0.01 and 0; on P the arrow keys move x₀ by 0.1. When focus is elsewhere in the figure, ← and → change step.

Secant and tangent to the graph of a functionGraph of f(x) = x² with the point P at (1, 1).

Hover (or tap) a part of the drawing — the curve, the secant, the triangle, the tangent — to find out what it is.

Step 1 of 7 · The question

How steep is a curve at a point?

A line has a single slope: how much it rises for every step to the right. A curve does not: the parabola y = x² is almost flat near zero and steeper and steeper as you move away. The point P is at x₀ = 1, that is at (1, 1). The question is: how steep is the curve right there?

f(x) = x², P = (1, 1)
Transcript

The reasoning, step by step

The same 7 steps as the figure, all together and in the same order, to read straight through or to revise without touching anything.
  1. Step 1 · The question

    How steep is a curve at a point?

    A line has a single slope: how much it rises for every step to the right. A curve does not: the parabola y = x² is almost flat near zero and steeper and steeper as you move away. The point P is at x₀ = 1, that is at (1, 1). The question is: how steep is the curve right there?

  2. Step 2 · The secant

    A second point Q and the line joining them

    Take a second point Q on the curve, a step h further to the right: with h = 1, Q is at (2, 4). The line through P and Q is called a secant. Its slope can be read off the triangle: it rises by Δy = 3 while moving forward by Δx = 1, so the slope is 3 / 1 = 3.

  3. Step 3 · The ratio

    The slope of the secant is the difference quotient

    In general Δx = h and Δy = f(1 + h) − f(1), so the slope is [f(1 + h) − f(1)] / h: the difference quotient. For the parabola it simplifies: [(1 + h)² − 1] / h = (2h + h²) / h = 2 + h. With h = 0.5 the secant has slope 2.5. Drag Q and check: the number is always 2 plus h.

  4. Step 4 · Bring Q closer

    Bring Q close to P: the secants turn and tighten

    With h = 0.1 the slope is 2.1, with h = 0.01 it is 2.01. The earlier secants stay drawn like a trail: they all turn around P and, as Q gets closer, they squeeze onto one another. Press «Bring Q close to P» and watch the trail close up on a single line.

  5. Step 5 · The limit

    h = 0 cannot be written, but you can get close to it

    With h = 0 the point Q lands on P: Δx = 0, Δy = 0 and the ratio becomes 0/0, which means nothing: infinitely many lines pass through a single point. But from the right the values are 2.1 and 2.01, from the left (negative h) 1.9 and 1.99: from both sides they get close to 2. That limit is the derivative, f′(1) = 2, and the line through P with slope 2 is the tangent: y = 2x − 1.

  6. Step 6 · f′ is a function

    Move P: every point has its own slope

    Drag P along the curve. At x₀ = 0 the tangent is horizontal, slope 0; at x₀ = −1 it goes down, with slope −2. The second graph marks, for each x₀, the slope of the tangent: out comes the line y = 2x. It is the derivative function, f′(x) = 2x, the same one the differentiation rules give you in one line.

  7. Step 7 · Try it

    Two curves to test the idea

    With x³/3 − x at x₀ = 1 the ratio is h + h²/3: it tends to 0, and the tangent is horizontal at a minimum point. With |x| at x₀ = 0, on the other hand, the secants from the right all have slope 1 and those from the left −1: they do not tighten onto a single line. There the derivative does not exist: it is a corner point.

What each element of the drawing is

In the figure these explanations appear when you hover over the element. Here they are all written out.

The curve y = f(x)
The graph of the chosen function. A curve does not have a single slope: it changes from point to point, and that is why we need the derivative.
The point P
The point where you want to know the slope, with abscissa x₀. Drag it along the curve, or select it and use the arrow keys: it moves by 0.1 at a time.
The point Q
It sits on the curve, at a horizontal distance h from P. Drag it towards P, or use the arrow keys (0.01 at a time) and Page Up / Page Down to jump to h = 1, 0.5, 0.1, 0.01.
The secant PQ
The line through P and Q. Its slope is the difference quotient: it changes with h, and when Q gets close to P it gets close to the slope of the tangent.
The increment triangle
The horizontal leg is Δx = h, the vertical one is Δy = f(x₀ + h) − f(x₀). The slope of the secant is Δy divided by Δx: how much it rises for every horizontal step.
The tangent at P
The line through P with slope f′(x₀): the one the secants tighten onto when h tends to zero. Near P the curve and the tangent are almost indistinguishable.
The graph of the derivative
For each position of P it marks the slope of the tangent at that point. It is the graph of f′: positive where f goes up, negative where it goes down, zero where the tangent is horizontal.
Self-check

Three questions to see if it has sunk in.

Try to answer by looking at the figure first, then open the answer.

1. With f(x) = x², P at x₀ = 3 and h = 0.1: what is the difference quotient? And what is f′(3)?

It is the same calculation as in step 3 with 3 in place of 1: [(3 + h)² − 9] / h = (6h + h²) / h = 6 + h, so with h = 0.1 it is 6.1. As h tends to zero it stays at 6: f′(3) = 6, that is 2 · 3, as f′(x) = 2x says.

2. At which points is the tangent to the graph of x³/3 − x horizontal?

Where the slope is zero, that is where f′(x) = x² − 1 vanishes: at x = 1 and x = −1. In the figure choose x³/3 − x and move P to those two points: at 1 there is a minimum, at −1 a maximum, and at both the tangent is flat.

3. Is f(x) = |x| differentiable at x₀ = 1? With what slope?

Yes. Between 0 and 2 the function coincides with y = x, so for every h between −1 and 1 (zero excluded) the ratio is exactly 1, from the right and from the left. The limit is 1: f′(1) = 1. The corner, and the point where the derivative does not exist, is only at 0.

FAQ

The questions we always get.

What is the difference between a secant and a tangent?

The secant passes through two points of the graph, P and Q, and its slope is the difference quotient. The tangent passes through P alone and is the position the secants get close to when Q slides towards P. That is why the slope of the tangent is found with a limit and not with a simple ratio: with a single point the ratio would be 0/0.

Does the tangent touch the curve at one point only?

Not necessarily, and it is one of the most common misunderstandings. For x³/3 − x at x₀ = 0 the tangent is y = −x, and the curve crosses it: it lies above on one side and below on the other. Conversely, the vertical line x = 1 meets the parabola y = x² at one point only, but it is not a tangent. What counts is the limiting slope of the secants, not the number of points in common.

What does it mean, looking at the graph, that a function is not differentiable?

That the secants do not tighten onto a single line when Q gets close to P. With |x| at 0 the secants from the right always have slope 1 and those from the left always −1: the two one-sided derivatives exist but are different, the graph has a corner and there is no single tangent. Elsewhere |x| is differentiable without any problem.

What does the derivative have to do with speed?

If f(t) is the position of an object at time t, the difference quotient [f(t + h) − f(t)] / h is the average speed between t and t + h: the distance travelled divided by the time taken. Letting h tend to zero gives the speed at that instant, that is the derivative. The secant is the average speed, the tangent the instantaneous one.

Keep going from here

Do derivatives not add up for you?

Anyone who has seen the secant become a tangent stops applying rules by heart and starts to understand what they are calculating, and that is where the tangent line, the points where a function is not differentiable and the study of a function come unblocked. You catch up in a few hours, with the right exercises.