Search Knowledge

© 2026 LIBREUNI PROJECT

Calculus & Analysis / Overview

Integration: The Art of Accumulation

Integration: The Art of Accumulation

While derivatives break a function down into its local rates of change, integration builds it back up. Integration is the process of adding up infinitely many tiny pieces to find a whole.

1. The Definite Integral as a Sum

We define the definite integral abf(x)dx\int_a^b f(x) \, dx as the signed area under the curve f(x)f(x) from aa to bb. Formally, this is reached through a Riemann Sum: we divide the area into nn rectangles and take the limit as nn \to \infty.

Instead of just looking at the formula, let’s watch the approximation get better as we add more rectangles.

python
1import numpy as np
2import matplotlib.pyplot as plt
3 
4def f(x): return x * np.sin(x) + 2
5 
6a, b = 0, 10
7n = 10 # Change this to 5, 20, or 100 to see convergence
8 
9x = np.linspace(a, b, 1000)
10x_rect = np.linspace(a, b, n, endpoint=False)
11width = (b - a) / n
12 
13plt.plot(x, f(x), 'k', linewidth=2)
14plt.bar(x_rect, f(x_rect), width=width, align='edge', alpha=0.3, color='blue', edgecolor='b')
15plt.title(f"Riemann Sum Approximation (n={n})")
16plt.show()

2. Numerical Integration: Trapezoidal Rule

Computer scientists rarely integrate by hand. They use algorithms like the Trapezoidal Rule, which fits a line (trapezoid) between points instead of a flat rectangle. This usually converges much faster.

python
1import numpy as np
2 
3def f(x): return np.exp(-x**2) # The Gaussian bell curve
4 
5a, b = 0, 1
6n = 5
7h = (b - a) / n
8 
9x = np.linspace(a, b, n + 1)
10y = f(x)
11 
12# Trapezoidal rule: h/2 * (y0 + 2y1 + ... + yn)
13area = (h/2) * (y[0] + 2 * np.sum(y[1:-1]) + y[-1])
14 
15print(f"Estimated area under e^(-x^2) from 0 to 1: {area:.6f}")
16print("This is related to the Error Function (erf) used in Statistics.")

3. The Fundamental Theorem of Calculus (FTC)

The FTC states that integration and differentiation are inverse operations. If F(x)F(x) is the antiderivative of f(x)f(x), then: abf(x)dx=F(b)F(a)\int_a^b f(x) \, dx = F(b) - F(a)

This turns a hard problem of “infinite summing” into a simple problem of “subtraction.”

If velocity v(t) is the derivative of position s(t), what does the integral of v(t) represent?

4. Improper Integrals

Sometimes we need to integrate over an infinite interval, such as 0exdx\int_0^\infty e^{-x} \, dx. These are vital for calculating total energy or probabilities in bell curves.

Does the integral of 1/x from 1 to infinity converge?

5. Summary Check

Which numerical method is generally more accurate for the same number of steps?