Chapter 9: What Does Area Have to Do with Slope?ΒΆ
The Deep Connection Between Integration and DifferentiationΒΆ
At first glance, computing the area under a curve and finding the slope of a tangent line seem like entirely unrelated problems. The Fundamental Theorem of Calculus reveals they are two sides of the same coin. This chapter explores why this connection holds, not just that it does.
The key idea: define an βarea functionβ \(A(x) = \int_0^x f(t)\,dt\) that tracks how much area has accumulated as \(x\) moves to the right. When you nudge \(x\) by a tiny amount \(dx\), the area increases by approximately \(f(x) \cdot dx\) (a thin rectangle of height \(f(x)\) and width \(dx\)). Dividing both sides by \(dx\) gives \(A'(x) = f(x)\) β the derivative of the area function is the original function. This is the Fundamental Theorem in action. In machine learning, this inverse relationship underpins automatic differentiation frameworks: if you can compute a forward pass (accumulation/integration of operations), the backward pass (differentiation) can undo it systematically.
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
plt.rcParams['figure.figsize'] = (14, 10)
Visualizing \(A'(x) = f(x)\): The Area Function and Its DerivativeΒΆ
Define the cumulative area function \(A(x) = \int_0^x f(t)\,dt\). As \(x\) increases by a small step \(dx\), a thin strip of approximate area \(f(x) \cdot dx\) is added. The rate of change of the accumulated area at any point is therefore the height of the original function at that point:
This is a powerful conceptual bridge: to evaluate a definite integral, find any function whose derivative matches the integrand (an antiderivative), then evaluate it at the endpoints. The code below plots both \(f(x)\) and \(A(x)\) side by side so you can verify visually that the slope of \(A\) at each point matches the value of \(f\).