Chapter 8
20 min read
Section 76 of 353

The Fundamental Theorem of Calculus (Part 2)

The Definite Integral

Learning Objectives

By the end of this section, you will be able to:

  1. State the Fundamental Theorem of Calculus Part 2 and explain its significance
  2. Evaluate definite integrals using antiderivatives without computing limits of Riemann sums
  3. Interpret the theorem as the Net Change Theorem in applied contexts
  4. Apply FTC Part 2 to problems in physics, engineering, and economics
  5. Explain why FTC Part 2 is computationally powerful
  6. Connect FTC Part 2 to gradient computation and optimization in machine learning

The Big Picture: The Most Important Theorem in Calculus

"The Fundamental Theorem of Calculus is the spine of the subject — it connects the two pillars of calculus, differentiation and integration, revealing that they are inverse operations."

In the previous section, we discovered FTC Part 1, which tells us that the derivative of an accumulation function F(x)=axf(t)dtF(x) = \int_a^x f(t)\,dt is the original function f(x)f(x). This established that differentiation undoes integration.

Now we turn the relationship around. FTC Part 2 tells us that integration undoes differentiation — and this gives us an incredibly powerful practical tool for computing definite integrals.

The Computational Revolution

Before FTC Part 2, computing a definite integral meant evaluating a limit of Riemann sums — an infinite process. FTC Part 2 reduces this to a single arithmetic operation: find an antiderivative FF, then compute F(b)F(a)F(b) - F(a).

This is why FTC Part 2 is often called the "Evaluation Theorem" — it gives us a practical method to evaluate integrals that would otherwise be impossibly difficult to compute.


Historical Context: Newton, Leibniz, and the Great Unification

The Fundamental Theorem of Calculus was independently discovered by Isaac Newton (around 1666) and Gottfried Wilhelm Leibniz (around 1675). It represents one of the greatest intellectual achievements in history.

Before FTC

Areas, tangents, and rates of change were studied as separate problems. Archimedes found areas using exhaustion; others computed tangent slopes geometrically. There was no systematic connection.

After FTC

FTC unified these into a single coherent theory. Differentiation (slopes) and integration (areas) became inverse operations. This unlocked the entire edifice of modern analysis, physics, and engineering.

Why 'Fundamental'?

The theorem is called "fundamental" because it provides the foundation for all practical applications of calculus. Without FTC, computing integrals would remain a theoretical curiosity rather than a powerful tool.


The Theorem Statement

The Fundamental Theorem of Calculus (Part 2)

