The Tangent and Velocity Problems
Two questions started differential calculus: what is the slope of a curve at a single point, and what is the speed of a moving object at a single instant? Both lead to the same computation, a slope of secant lines whose two points slide together, and that computation forces us to invent the limit.
For a gentler first pass, see Limits in the survey course. Here we set the problem up carefully so that the definitions in the next lessons have a clear job to do.
The tangent problem
For a circle, "tangent line" has an easy meaning: the line that touches the circle once. For a general curve that definition fails. The line touches at infinitely many points and is tangent at every one of them, while the line meets only once and is not tangent at all (the tangent at the origin is , which crosses the curve).
A better idea is to approximate. Fix a point on the graph and pick a second point . The secant line through and has slope
As slides along the curve towards , the secant lines pivot about . If their slopes settle on a number , we define the tangent line at to be the line through with slope . The tangent is the limiting position of the secants.
Take and .
def f(x):
return x**3 - 2*x
a = 2
print(" x slope of secant PQ")
for x in [3, 2.5, 2.1, 2.01, 2.001, 1.999, 1.99, 1.9, 1.5]:
m = (f(x) - f(a)) / (x - a)
print(f"{x:7.3f} {m:.6f}") x slope of secant PQ
3.000 17.000000
2.500 13.250000
2.100 10.610000
2.010 10.060100
2.001 10.006001
1.999 9.994001
1.990 9.940100
1.900 9.410000
1.500 7.250000
From both sides the slopes close in on . The algebra confirms it: for ,
and gives at . So the tangent line is , that is .
The velocity problem
A drone climbs so that its height after seconds is metres (for ). Its average velocity over is
from fractions import Fraction as F
def h(t):
return 12*t - t**2
for dt in [F(1), F(1, 10), F(1, 100), F(1, 1000), F(-1, 1000)]:
v = (h(2 + dt) - h(2)) / dt
print(f"Δt = {str(dt):>7} average velocity = {v} m/s")Δt = 1 average velocity = 7 m/s
Δt = 1/10 average velocity = 79/10 m/s
Δt = 1/100 average velocity = 799/100 m/s
Δt = 1/1000 average velocity = 7999/1000 m/s
Δt = -1/1000 average velocity = 8001/1000 m/s
Exact fractions make the pattern obvious: the average velocity is exactly . Expanding confirms it:
As this tends to , the instantaneous velocity at : 8 m/s upward.
One computation, two meanings
Average velocity over is exactly the slope of the secant line on the graph of position against time. So the instantaneous velocity is the slope of the tangent line to the position graph.
| Tangent problem | Velocity problem | |
|---|---|---|
| Ingredients | curve , point | position , instant |
| Approximation | secant slope | average velocity |
| Target | slope of tangent | instantaneous velocity |
| Obstacle | gives | gives |
The obstacle is the same in both columns. Plugging in the point itself produces , which carries no information. What we need is the value the quotient approaches. That is the limit, defined in The Limit of a Function and made precise in The Precise Definition of a Limit. The common answer, the derivative, arrives in Derivatives and Rates of Change.
Note: Numerical tables like the ones above are evidence, not proof. Floating point also limits how far you can push them: with
h = 1e-12the subtraction cancels almost all significant digits. Exact fractions or algebra avoid that problem.
A picture of secants converging
import numpy as np
import matplotlib.pyplot as plt
f = lambda x: x**3 - 2*x
xs = np.linspace(0, 3.2, 200)
plt.figure(figsize=(6, 4))
plt.plot(xs, f(xs), "k", label="y = x³ − 2x")
for x, c in [(3, "C0"), (2.5, "C1"), (2.2, "C2")]:
m = (f(x) - f(2)) / (x - 2)
plt.plot(xs, f(2) + m*(xs - 2), c, lw=0.8, label=f"secant to x={x}, slope {m:.2f}")
plt.plot(xs, 10*xs - 16, "r--", label="tangent y = 10x − 16")
plt.ylim(-5, 25); plt.legend(fontsize=8); plt.grid(alpha=0.3)
print("secant slopes:", [round((f(x) - f(2)) / (x - 2), 2) for x in (3, 2.5, 2.2)])secant slopes: [17.0, 13.25, 11.24]
In software
- Physics engines store position and velocity, and a frame's velocity estimate is an average velocity. Smaller time steps make it closer to the instantaneous one (Game Physics).
- Telemetry and monitoring: "requests per second" on a dashboard is a secant slope of a cumulative counter over a sampling window. Shrinking the window gives a more local rate but a noisier one.
- Numerical differentiation in scientific code is a secant slope with a carefully chosen small , a trade-off between truncation error and rounding error.
Exercises
Exercise 1: Secant slope by algebra
For , simplify the secant slope between and and find the slope of the tangent at .
Answer
Secant slope ; tangent slope .
Solution
Exercise 2: Tangent line equation
Using Exercise 1, write the tangent line to at .
Answer
Solution
Exercise 3: Instantaneous velocity
A stone thrown upward has height metres. Find its velocity at and at . What does the sign at mean?
Answer
m/s at , m/s at (falling).
Solution
Exercise 4: Average velocities in code
Write a loop printing the average velocity of over for , and check that it approaches the answer to Exercise 3.
Answer
About , , , tending to .
Solution
From Exercise 3 the average velocity is .
s = lambda t: 20*t - 5*t**2
for h in [0.1, 0.01, 0.001]:
print(h, round((s(3 + h) - s(3)) / h, 6))0.1 -10.5
0.01 -10.05
0.001 -10.005
Test yourself
Why can't we find the tangent slope by putting directly into ?
- Because is undefined
- Because it gives
- Because the secant is vertical
- Because the curve has no slope
The average velocity of an object over equals which quantity on the position graph?
- The area under the graph
- The height of the graph at
- The slope of the secant line through and
- The slope of the tangent at
For , the average velocity over is . What is the instantaneous velocity at ?
- 8
- 6
- 7
- It cannot be determined