Interactive calculus guide

Differentiation from first principles — and the functions you actually use

Start from the idea of a limit, watch a secant line become a tangent, then explore derivatives and integrals of 100 classic functions with plain-language intuition — not just formulas to memorize.

How to use this site. Read the narrative pages in order if you are learning. Jump straight to the catalog if you need a quick lookup. Math renders with KaTeX; the geometry page has a live canvas you can drag.

Chapter 1

Limits — “as close as you want”

Differentiation is not magic. It is the answer to one question: what is the instantaneous rate of change? To make “instantaneous” precise, we need limits.

The everyday idea

Imagine walking toward a door. You can get 1 meter away, then 10 cm, then 1 mm… You never need to be at the door to talk about “where you’re heading.” A limit is that destination of the process — the value the expression approaches when the input approaches something (even if it never quite arrives).

Notation

\[\lim_{x \to a} f(x) = L\]

“As \(x\) approaches \(a\), \(f(x)\) approaches \(L\).” We care about the neighborhood of \(a\), not necessarily \(f(a)\) itself.

Why the value at the point can be irrelevant

Consider a speedometer reading averaged over a shorter and shorter interval. The average over 1 hour, then 1 minute, then 1 second — those averages can settle on a number even if “speed at exactly one instant” is hard to define with a stopwatch. Limits let us define that settled number rigorously.

Left & right limits

Approaching from below (\(x \to a^-\)) or above (\(x \to a^+\)). The two-sided limit exists only if both agree.

\[\lim_{x\to a^-} f(x)=\lim_{x\to a^+} f(x)=L\]

Infinite limits & at infinity

\(f(x)\to\infty\) means values grow without bound (vertical asymptote vibe). \(x\to\infty\) means we look farther and farther along the domain.

Limit laws (the toolkit)

If the individual limits exist, you may combine them:

  • Sum / difference: limit of \(f\pm g\) is limit of \(f\) ± limit of \(g\)
  • Product: limit of \(fg\) is product of limits
  • Quotient: limit of \(f/g\) is quotient of limits (if denom ≠ 0)
  • Constant multiple: \(\lim c\cdot f = c\cdot\lim f\)
  • Composition: continuous outer functions pass through limits cleanly

Indeterminate forms — why algebra enters

Plugging in sometimes gives nonsense like \(0/0\) or \(\infty/\infty\). That does not mean the limit fails — it means the expression is written in a form that hides the true behavior. Factoring, conjugates, rationalizing, or L’Hôpital’s rule are tools to rewrite until the limit is visible.

Classic \(0/0\) that has a perfect answer

\[\lim_{x\to 2}\frac{x^2-4}{x-2}=\lim_{x\to 2}\frac{(x-2)(x+2)}{x-2}=\lim_{x\to 2}(x+2)=4\]

At \(x=2\) the original fraction is undefined. After canceling the common factor (valid for \(x\neq 2\)), the simplified function is continuous and the limit is 4. The hole in the graph sits at height 4 — that height is the limit.

Chapter 2

Differentiation from first principles

The derivative is not a list of rules. The rules are shortcuts for computing one definition: the limit of average rates of change.

Average rate of change first

Over an interval from \(x\) to \(x+h\), the function changes by \(f(x+h)-f(x)\). The average rate of change is the slope of the secant line connecting those two points on the graph:

\[\frac{f(x+h)-f(x)}{h}\]

Difference quotient — “rise over run” between two nearby inputs.

Make the interval vanish

Instantaneous rate of change is what that average becomes when \(h\) shrinks to 0 — not by setting \(h=0\) (division by zero), but by taking the limit:

Definition of the derivative (first principles)

\[f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]

