# Chapter 2: Calculus

## Overview & Core Themes

This chapter develops the formal machinery of differential and integral calculus, bridging infinitesimal concepts with algebraic methods.

1. **The Derivative as a Formal Limit**  
   The instantaneous rate of change is formalized as the limit of the difference quotient:
   $$f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}$$
   This operator maps a function $f(x)$ to its derivative function $f'(x)$, providing both local geometric properties (tangent slopes) and kinematic measurements (instantaneous velocity and acceleration).

2. **Rules of Differentiation**  
   To move beyond computing limits from first principles, systematic rules were established:
   - **Product Rule:** $(fg)' = f'g + fg'$
   - **Quotient Rule:** $\left(\frac{f}{g}\right)' = \frac{f'g - fg'}{g^2}$
   - **Chain Rule:** $\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)$

3. **Optimization and Curve Sketching**  
   Derivatives allow precise structural analysis of curves:
   - **First Derivative:** Points where $f'(x) = 0$ or is undefined identify critical points, indicating potential local extrema (maxima and minima).
   - **Second Derivative:** The sign of $f''(x)$ reveals curvature and concavity; zeros of $f''(x)$ where concavity changes indicate inflection points.

4. **Integration and the Fundamental Theorem of Calculus**  
   The definite integral accumulates continuous quantities over an interval $[a, b]$ through the limit of Riemann sums:
   $$\int_a^b f(x) \, dx = \lim_{n \to \infty} \sum_{i=1}^n f(x_i^*) \Delta x$$
   The Fundamental Theorem of Calculus formally connects the two branches:
   $$\frac{d}{dx} \left[ \int_a^x f(t) \, dt \right] = f(x) \quad \text{and} \quad \int_a^b f(x) \, dx = F(b) - F(a)$$
   where $F'(x) = f(x)$.

---

## Generative AI Prompts for Visuals

> ### Diagram: Extrema and Concavity on a Polynomial Curve
> **Generative AI Prompt:**  
> *A clean 2D mathematical coordinate diagram on a pure white background. A continuous cubic function is plotted on labeled $x$ and $y$ axes. The local maximum and local minimum are marked with prominent circular nodes and horizontal dotted tangent lines labeled $f'(x) = 0$. An inflection point between them is clearly marked where the curve transitions from concave downward to concave upward, labeled $f''(x) = 0$. Crisp vector graphic, high contrast, minimalist academic textbook style.*

> ### Diagram: The Fundamental Theorem of Calculus (Area Accumulation)
> **Generative AI Prompt:**  
> *An educational calculus diagram illustrating the area accumulator function. A continuous curve $y = f(t)$ is plotted over horizontal axis $t$. From a fixed point $a$ to an arbitrary point $x$, the area beneath the curve is shaded in translucent blue. At $x$, a thin vertical strip of width $\Delta x$ and height $f(x)$ is highlighted in orange to visually illustrate how the change in accumulated area $\Delta A$ approximates $f(x) \Delta x$. Sharp vector lines, clean mathematical annotations, modern textbook graphic.*

> ### Diagram: The Chain Rule (Composite Function Mapping)
> **Generative AI Prompt:**  
> *A conceptual mathematical mapping diagram showing three parallel or sequentially aligned real coordinate lines labeled $x$, $u = g(x)$, and $y = f(u)$. Directed arrows between the axes illustrate the mappings $g$ and $f$, with an overarching dashed arrow representing the composition $f \circ g$. Small delta intervals $\Delta x$, $\Delta u$, and $\Delta y$ show relative stretching and scaling factors. Elegant minimalist infographic style, crisp black lines, clean white background.*
