TExcelTAD
Home › Calculus Essentials › The Definite Integral and the Fundamental Theorem

The Definite Integral and the Fundamental Theorem

The definite integral turns the limit of Riemann sums into a single number: the signed area under a curve between two points. The Fundamental Theorem of Calculus says you can compute that number with an antiderivative instead of an infinite sum, which links the two halves of calculus.

Definition and notation

∫abf(x) dx=lim⁡n→∞∑i=1nf(xi∗) Δx\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x

aa and bb are the limits of integration, ff is the integrand. Unlike the indefinite integral, the result is a number, not a family of functions. It is a signed area: regions above the x-axis count positive and regions below count negative.

The Fundamental Theorem

Part 2 (the evaluation theorem). If FF is any antiderivative of a continuous ff, then

∫abf(x) dx=F(b)−F(a)written[F(x)]ab\int_a^b f(x)\,dx = F(b) - F(a) \qquad \text{written} \quad \Big[F(x)\Big]_a^b

So the area under x2x^2 from 0 to 2 is [x3/3]02=8/3−0=8/3\Big[x^3/3\Big]_0^2 = 8/3 - 0 = 8/3, exactly the number the Riemann sums in the previous lesson were creeping towards. The + C+\,C cancels in the subtraction, which is why it never appears in definite integrals.

Part 1 (the accumulation theorem). Define an area-so-far function G(x)=∫axf(t) dtG(x) = \int_a^x f(t)\,dt. Then

G′(x)=f(x)G'(x) = f(x)

The rate at which accumulated area grows is the height of the curve at the moving edge. Integration builds up, differentiation reads off the rate: they are inverse operations.

python · try it yourself
import sympy as sp

x, t = sp.symbols("x t")
print("∫_0^2 x^2 dx      =", sp.integrate(x**2, (x, 0, 2)))
print("∫_0^pi sin x dx   =", sp.integrate(sp.sin(x), (x, 0, sp.pi)))
print("∫_0^2pi sin x dx  =", sp.integrate(sp.sin(x), (x, 0, 2 * sp.pi)), " (the lobes cancel)")

G = sp.integrate(sp.cos(t) * t**2, (t, 0, x))     # area-so-far function
print("G(x)  =", G)
print("G'(x) =", sp.simplify(sp.diff(G, x)))      # FTC part 1: the integrand again
∫_0^2 x^2 dx      = 8/3
∫_0^pi sin x dx   = 2
∫_0^2pi sin x dx  = 0  (the lobes cancel)
G(x)  = x**2*sin(x) + 2*x*cos(x) - 2*sin(x)
G'(x) = x**2*cos(x)

Properties

Property Formula
Zero width ∫aaf dx=0\int_a^a f\,dx = 0
Reversing limits ∫baf dx=−∫abf dx\int_b^a f\,dx = -\int_a^b f\,dx
Splitting the interval ∫acf dx=∫abf dx+∫bcf dx\int_a^c f\,dx = \int_a^b f\,dx + \int_b^c f\,dx
Linearity ∫ab(kf+g) dx=k∫abf dx+∫abg dx\int_a^b (kf + g)\,dx = k\int_a^b f\,dx + \int_a^b g\,dx
Comparison f≤gf \le g on [a,b]⇒∫abf dx≤∫abg dx[a, b] \Rightarrow \int_a^b f\,dx \le \int_a^b g\,dx
Average value favg=1b−a⋅∫abf dxf_{\text{avg}} = \dfrac{1}{b - a} \cdot \int_a^b f\,dx

The average value is the height of the rectangle with the same area as the region under the curve.

Checking Part 1 numerically

You can watch the theorem work without any algebra: accumulate area with a running sum and take its slope with a finite difference.

python · try it yourself
import numpy as np

x = np.linspace(0, 3, 3001)
f = np.exp(-x) * np.sin(3 * x)
dx = x[1] - x[0]
G = np.concatenate([[0], np.cumsum((f[1:] + f[:-1]) / 2 * dx)])   # running area
slope = np.gradient(G, dx)                                       # dG/dx

for xv in [0.5, 1.0, 2.0]:
    i = int(round(xv / dx))
    print(f"x={xv}: dG/dx = {slope[i]:.5f}   f(x) = {f[i]:.5f}")
x=0.5: dG/dx = 0.60501   f(x) = 0.60501
x=1.0: dG/dx = 0.05192   f(x) = 0.05192
x=2.0: dG/dx = -0.03781   f(x) = -0.03781

