Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 39 · Getting Started

Instantaneous Rate and Tangent Lines

See how shrinking a secant line's interval produces a tangent line, and how its slope gives the instantaneous rate of change, with numeric and visual examples.

A car's speedometer shows how fast you are going right now. That is an instantaneous rate of change. You cannot compute it from one point alone, but you can approach it: take average rates over shorter and shorter intervals and see what number they head toward.

From secant to tangent

Fix a point P = (a, f(a)) on a curve. Pick a second point Q = (a + h, f(a + h)) where h is a small step. The secant line through P and Q has slope

(f(a + h) - f(a)) / h

As h shrinks, Q slides toward P, and the secant line turns until it just touches the curve at P. That limiting line is the tangent line. Its slope is the instantaneous rate of change at a.

flowchart LR
  A["Secant, h = 1"] --> B["Secant, h = 0.1"] --> C["Secant, h = 0.01"] --> D["Tangent line"]

As h shrinks, secant lines approach the tangent line.

A worked example

Find the slope of f(x) = x² at x = 3.

(f(3 + h) - f(3)) / h = ((3 + h)² - 9) / h = (6h + h²) / h = 6 + h

When h is tiny, 6 + h is almost 6. So the slope at x = 3 is 6. Notice that we simplified before letting h shrink: dividing by h is allowed because h is small but not zero.

Python Watch the secant slope settle

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You should see values approaching 6 from above. Try h = -0.001 too: approaching from the left gives values just below 6, and the two sides agree.

Drawing the tangent

The tangent line at (a, f(a)) with slope m has equation y = f(a) + m(x - a).

Python Curve, secant and tangent

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

What the slope means

Slope units are output units per input unit. If d(t) is distance in meters and t is in seconds, the tangent slope is in meters per second: a speed. If C(x) is cost in dollars of making x items, the slope is the cost of one more item, called marginal cost. A positive slope means the quantity is increasing at that instant, a negative slope means decreasing, and zero means momentarily flat.

This "approach" idea is vague as written. In chapter 2 you will learn limits, which make it exact, and in chapter 3 you will define the derivative as exactly this limiting slope.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. The tangent line to a curve at a point

    It is the limiting position of secant lines and its slope is the instantaneous rate of change.
  2. 2. For f(x) = x², the secant slope between x = 3 and x = 3 + h simplifies to

    ((3+h)² - 9)/h = (6h + h²)/h = 6 + h.
  3. 3. The slope of the tangent to y = x² at x = 3 is

    As h approaches 0, 6 + h approaches 6.
  4. 4. Which is the equation of a tangent line at (a, f(a)) with slope m?

    It is the point-slope form through (a, f(a)).

Summary

  • Shrinking h in the secant slope (f(a+h) - f(a))/h gives the tangent slope.
  • The tangent slope is the instantaneous rate of change.
  • Simplify algebraically first, then see what the expression approaches.
  • Tangent line: y = f(a) + m(x - a).

Next: Calculus Tools in Python