Let ff be continuous on [a,b][a, b]. If FF is any antiderivative of ff on [a,b][a, b] (meaning F(x)=f(x)F'(x) = f(x) for all x[a,b]x \in [a, b]), then:

abf(x)dx=F(b)F(a)\int_a^b f(x)\,dx = F(b) - F(a)

The definite integral of ff from aa to bb equals the antiderivative evaluated at the endpoints.

Understanding the Notation

We often write this using the evaluation bar notation:

abf(x)dx=F(x)ab=F(b)F(a)\int_a^b f(x)\,dx = F(x)\Big|_a^b = F(b) - F(a)

The vertical bar with limits indicates "evaluate at the top limit and subtract the value at the bottom limit."

Key Requirements

  • Continuity: ff must be continuous on [a,b][a, b]
  • Antiderivative exists: FF must satisfy F(x)=f(x)F'(x) = f(x) on the interval
  • Any antiderivative works: Since all antiderivatives differ by a constant, and the constant cancels in F(b)F(a)F(b) - F(a), we can use any antiderivative

Why the Constant Cancels

If F(x)F(x) is an antiderivative of f(x)f(x), then so is F(x)+CF(x) + C for any constant CC. But: [F(b)+C][F(a)+C]=F(b)F(a)[F(b) + C] - [F(a) + C] = F(b) - F(a). The constants cancel, so we don't need to worry about which antiderivative we choose!


Why FTC Part 2 Works: The Intuition

The proof of FTC Part 2 relies on FTC Part 1 and the Mean Value Theorem, but the intuition is beautifully simple.

Accumulation Equals Net Change

Think about what the definite integral represents: it's the accumulated area under the curve f(x)f(x) from aa to bb.

Now, if FF is an antiderivative of ff, then F(x)=f(x)F'(x) = f(x). This means f(x)f(x) is the rate of change of FF.

The Key Insight

Integrating a rate of change gives the net change in the quantity. If f=Ff = F', then integrating ff from aa to bb gives the total change in FF, which is F(b)F(a)F(b) - F(a).

A Physical Analogy

Consider a car moving along a straight road:

  • s(t)s(t) = position at time tt
  • v(t)=s(t)v(t) = s'(t) = velocity (rate of change of position)

The integral abv(t)dt\int_a^b v(t)\,dt represents the area under the velocity curve — which is precisely the displacement (change in position):

abv(t)dt=s(b)s(a)=displacement\int_a^b v(t)\,dt = s(b) - s(a) = \text{displacement}

This is FTC Part 2: the integral of the derivative (velocity) equals the net change in the original function (position).

Sketch of the Proof

Proof Outline:

  1. Define G(x)=axf(t)dtG(x) = \int_a^x f(t)\,dt
  2. By FTC Part 1, G(x)=f(x)G'(x) = f(x)
  3. Since both GG and FF have derivative ff, they differ by a constant: G(x)=F(x)+CG(x) = F(x) + C
  4. At x=ax = a: G(a)=aaf(t)dt=0G(a) = \int_a^a f(t)\,dt = 0, so C=F(a)C = -F(a)
  5. Therefore G(x)=F(x)F(a)G(x) = F(x) - F(a)
  6. At x=bx = b: abf(t)dt=G(b)=F(b)F(a)\int_a^b f(t)\,dt = G(b) = F(b) - F(a)

Interactive Exploration

Use this interactive visualizer to explore FTC Part 2. Choose different functions, adjust the integration bounds, and see how the antiderivative evaluation F(b)F(a)F(b) - F(a) gives the exact area under the curve:

The Fundamental Theorem of Calculus (Part 2)

a = 0.0b = 2.001234f(x)

FTC Part 2: Exact Evaluation

Antiderivative F(x):x^2
F(2.00):4.000000
F(0.00):0.000000
F(b) - F(a) =4.000000

Riemann Sum Approximation

n rectangles:10
Midpoint Sum:4.000000
Error:0.000000

Key Insight: Instead of computing the limit of infinitely many rectangles, FTC Part 2 lets us find the exact integral by simply evaluating the antiderivative at the endpoints!


The Evaluation Process

Applying FTC Part 2 involves three steps:

  1. Find an antiderivative F(x)F(x) of f(x)f(x)
  2. Evaluate at the limits: Compute F(b)F(b) and F(a)F(a)
  3. Subtract: The integral is F(b)F(a)F(b) - F(a)

Common Antiderivative Pairs

f(x)F(x) (antiderivative)Verification F'(x) = f(x)
xⁿ (n ≠ -1)x^(n+1)/(n+1)d/dx[x^(n+1)/(n+1)] = xⁿ
1/xln|x|d/dx[ln|x|] = 1/x
e^xe^xd/dx[e^x] = e^x
sin(x)-cos(x)d/dx[-cos(x)] = sin(x)
cos(x)sin(x)d/dx[sin(x)] = cos(x)
sec²(x)tan(x)d/dx[tan(x)] = sec²(x)
1/(1+x²)arctan(x)d/dx[arctan(x)] = 1/(1+x²)

The Net Change Theorem

FTC Part 2 has a powerful interpretation called the Net Change Theorem:

The Net Change Theorem

If F(x)=f(x)F'(x) = f(x), then:

abf(x)dx=abF(x)dx=F(b)F(a)\int_a^b f(x)\,dx = \int_a^b F'(x)\,dx = F(b) - F(a)

The integral of a rate of change gives the net change in the quantity.

Examples of Rate → Net Change

Rate f(x)Quantity F(x)Integral Gives
VelocityPositionDisplacement
Population growth ratePopulationPopulation change
Marginal costTotal costCost change
Marginal revenueTotal revenueRevenue change
Current (dq/dt)ChargeTotal charge transferred
Power (dE/dt)EnergyTotal energy delivered

Interactive: Net Change Demo

Explore how integrating a rate of change gives the net change in different contexts:

The Net Change Theorem

The integral of a rate of change equals the net change in the quantity

Rate Function: Velocity of a car

Time tRate (m/s)
Current Rate:0.00 m/s
Net Change = \u222B\u2080^t rate(s) ds
0.00 m

Interpretation: The shaded area represents the displacement of the car from t=0 to t=0.00. Displacement is the net change in position.

Net Change Theorem: If F'(x) = f(x), then

\u222B_a^b f(x) dx = F(b) - F(a) = net change in F from a to b


Worked Examples

Example 1: Polynomial

Evaluate 13(2x+4)dx\int_1^3 (2x + 4)\,dx

Step 1: Find antiderivative: F(x)=x2+4xF(x) = x^2 + 4x

Step 2: Evaluate at limits:

F(3)=32+4(3)=9+12=21F(3) = 3^2 + 4(3) = 9 + 12 = 21

F(1)=12+4(1)=1+4=5F(1) = 1^2 + 4(1) = 1 + 4 = 5

Step 3: Subtract: F(3)F(1)=215=16F(3) - F(1) = 21 - 5 = 16

13(2x+4)dx=16\int_1^3 (2x + 4)\,dx = 16

Example 2: Trigonometric

Evaluate 0π/2cos(x)dx\int_0^{\pi/2} \cos(x)\,dx

Step 1: Antiderivative of cos(x) is sin(x)

Step 2: Evaluate:

sin(π/2)=1\sin(\pi/2) = 1

sin(0)=0\sin(0) = 0

Step 3: Subtract: 10=11 - 0 = 1

0π/2cos(x)dx=1\int_0^{\pi/2} \cos(x)\,dx = 1

Example 3: Exponential

Evaluate 01exdx\int_0^1 e^x\,dx

Step 1: Antiderivative of exe^x is exe^x (special property!)

Step 2: Evaluate:

e1=e2.718e^1 = e \approx 2.718

e0=1e^0 = 1

Step 3: Subtract: e11.718e - 1 \approx 1.718

01exdx=e1\int_0^1 e^x\,dx = e - 1

Example 4: Natural Log

Evaluate 1e1xdx\int_1^e \frac{1}{x}\,dx

Step 1: Antiderivative of 1/x is ln|x|

Step 2: Evaluate:

ln(e)=1\ln(e) = 1

ln(1)=0\ln(1) = 0

Step 3: Subtract: 10=11 - 0 = 1

1e1xdx=1\int_1^e \frac{1}{x}\,dx = 1


Real-World Applications

Physics: Calculating Work

Problem: A force F(x)=2x+3F(x) = 2x + 3 Newtons acts on an object moving from x=0x = 0 to x=4x = 4 meters. Find the work done.

Solution: Work is the integral of force over distance:

W=04(2x+3)dx=[x2+3x]04W = \int_0^4 (2x + 3)\,dx = [x^2 + 3x]_0^4
=(16+12)(0+0)=28 Joules= (16 + 12) - (0 + 0) = 28 \text{ Joules}

Economics: Consumer Surplus

Problem: The demand curve is p(q)=1002qp(q) = 100 - 2q dollars, and the market price is $40. Find the consumer surplus for the first 30 units.

Solution: Consumer surplus is the area between the demand curve and the price line:

CS=030[(1002q)40]dq=030(602q)dqCS = \int_0^{30} [(100 - 2q) - 40]\,dq = \int_0^{30} (60 - 2q)\,dq
=[60qq2]030=(1800900)0=$900= [60q - q^2]_0^{30} = (1800 - 900) - 0 = \$900

Biology: Population Growth

Problem: A bacteria population grows at rate r(t)=500e0.2tr(t) = 500e^{0.2t} bacteria per hour. Find the total population increase from t=0t = 0 to t=5t = 5 hours.

Solution: The total increase is the integral of the growth rate:

ΔP=05500e0.2tdt=[2500e0.2t]05\Delta P = \int_0^5 500e^{0.2t}\,dt = [2500e^{0.2t}]_0^5
=2500e12500e0=2500(e1)4296 bacteria= 2500e^1 - 2500e^0 = 2500(e - 1) \approx 4296 \text{ bacteria}

Machine Learning Connection

FTC Part 2 has profound connections to optimization and machine learning. The relationship between rates of change (gradients) and accumulated change (loss) is at the heart of gradient-based learning.

Gradients and Loss Functions

In machine learning, we often want to minimize a loss function L(θ)L(\theta) where θ\theta represents model parameters. The gradient L\nabla L tells us the rate of change of loss with respect to parameters.

FTC in Optimization

When we move along a path in parameter space from θa\theta_a to θb\theta_b, the change in loss is:

L(θb)L(θa)=γLdθL(\theta_b) - L(\theta_a) = \int_{\gamma} \nabla L \cdot d\theta

This is the multivariable version of FTC Part 2! The integral of the gradient (rate of change) gives the total change in loss.

Why Gradient Descent Works

Gradient descent moves in the direction of steepest descent — opposite to the gradient. Each step reduces the loss, and by FTC, the total loss reduction is the integral of all the small gradient-based steps.

  • Forward pass: Accumulate transformations through the network (like computing F(x)F(x))
  • Backward pass: Compute gradients via chain rule (like computing F(x)F'(x))
  • Connection: The change in loss over training equals the integral of gradients — FTC Part 2!

Expected Value and Integration

In probabilistic machine learning, expected values are integrals:

E[g(X)]=g(x)f(x)dx\mathbb{E}[g(X)] = \int_{-\infty}^{\infty} g(x) f(x)\,dx

FTC Part 2 connects this to cumulative distribution functions: if FF is the CDF and f=Ff = F' is the PDF, then probabilities are computed as F(b)F(a)F(b) - F(a).


Python Implementation

FTC Part 2 Evaluation

The following code demonstrates how FTC Part 2 makes integral evaluation trivial compared to numerical methods:

FTC Part 2: Exact Evaluation vs Numerical Integration
🐍ftc_evaluation.py
3FTC Part 2 Function

The core of FTC Part 2 is remarkably simple: given an antiderivative F, the integral is just F(b) - F(a). This is trivial to compute!

20Method Comparison

We compare the FTC approach with numerical integration (scipy.integrate.quad). Both give the same answer, but FTC is exact and computationally minimal.

28Antiderivative of x²

The antiderivative of x² is x³/3 (plus a constant, but constants cancel in F(b) - F(a)). We can verify: d/dx[x³/3] = x².

39Sine Integral

The antiderivative of sin(x) is -cos(x). Thus ∫ sin(x) dx from 0 to π equals -cos(π) - (-cos(0)) = -(-1) - (-1) = 2.

49Natural Log

The antiderivative of 1/x is ln|x|. This gives the famous result: ∫₁^e (1/x) dx = ln(e) - ln(1) = 1 - 0 = 1.

67 lines without explanation
1import numpy as np
2from scipy import integrate
3
4def evaluate_integral_ftc(F, a, b):
5    """
6    Evaluate a definite integral using FTC Part 2.
7
8    This is computationally trivial - just two function evaluations!
9    Compare this to the limit definition which requires infinitely
10    many evaluations in theory, or many in practice.
11
12    Parameters:
13    -----------
14    F : callable - The antiderivative function
15    a, b : float - Integration bounds
16
17    Returns:
18    --------
19    float : The exact value F(b) - F(a)
20    """
21    return F(b) - F(a)
22
23def compare_methods():
24    """
25    Compare FTC evaluation with numerical integration.
26    """
27    print("=" * 60)
28    print("FTC Part 2 vs Numerical Integration")
29    print("=" * 60)
30
31    # Example 1: ∫₀² x² dx
32    print("\nExample 1: ∫₀² x² dx")
33    print("-" * 40)
34
35    # FTC approach
36    F1 = lambda x: x**3 / 3  # Antiderivative of x²
37    ftc_result = evaluate_integral_ftc(F1, 0, 2)
38    print(f"FTC Part 2: F(2) - F(0) = {F1(2):.6f} - {F1(0):.6f} = {ftc_result:.6f}")
39
40    # Numerical approach
41    f1 = lambda x: x**2
42    numerical_result, error = integrate.quad(f1, 0, 2)
43    print(f"Numerical:  {numerical_result:.6f} (error estimate: {error:.2e})")
44
45    # Example 2: ∫₀^π sin(x) dx
46    print("\nExample 2: ∫₀^π sin(x) dx")
47    print("-" * 40)
48
49    F2 = lambda x: -np.cos(x)  # Antiderivative of sin(x)
50    ftc_result2 = evaluate_integral_ftc(F2, 0, np.pi)
51    print(f"FTC Part 2: F(π) - F(0) = {F2(np.pi):.6f} - {F2(0):.6f} = {ftc_result2:.6f}")
52
53    numerical_result2, error2 = integrate.quad(np.sin, 0, np.pi)
54    print(f"Numerical:  {numerical_result2:.6f} (error estimate: {error2:.2e})")
55
56    # Example 3: ∫₁^e (1/x) dx = ln(e) - ln(1) = 1
57    print("\nExample 3: ∫₁^e (1/x) dx")
58    print("-" * 40)
59
60    F3 = lambda x: np.log(x)  # Antiderivative of 1/x
61    ftc_result3 = evaluate_integral_ftc(F3, 1, np.e)
62    print(f"FTC Part 2: F(e) - F(1) = {F3(np.e):.6f} - {F3(1):.6f} = {ftc_result3:.6f}")
63
64    numerical_result3, _ = integrate.quad(lambda x: 1/x, 1, np.e)
65    print(f"Numerical:  {numerical_result3:.6f}")
66
67    print("\n" + "=" * 60)
68    print("Key Insight: FTC requires only 2 function evaluations,")
69    print("while numerical methods require hundreds or thousands!")
70    print("=" * 60)
71
72compare_methods()

Net Change Applications

This code illustrates the Net Change Theorem with velocity and displacement:

Net Change Theorem: Velocity to Displacement
🐍net_change.py
3Net Change Theorem

The Net Change Theorem is FTC Part 2 interpreted physically: integrating a rate of change gives the total net change in the underlying quantity.

17Velocity Example

Velocity v(t) is the rate of change of position s(t). The integral of velocity over time gives displacement (net change in position).

24Visualization

We plot both velocity (the rate) and position (the quantity). The area under the velocity curve equals the change in position.

56Computing Net Change

Using FTC Part 2: the integral of velocity from 0 to 6 equals s(6) - s(0). This is the displacement, which matches the area under the v(t) curve.

70 lines without explanation
1import numpy as np
2import matplotlib.pyplot as plt
3
4def demonstrate_net_change_theorem():
5    """
6    The Net Change Theorem: The integral of a rate of change
7    gives the total (net) change in the quantity.
8
9    If F'(x) = f(x), then ∫ₐᵇ f(x) dx = F(b) - F(a)
10
11    This is FTC Part 2 interpreted as:
12    "The integral of a rate gives the net change."
13    """
14
15    # Example: Velocity and Displacement
16    # v(t) = 6t - t² (velocity in m/s)
17    # s(t) = 3t² - t³/3 (position, since s'(t) = v(t))
18
19    v = lambda t: 6*t - t**2  # Rate of change (velocity)
20    s = lambda t: 3*t**2 - t**3/3  # Antiderivative (position)
21
22    t = np.linspace(0, 6, 100)
23
24    fig, axes = plt.subplots(1, 2, figsize=(14, 5))
25
26    # Left plot: Velocity vs Time
27    ax1 = axes[0]
28    ax1.fill_between(t, v(t), alpha=0.3, color='green', label='Displacement (area)')
29    ax1.plot(t, v(t), 'b-', linewidth=2, label='Velocity v(t)')
30    ax1.axhline(y=0, color='gray', linestyle='-', linewidth=0.5)
31    ax1.set_xlabel('Time (s)', fontsize=12)
32    ax1.set_ylabel('Velocity (m/s)', fontsize=12)
33    ax1.set_title('Velocity Function: v(t) = 6t - t²', fontsize=14)
34    ax1.legend()
35    ax1.grid(True, alpha=0.3)
36
37    # Mark where velocity changes sign (t = 6)
38    ax1.axvline(x=6, color='red', linestyle='--', alpha=0.5)
39
40    # Right plot: Position vs Time
41    ax2 = axes[1]
42    ax2.plot(t, s(t), 'r-', linewidth=2, label='Position s(t)')
43    ax2.axhline(y=0, color='gray', linestyle='-', linewidth=0.5)
44    ax2.set_xlabel('Time (s)', fontsize=12)
45    ax2.set_ylabel('Position (m)', fontsize=12)
46    ax2.set_title('Position Function: s(t) = 3t² - t³/3', fontsize=14)
47    ax2.legend()
48    ax2.grid(True, alpha=0.3)
49
50    # Annotate key points
51    t_vals = [0, 3, 6]
52    for ti in t_vals:
53        ax2.plot(ti, s(ti), 'ro', markersize=8)
54        ax2.annotate(f's({ti}) = {s(ti):.1f}',
55                     (ti, s(ti)), textcoords="offset points",
56                     xytext=(10, 10), fontsize=9)
57
58    plt.tight_layout()
59    plt.savefig('net_change.png', dpi=150, bbox_inches='tight')
60    plt.show()
61
62    # Calculate net change
63    print("Net Change Theorem Example:")
64    print("-" * 50)
65    print(f"Displacement from t=0 to t=6:")
66    print(f"  ∫₀⁶ v(t) dt = s(6) - s(0)")
67    print(f"             = {s(6):.1f} - {s(0):.1f}")
68    print(f"             = {s(6) - s(0):.1f} meters")
69    print()
70    print("Note: The car moves forward when v > 0 (0 < t < 6)")
71    print("and backward when v < 0 (never in this case).")
72    print("The net displacement equals the total distance traveled here.")
73
74demonstrate_net_change_theorem()

Machine Learning Connection

See how FTC Part 2 connects to gradient descent and optimization:

FTC Part 2 in Machine Learning
🐍ftc_ml_connection.py
3FTC in Optimization

Gradient descent and FTC are deeply connected: the gradient is the rate of change of loss, and integrating it along the optimization path gives the total change in loss.

14Simple Loss Function

We use L(θ) = θ² with gradient 2θ. Gradient descent moves toward the minimum at θ = 0.

33Loss Change Analysis

By FTC Part 2, the change in loss L(θ_final) - L(θ₀) equals the integral of the gradient along the optimization path.

48Neural Network Context

In deep learning, the forward pass computes the output (accumulation), and the backward pass computes gradients (derivatives). FTC connects these operations.

84 lines without explanation
1import numpy as np
2
3def gradient_descent_ftc_connection():
4    """
5    Demonstrating FTC in the context of gradient descent.
6
7    Key insight: In gradient-based optimization, we compute
8    gradients (derivatives) to update parameters. The integral
9    of the gradient along a path gives the change in the loss!
10
11    ∫ₐᵇ ∇L(θ) · dθ = L(b) - L(a)
12    """
13
14    # Simple 1D loss function: L(θ) = θ² (minimum at θ = 0)
15    L = lambda theta: theta**2
16    grad_L = lambda theta: 2 * theta  # dL/dθ = 2θ
17
18    # Gradient descent from θ=2 toward θ=0
19    theta = 2.0
20    learning_rate = 0.1
21    trajectory = [theta]
22
23    for _ in range(20):
24        gradient = grad_L(theta)
25        theta = theta - learning_rate * gradient
26        trajectory.append(theta)
27
28    trajectory = np.array(trajectory)
29
30    print("Gradient Descent and FTC Connection")
31    print("=" * 50)
32    print(f"Starting point: θ₀ = {trajectory[0]:.4f}")
33    print(f"Final point:    θ_final = {trajectory[-1]:.4f}")
34    print()
35
36    # The total change in loss
37    loss_change = L(trajectory[-1]) - L(trajectory[0])
38    print(f"Loss at start:  L(θ₀) = {L(trajectory[0]):.4f}")
39    print(f"Loss at end:    L(θ_final) = {L(trajectory[-1]):.6f}")
40    print(f"Change in loss: ΔL = {loss_change:.4f}")
41    print()
42
43    # By FTC, this equals the integral of the gradient along the path
44    print("By FTC Part 2:")
45    print("  ∫ dL = ∫ (dL/dθ) dθ = L(θ_final) - L(θ₀)")
46    print()
47
48    # This is why gradient descent works: each step moves in the
49    # direction that decreases the integral (and hence the loss)
50    print("Key ML Insight:")
51    print("  The gradient tells us the rate of change of loss.")
52    print("  Integrating the gradient gives the total loss change.")
53    print("  Gradient descent exploits this to minimize loss!")
54
55def automatic_differentiation_context():
56    """
57    FTC connects forward and backward passes in neural networks.
58
59    Forward pass: computes the function (integral-like accumulation)
60    Backward pass: computes gradients (derivatives)
61
62    These are related by FTC!
63    """
64
65    # Simplified neural network: y = σ(wx + b)
66    # Loss: L = (y - target)²
67
68    # Forward pass: accumulate transformations
69    # This is like computing F(x) from f
70
71    # Backward pass: compute gradients via chain rule
72    # ∂L/∂w = ∂L/∂y · ∂y/∂(wx+b) · ∂(wx+b)/∂w
73
74    # The relationship: ∫ ∂L/∂θ dθ (along training path) = ΔL
75
76    print("\nFTC in Neural Network Training:")
77    print("=" * 50)
78    print("Forward pass: y = f(f(...f(x)))  (composition)")
79    print("Backward pass: ∂L/∂θ via chain rule")
80    print()
81    print("Connection: The integral of gradients over training")
82    print("equals the total change in loss (FTC Part 2).")
83    print()
84    print("This is why we track loss curves - they show the")
85    print("accumulated effect of all gradient updates!")
86
87gradient_descent_ftc_connection()
88automatic_differentiation_context()

Common Mistakes to Avoid

Mistake 1: Forgetting the negative sign

Wrong: 0πsin(x)dx=cos(π)cos(0)=11=2\int_0^{\pi} \sin(x)\,dx = \cos(\pi) - \cos(0) = -1 - 1 = -2

Correct: The antiderivative of sin(x) is -cos(x).

0πsin(x)dx=[cos(x)]0π=cos(π)(cos(0))=(1)(1)=2\int_0^{\pi} \sin(x)\,dx = [-\cos(x)]_0^{\pi} = -\cos(\pi) - (-\cos(0)) = -(-1) - (-1) = 2

Mistake 2: Wrong order of subtraction

Wrong: F(a)F(b)F(a) - F(b)

Correct: Always compute F(b)F(a)F(b) - F(a) (upper limit minus lower limit).

Mistake 3: Applying FTC when f is not continuous

Problem: FTC Part 2 requires ff to be continuous on [a,b][a, b]. If ff has discontinuities in the interval, you must split the integral at those points.

Mistake 4: Confusing definite and indefinite integrals

Indefinite: f(x)dx=F(x)+C\int f(x)\,dx = F(x) + C (family of functions)

Definite: abf(x)dx=F(b)F(a)\int_a^b f(x)\,dx = F(b) - F(a) (single number)

For definite integrals, the constant CC cancels, so we don't write it.

Mistake 5: Using the wrong antiderivative formula

Always verify your antiderivative by differentiating it! If F(x)f(x)F'(x) \neq f(x), you have the wrong antiderivative.


Test Your Understanding

Question 1 of 8

Score: 0/0

If F(x) = x³ is an antiderivative of f(x) = 3x², what is ∫₁² 3x² dx?


Summary

The Fundamental Theorem of Calculus Part 2 transforms the computation of definite integrals from an infinite limit process to a simple evaluation.

The Central Result

abf(x)dx=F(b)F(a)\int_a^b f(x)\,dx = F(b) - F(a)

where F(x)=f(x)F'(x) = f(x)

Key Concepts

ConceptDescription
FTC Part 2The integral equals the antiderivative evaluated at endpoints
AntiderivativeF is an antiderivative of f if F&apos;(x) = f(x)
Evaluation NotationF(x)|ₐᵇ means F(b) - F(a)
Net Change TheoremIntegrating a rate gives the net change in quantity
Computational PowerReduces infinite limit to two function evaluations

Key Takeaways

  1. FTC Part 2 is the evaluation theorem — it tells us HOW to compute definite integrals using antiderivatives
  2. The formula F(b)F(a)F(b) - F(a) works for any antiderivative since constants cancel
  3. The Net Change Theorem interprets this as: integrating a rate gives the net change
  4. FTC connects differentiation and integration as inverse operations
  5. This theorem underlies gradient-based optimization in machine learning
  6. Always verify your antiderivative by differentiating it
The Core Insight:
"Integration and differentiation are inverse operations. To undo differentiation, integrate. To evaluate an integral, find an antiderivative."
Coming Next: In the next section, we'll explore the Average Value of a Function — using definite integrals to find the "mean height" of a function over an interval.
Loading comments...