In software: probability is area

In statistics and machine learning a continuous random variable is described by a probability density function (PDF) p(x)p(x). Probabilities are areas under it:

P(a≤X≤b)=∫abp(x) dxand∫p(x) dx over everything=1P(a \le X \le b) = \int_a^b p(x)\,dx \qquad \text{and} \qquad \int p(x)\,dx \text{ over everything} = 1

The CDF F(x)=P(X≤x)=∫−∞xp(t) dtF(x) = P(X \le x) = \int_{-\infty}^{x} p(t)\,dt is exactly the area-so-far function, and Part 1 says the PDF is the derivative of the CDF.

python · try it yourself
import math
from scipy.integrate import quad
from scipy.stats import norm

pdf = lambda x: math.exp(-x * x / 2) / math.sqrt(2 * math.pi)
area, _ = quad(pdf, -1, 1)
print(f"P(-1 <= Z <= 1) by integration = {area:.6f}")
print(f"same from the CDF              = {norm.cdf(1) - norm.cdf(-1):.6f}")
total, _ = quad(pdf, -math.inf, math.inf)
print(f"total area                     = {total:.6f}")
P(-1 <= Z <= 1) by integration = 0.682689
same from the CDF              = 0.682689
total area                     = 1.000000

That 0.68270.6827 is the "68%" of the 68–95–99.7 rule from Standard Deviation.

Exercises

Exercise 1: Evaluate

Compute ∫13(2x+1) dx\int_1^3 (2x + 1)\,dx.

Answer

10

Solution
F(x)=x2+xF(3)−F(1)=(9+3)−(1+1)=12−2=10\begin{aligned} F(x) &= x^2 + x \\ F(3) - F(1) &= (9 + 3) - (1 + 1) = 12 - 2 = 10 \end{aligned}

Exercise 2: Average value

Find the average value of f(x)=x2f(x) = x^2 on [0,3][0, 3].

Answer

3

Solution
∫03x2 dx=[x3/3]03=9average=9/(3−0)=3\begin{aligned} \int_0^3 x^2\,dx &= \Big[x^3/3\Big]_0^3 = 9 \\ \text{average} &= 9 / (3 - 0) = 3 \end{aligned}

Exercise 3: Part 1 without integrating

Let G(x)=∫0x1+t3 dtG(x) = \int_0^x \sqrt{1 + t^3}\,dt. Find G′(2)G'(2).

Answer

3

Solution
FTC part 1:G′(x)=1+x3G′(2)=1+8=3\begin{aligned} \text{FTC part 1:}\quad G'(x) &= \sqrt{1 + x^3} \\ G'(2) &= \sqrt{1 + 8} = 3 \end{aligned}

No antiderivative of 1+t3\sqrt{1 + t^3} in elementary functions is needed.

Exercise 4: A probability from a density

A server's response time XX (seconds) has density p(x)=2e−2xp(x) = 2e^{-2x} for x≥0x \ge 0. Find P(X≤1)P(X \le 1) exactly and check it with quad.

Answer

1−e−2≈0.8646651 - e^{-2} \approx 0.864665

Solution
∫012e−2x dx=[−e−2x]01=−e−2+1\int_0^1 2e^{-2x}\,dx = \Big[-e^{-2x}\Big]_0^1 = -e^{-2} + 1
python · try it yourself
import math
from scipy.integrate import quad

value, _ = quad(lambda x: 2 * math.exp(-2 * x), 0, 1)
print(f"{value:.6f} {1 - math.exp(-2):.6f}")
0.864665 0.864665

Test yourself

What is ∫023x2 dx\int_0^2 3x^2\,dx?

  1. 12
  2. 6
  3. 8
  4. 4

If G(x)=∫1xcos⁡(t2) dtG(x) = \int_1^x \cos(t^2)\,dt, what is G′(x)G'(x)?

  1. sin⁡(x2)\sin(x^2)
  2. cos⁡(x2)\cos(x^2)
  3. −2xsin⁡(x2)-2x\sin(x^2)
  4. cos⁡(x2)−cos⁡(1)\cos(x^2) - \cos(1)

Why does ∫02πsin⁡x dx\int_0^{2\pi} \sin x\,dx equal 0?

  1. sin⁡x\sin x is zero everywhere
  2. The positive lobe and the negative lobe have equal size and cancel
  3. The integral does not exist
  4. Because 2π2\pi is a multiple of π\pi