🧱 Shaky on the basics? Start with Foundations →

Mathematical Architects · Calculus

Derivatives — Definition & Techniques — Visual Lab

Module 2. A slope needs two points — but the slope at a single point seems impossible. Watch it happen: slide the second point in until the gap \(h\) collapses to zero, and the secant line snaps into the tangent. That limiting slope, traced point by point, is the derivative.

Interactive Lab Module 02 · The Derivative AP Calc AB/BC · Units 2–3

The derivative answers one question: how fast is \(f\) changing right here? The average rate of change between two points is just the slope of a secant line, \(\dfrac{f(x+h)-f(x)}{h}\). Squeeze the second point toward the first — let \(h \to 0\) — and that secant pivots into the tangent line, whose slope is the instantaneous rate of change. Collect that slope at every base point and you've drawn a brand-new function: \(f'(x)\). Drive the controls below and keep the geometry, the limit, and the derivative graph in perfect agreement.


Secant → Tangent Lab

Pick a curve, set the base point \(x\), then drag \(h\) toward \(0\). The secant through \((x, f(x))\) and \((x+h, f(x+h))\) becomes the tangent, and its slope is read off as \(f'(x)\). Turn on Trace \(f'(x)\) to plot the derivative function point by point as you sweep the base point.


Orientation

What you're seeing

  • The solid curve is \(f(x)\). The two dots sit at the base point \((x, f(x))\) and the second point \((x+h, f(x+h))\) — the gap between their \(x\)-values is exactly \(h\).
  • The dashed line is the secant. Its slope is the average rate of change \(\frac{f(x+h)-f(x)}{h}\) — the rise over the run between the two dots.
  • As \(h \to 0\) the dots merge. The secant pivots about the base point and locks onto the tangent line. Its slope is the instantaneous rate of change, \(f'(x)\).
  • Slide the base point \(x\). The tangent slope changes from place to place — that changing slope is its own function.
  • Trace \(f'(x)\). Turn it on and every tangent slope is dropped as a point on a second curve: the graph of the derivative, built right in front of you.
Investigation

Try this

  1. Park the base point, then shrink \(h\). Watch the secant slope readout settle on a single number as \(h \to 0\). That limit is \(f'(x)\) at this point.
  2. Use \(f(x)=x^2\) and set \(x=3\). Drive \(h\) small. The slope homes in on \(6\) — exactly \(2x\) at \(x=3\). The derivative of \(x^2\) is \(2x\).
  3. Find where the tangent is flat. Move the base point until the tangent slope hits \(0\). On the derivative graph, that's where \(f'(x)\) crosses the \(x\)-axis — a max or min of \(f\).
  4. Switch to \(\sin x\) and trace \(f'(x)\). Sweep the base point across the screen. The traced derivative is a cosine wave — you've discovered \(\frac{d}{dx}\sin x = \cos x\) by hand.

Worked Examples

The lab shows you the picture; here is the algebra that backs it. Work each one yourself, then check every line.

1 The limit definition

Differentiate \(f(x)=x^2\) from the definition

Use \(f'(x)=\displaystyle\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\) to find \(f'(x)\), then evaluate at \(x=3\).

  1. Build the difference quotient. \(\dfrac{f(x+h)-f(x)}{h}=\dfrac{(x+h)^2-x^2}{h}\).
  2. Expand the numerator. \((x+h)^2-x^2 = x^2+2xh+h^2-x^2 = 2xh+h^2\).
  3. Factor and cancel the \(h\). \(\dfrac{2xh+h^2}{h}=\dfrac{h(2x+h)}{h}=2x+h\) (valid since \(h\neq 0\) inside the limit).
  4. Take the limit as \(h\to 0\). \(\displaystyle\lim_{h\to 0}(2x+h)=2x\). So \(f'(x)=2x\).
  5. Evaluate. \(f'(3)=2(3)=6\) — the slope of the tangent to \(y=x^2\) at \((3,9)\).
Answer: \(f'(x)=2x\), and \(f'(3)=6\). This is the exact number the lab's secant slope converges to as \(h\to 0\) at \(x=3\).
2 The rules in combination

Differentiate \(g(x)=x^2\sin(3x)\)

Once the definition is understood, we use rules. This one needs the product rule and the chain rule together.

  1. Name the factors. Product rule: \((uv)'=u'v+uv'\) with \(u=x^2\) and \(v=\sin(3x)\).
  2. Differentiate \(u\). Power rule: \(u'=2x\).
  3. Differentiate \(v\) with the chain rule. Outer is \(\sin(\square)\Rightarrow\cos(\square)\); inner is \(3x\Rightarrow 3\). So \(v'=\cos(3x)\cdot 3 = 3\cos(3x)\).
  4. Assemble. \(g'(x)=u'v+uv'=2x\sin(3x)+x^2\cdot 3\cos(3x)\).
Answer: \(g'(x)=2x\sin(3x)+3x^2\cos(3x)\). The chain-rule factor of \(3\) is the step everyone forgets — the inner function's derivative never disappears.

📚

Key Vocabulary

The precise words a mathematician uses to describe what the sliders are doing.

Average rate of change

The slope of the secant line between two points: \(\frac{f(x+h)-f(x)}{h}\). It measures change over an interval.

Instantaneous rate of change

The slope at a single point — the limit of the average rate as the interval shrinks to zero. It equals the derivative.

Secant line

A line through two points of a curve. Its slope is the average rate of change between those points.

Tangent line

The line that just grazes the curve at one point. Its slope is \(f'(x)\), the limiting position of the secant as \(h\to 0\).

Derivative \(f'(x)\)

The function \(f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\) giving the slope of \(f\) at every point. Also written \(\frac{dy}{dx}\).

Difference quotient

The expression \(\frac{f(x+h)-f(x)}{h}\) before the limit is taken — the algebraic engine of the definition.

Framework for this lab

AP Calculus & Collegiate Calculus I

This module follows AP Calculus AB/BC — Units 2–3 (Differentiation: definition & fundamental properties; composite, implicit & inverse functions) and the differentiation core of Collegiate Calculus I. The lab targets the definition of the derivative as a limit and as the slope of the tangent line; the rules (power, sum, product, quotient, chain) follow as the efficient shortcuts.

AB/BC Unit 2 AB/BC Unit 3 Calc I

Unit 2 defines the derivative (average vs. instantaneous rate, the limit definition, tangent-line slope) and develops the power, constant, sum, product, and quotient rules plus derivatives of \(\sin x,\ \cos x,\ e^x,\ \ln x\).  Unit 3 adds the chain rule, implicit differentiation, inverse-function derivatives, and higher-order derivatives.


💡

Why it matters

The derivative is the single most-used idea in quantitative science.

Every "rate" in science is a derivative. Velocity is the derivative of position; acceleration is the derivative of velocity. In chemistry a reaction rate is \(\frac{d[\text{conc}]}{dt}\); in economics marginal cost is the derivative of total cost; in biology a population's growth rate is the derivative of its size. Once you can read a curve's slope at a point, you can quantify change anywhere it appears — and the limit definition you watched converge in the lab is the rigorous reason it all works. The rules (power, product, quotient, chain) simply let you compute that slope without re-running the limit every time.

Shaky on limits, function composition, or exponent and log rules? Step back to Module 2 Foundations first, then return to the lab. Or browse all courses.

Framework: AP Calculus AB/BC — Units 2–3 (Differentiation: definition & fundamental properties; composite, implicit & inverse functions) and Collegiate Calculus I. AP® is a trademark of the College Board, which is not affiliated with and does not endorse this site. Classroom use is non-commercial.