If this limit exists, \(f\) is differentiable at \(x\). The number \(f'(x)\) is the slope of the tangent line and the instantaneous rate of change of \(f\) at \(x\).

Equivalent form (approaching a fixed point)

Sometimes it is clearer to fix the point \(a\) and let the other end \(x\) approach \(a\):

\[f'(a)=\lim_{x\to a}\frac{f(x)-f(a)}{x-a}\]

Worked example: \(f(x)=x^2\)

Compute \(f'(x)\) from the definition — no power rule allowed yet.

\[ \begin{aligned} f'(x) &= \lim_{h\to 0}\frac{(x+h)^2-x^2}{h} = \lim_{h\to 0}\frac{x^2+2xh+h^2-x^2}{h}\\ &= \lim_{h\to 0}\frac{2xh+h^2}{h} = \lim_{h\to 0}(2x+h) = 2x. \end{aligned} \]

The \(h\) in the denominator cancels against a factor of \(h\) in the numerator. What remains is continuous at \(h=0\), so the limit is just plug-in: \(2x\). The power rule \( (x^n)' = nx^{n-1} \) is this pattern, generalized.

What the derivative “is” in words

Rate of change

If \(s(t)\) is position, \(s'(t)\) is velocity. If \(C(q)\) is cost, \(C'(q)\) is marginal cost. Units of \(f'\) are units of \(f\) per unit of input.

Local linear approximation

Near \(a\), \(f(x)\approx f(a)+f'(a)(x-a)\). The graph looks like a straight line when you zoom in enough — differentiability is “zoom flat to a line.”

When the derivative fails

  • Corner or cusp (e.g. \(|x|\) at 0): left and right difference quotients disagree or blow up.
  • Vertical tangent: slopes grow without bound.
  • Jump discontinuity: the function itself does not settle; rate of change cannot either.

Continuity is necessary for differentiability, but not sufficient. A continuous “V” is continuous everywhere and not differentiable at the tip.

From definition to rules (why rules exist)

Every differentiation rule is a theorem proved from the limit definition:

  • Sum rule: \((f+g)'=f'+g'\) — limit of sum is sum of limits
  • Product rule: \((fg)'=f'g+fg'\) — expand \((f+h\text{-stuff})(g+h\text{-stuff})\)
  • Chain rule: \((f\circ g)'=(f'\circ g)\cdot g'\) — rates multiply along a composition
  • Quotient rule: rewrite as product with \(1/g\)

Once proved, you never need to return to limits for routine work — but first principles remain the meaning of every derivative you write.

Chapter 3

Geometric derivation of the derivative

Drag the free point. Watch the secant become the tangent. The slope number is exactly the difference quotient — and its limit is \(f'(a)\).

The geometric argument, step by step

  1. Pick a point \(A=(a,f(a))\) on the curve.
  2. Pick a second point \(B=(a+h,f(a+h))\). The chord \(AB\) is a secant. Its slope is the difference quotient \(\frac{f(a+h)-f(a)}{h}\).
  3. Slide B toward A by letting \(h\to 0\). The secant pivots. If the pivoting settles on a unique line, that line is the tangent.
  4. \[\text{slope of tangent}=f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h}\]
  5. Equation of the tangent line: \[y=f(a)+f'(a)(x-a)\] Same point-slope form as high-school lines — with slope supplied by the limit.

Why this is the “derivative,” not just a picture

Geometry motivates; the limit definition makes it precise. Two different sequences of points \(B_n\to A\) must produce the same limiting slope (or the derivative does not exist). The formal \(\varepsilon\)–\(\delta\) definition of a limit encodes that uniqueness and stability under all approaches of \(h\to 0\).

Area preview: the other half of calculus

Integration asks a dual geometric question: what is the signed area under \(y=f(x)\)? The Fundamental Theorem of Calculus links the two: the derivative of the area-so-far function is the original height \(f\). Differentiation undoes accumulation; accumulation undoes differentiation (up to a constant).

Chapter 4

100 well-known functions

Open any function for a guided differentiation and integration walkthrough — not just the final formula. Filter by family or search by name.

How to learn from a card. Click Learn step-by-step → choose Differentiation or Integration → press Next step to reveal the derivation one beat at a time (or Show all steps). Watch the sketch of f (green) and f′ (blue) while you work. Final formulas stay visible at the top so you can compare as you go.

0 functions shown · guided walkthroughs on every card

Chapter 5

Integration — accumulation dual to differentiation

If the derivative asks “how fast?”, the integral asks “how much total?” Geometrically: signed area. Analytically: antiderivative.

Two faces of the integral

Definite integral (area / net change)

\[\int_a^b f(x)\,dx\]

Limit of Riemann sums: slice \([a,b]\) into thin rectangles of width \(\Delta x\), height \(f(x_i^*)\), sum the areas, refine the mesh. Signed: below the axis counts negative.

Indefinite integral (antiderivative)

\[\int f(x)\,dx=F(x)+C\]

Any \(F\) with \(F'=f\). The “\(+C\)” is the family of vertical shifts — all share the same derivative.

Fundamental Theorem of Calculus

\[ \frac{d}{dx}\int_a^x f(t)\,dt = f(x), \qquad \int_a^b f(x)\,dx = F(b)-F(a)\ \text{ when }F'=f. \]

Accumulating from a fixed start up to \(x\), then differentiating, recovers \(f\). Evaluating net change of an antiderivative recovers definite area.

Why integration feels harder

Differentiation is mechanical for elementary combinations (chain + product + table). Integration is inverse search: “which function has this derivative?” Many elementary functions have no elementary antiderivative (classic: \(e^{-x^2}\), \(\frac{\sin x}{x}\)). That is why special functions and numerical methods exist — see erf, Si, Ei in the catalog.

Core techniques (intuition only)

  • Substitution: reverse chain rule — change variables so the derivative factor appears.
  • Integration by parts: reverse product rule — \(\int u\,dv=uv-\int v\,du\).
  • Partial fractions: split rational functions into pieces you know.
  • Trig / hyperbolic sub: exploit identities to simplify radicals.
Catalog tip. Each card lists a standard antiderivative (where elementary) or notes the special function that defines the integral when no elementary form exists.