What is it?
is the limit of Riemann sums: the signed area between the graph and the axis, or, more generally, the total accumulated by a rate over .
Why does it exist?
Many quantities are "rate × amount" only when the rate is constant: distance = speed × time, mass = density × volume, work = force × distance. When the rate varies, chop the domain into pieces where it is nearly constant, add up, and take the limit. The integral is that procedure, and it solves the problem of accumulating a varying quantity.
Intuition
Geometrically: area under the curve, counting area below the axis as negative. Statistically: is the average value of on — which is why an integral can be estimated by averaging at random points (Monte Carlo). Physically: the total change produced by a rate.
Formal definition
is Riemann integrable on if the Riemann sums converge to the same number for every choice of sample points as the mesh ; then . Every continuous function (and every bounded function with finitely many discontinuities) is integrable. Properties: linearity, additivity over intervals, monotonicity ().
Formulas
- average value
- probability as an integral of a density
How is it computed?
Exactly, when an antiderivative is known: Barrow's rule (fundamental theorem). Otherwise numerically: Riemann/trapezoid/Simpson/Gaussian quadrature in low dimension, Monte Carlo in high dimension.
Example
Energy of a signal over one second: . The same integral, as a sum over samples , is how audio software measures loudness (RMS).
Why does it matter?
Probabilities, expectations, energies, masses, light arriving at a pixel, the expected loss of a model: all are integrals. Most cannot be computed exactly, and a large part of computational science is about approximating them well — quadrature in low dimensions, Monte Carlo in high ones.
Where it shows up in computing
Monte Carlo estimates as an average of at random points; error in any dimension.
The colour of a pixel is an integral of incoming light over directions.
Signal energy, correlation and convolution are integrals (sums, once sampled).
Positions are integrals of velocities, velocities integrals of accelerations.
Where it shows up in AI
The true risk is an integral; the training loss is its sample average.
Where is it used?
Computing topics reachable from here, through the chain of ideas that leads to them:
ℒ AI and machine learning
- Convolution→Convolutional networks (CNNs)★★★★★
- Continuous random variables→Probability density function→Bayesian inference★★★★★
- Continuous random variables→Probability density function→Generative models★★★★★
- Continuous random variables→Probability density function→Expectation→Loss function★★★★★
- Continuous random variables→Probability density function→Maximum likelihood estimation→Logistic regression★★★★★
- Continuous random variables→Probability density function→Expectation→Stochastic gradient descent (SGD)★★★★★
- +6
⚛ Physics and simulation
- Multiple integrals and change of variables→Surface integrals and flux→Divergence theorem (Gauss)→Electromagnetism (Maxwell's equations)★★★★★
- Multiple integrals and change of variables→Surface integrals and flux→Divergence theorem (Gauss)→Fluid dynamics and CFD★★★★★
- Multiple integrals and change of variables→Surface integrals and flux→Divergence theorem (Gauss)→Fluid dynamics and CFD→Weather and climate modelling★★★★★
- Physics engines★★★★★
- Line integrals→Classical mechanics★★★★★
- Physics engines→N-body gravitational simulation★★★★★
- +1
∿ Signals, media and vision
- Convolution→Signal processing★★★★★
- Convolution→Image processing and computer vision★★★★★
- Convolution→Digital filters★★★★★
- Improper integrals→Fourier transform→Sampling theorem (Nyquist–Shannon)★★★★★
- Improper integrals→Fourier transform→Fast Fourier transform (FFT)★★★★★
- Convolution→Signal processing→Media compression (JPEG, MP3, video)★★★★★
- +1
What depends on it
Exercises
Compute and interpret the sign.
Solution
. Positive: the area above the axis (for ) exceeds the small negative part on .
Estimate with an integral and random numbers. How many samples for 3 correct decimals?
Solution
with uniform. The standard error is about ; for you need . Monte Carlo is simple but slow.