Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guides/Probability and measure/05

The Lebesgue integral

Lesson 5 of 13 · 1 min read

"Measurable functions" showed which functions allow the question "how much of the space is sent into this range of values?" to be answered, and it introduced the simple functions and the dyadic staircases that approach any measurable function from below. "Lebesgue measure and null sets" supplied the measure itself, length on the line and area in the plane. What is still missing is a way to add up a function over a space: to say what the total of fff is when fff has a value at every point of [0,1][0, 1][0,1], of the unit square, or of any other measure space. This lesson builds that total, the Lebesgue integral ∫f dμ\int f\,d\mu∫fdμ for an arbitrary measure μ\muμ. It starts from the column-by-column method of school calculus, shows where it breaks, and replaces it by a layer-by-layer method that needs only the measures of the level sets of fff. The next lesson, "Convergence theorems", asks what happens to integrals when functions are replaced by their limits.

Riemann's columns

The integral of school calculus, the Riemann integral, slices the domain. To find the area under fff on [0,1][0, 1][0,1], cut [0,1][0, 1][0,1] into NNN columns of width 1/N1/N1/N, and on each column record the lowest and the highest value of fff. Rectangles with the lowest heights fit under the graph, and their total area is the lower sum. Rectangles with the highest heights stick out above it, and their total area is the upper sum. The integral is the number that stays squeezed between the two sums as the columns become narrow.

Take the hump f(x)=4x(1−x)f(x) = 4x(1 - x)f(x)=4x(1−x), which rises from 0 at x=0x = 0x=0 to 1 at x=12x = \tfrac12x=21​ and falls back to 0 at x=1x = 1x=1. With N=4N = 4N=4 columns the lowest values are 0,0.75,0.75,00, 0.75, 0.75, 00,0.75,0.75,0 and the highest are 0.75,1,1,0.750.75, 1, 1, 0.750.75,1,1,0.75, so the lower sum is 0.3750.3750.375 and the upper sum is 0.8750.8750.875. With N=8N = 8N=8 the two sums are 0.53130.53130.5313 and 0.78130.78130.7813. The gap between them halves every time the number of columns doubles, and both sums close in on the same number, 2/32/32/3.

This works because a continuous function hardly changes on a narrow column. The method quietly assumes that fff is nearly constant on short stretches of the domain, and a function that jumps within every stretch breaks the assumption. Consider the indicator 1Q\mathbf{1}_{\mathbb{Q}}1Q​ on [0,1][0, 1][0,1], equal to 1 at the rational numbers and 0 elsewhere. Every column, however narrow, contains both rational and irrational numbers, since both are dense, so every upper sum is 1 and every lower sum is 0: the Riemann integral does not exist.

Yet "Lebesgue measure and null sets" showed that the rationals have length 0. A function equal to 1 on a set that occupies no room should add nothing to a total. Columns cannot see this, because they look at where a value sits; layers look at how much of the space carries each value.

Lebesgue's layers

Lebesgue explained his idea with coins. A cashier has a heap of mixed coins and wants their total value. One way is to take the coins one by one in the order they come to hand and keep a running sum: that is the column method, which follows the points of the domain in order. The other way is to sort the coins into piles by value, count each pile, and add up value times count. This never needs to know in what order the coins lay; it needs only how many coins there are of each value.

Replace the heap by the space Ω\OmegaΩ, the coins by points, and the number of coins by the measure. The layer method groups the points of Ω\OmegaΩ by the value of fff, measures each group, and adds up value times measure, whether the points of a group are close together or scattered over the whole space.

Do this for f(x)=4x(1−x)f(x) = 4x(1 - x)f(x)=4x(1−x) with the staircase φ2\varphi_2φ2​ of "Measurable functions", which rounds every value down to a multiple of 14\tfrac1441​. It takes the value 000 on a set of length 0.13400.13400.1340, the value 14\tfrac1441​ on a set of length 0.15890.15890.1589, the value 12\tfrac1221​ on a set of length 0.20710.20710.2071 and the value 34\tfrac3443​ on a set of length 0.50.50.5, and the four lengths add up to 1. The total of the staircase is

0⋅0.1340+14⋅0.1589+12⋅0.2071+34⋅0.5=0.5183.0 \cdot 0.1340 + \tfrac14 \cdot 0.1589 + \tfrac12 \cdot 0.2071 + \tfrac34 \cdot 0.5 = 0.5183.0⋅0.1340+41​⋅0.1589+21​⋅0.2071+43​⋅0.5=0.5183.

This underestimates the area 2/32/32/3, because every value was rounded down; finer bands improve it. For 1Q\mathbf{1}_{\mathbb{Q}}1Q​ the only layer that counts is the value 1 on a set of length 0, contributing 1⋅0=01 \cdot 0 = 01⋅0=0, so the total is 0, as it should be. Layers need the measure of the sets {a≤f<b}\{a \le f < b\}{a≤f<b}, and measurability, the subject of "Measurable functions", is exactly what makes these sets measurable.

Integrals of simple functions

The layer method is exact for functions that take finitely many values. Let φ\varphiφ be a simple function. Write it in standard form, with distinct values a1,…,ama_1, \ldots, a_ma1​,…,am​ taken on disjoint measurable sets A1,…,AmA_1, \ldots, A_mA1​,…,Am​. Its integral with respect to a measure μ\muμ is

∫φ dμ=∑k=1mak μ(Ak),\int \varphi \, d\mu = \sum_{k=1}^{m} a_k\, \mu(A_k),∫φdμ=k=1∑m​ak​μ(Ak​),

with the convention 0⋅∞=00 \cdot \infty = 00⋅∞=0, so that a value 0 never contributes, even on a set of infinite measure. In words: each value times the amount of space on which it is taken.

The same number results from any way of writing φ\varphiφ as a combination of indicators, even if the sets overlap. Take φ=2⋅1[0,0.5]+3⋅1[0.25,1]\varphi = 2\cdot\mathbf{1}_{[0, 0.5]} + 3\cdot\mathbf{1}_{[0.25, 1]}φ=2⋅1[0,0.5]​+3⋅1[0.25,1]​ on [0,1][0, 1][0,1] with length as the measure, the example of "Measurable functions". Reading the formula off the overlapping form gives 2⋅0.5+3⋅0.75=3.252 \cdot 0.5 + 3 \cdot 0.75 = 3.252⋅0.5+3⋅0.75=3.25. The standard form 2⋅1[0,0.25)+5⋅1[0.25,0.5]+3⋅1(0.5,1]2\cdot\mathbf{1}_{[0, 0.25)} + 5\cdot\mathbf{1}_{[0.25, 0.5]} + 3\cdot\mathbf{1}_{(0.5, 1]}2⋅1[0,0.25)​+5⋅1[0.25,0.5]​+3⋅1(0.5,1]​ gives 2⋅0.25+5⋅0.25+3⋅0.5=3.252 \cdot 0.25 + 5 \cdot 0.25 + 3 \cdot 0.5 = 3.252⋅0.25+5⋅0.25+3⋅0.5=3.25. The reason is additivity. Cut the space into the pieces on which none of the indicators changes, the atoms of the σ-algebra that these sets generate, as in "σ-algebras and Borel sets". Each set AkA_kAk​ is a disjoint union of atoms, so μ(Ak)\mu(A_k)μ(Ak​) is the sum of the measures of its atoms, and both ways of writing φ\varphiφ add up the same terms.

Two rules follow for simple functions φ\varphiφ and ψ\psiψ: the integral is linear, ∫(aφ+bψ) dμ=a∫φ dμ+b∫ψ dμ\int (a\varphi + b\psi)\,d\mu = a\int \varphi\,d\mu + b\int \psi\,d\mu∫(aφ+bψ)dμ=a∫φdμ+b∫ψdμ, because the combination is again a list of indicators; and monotone, since φ≤ψ\varphi \le \psiφ≤ψ means that on every atom the value of φ\varphiφ is at most that of ψ\psiψ, so ∫φ dμ≤∫ψ dμ\int \varphi\,d\mu \le \int \psi\,d\mu∫φdμ≤∫ψdμ. For an indicator, ∫1A dμ=μ(A)\int \mathbf{1}_A\,d\mu = \mu(A)∫1A​dμ=μ(A).

A dart board shows a simple function with several layers. Take the unit square, with a target centred in it. Points closer than 0.10.10.1 to the centre score 10, points between distance 0.10.10.1 and 0.250.250.25 score 5, between 0.250.250.25 and 0.40.40.4 score 2, between 0.40.40.4 and 0.50.50.5 score 1, and the four corners beyond distance 0.50.50.5 score 0. The score is a function sss on the square with five values, each taken on a ring or on the corners. The measure is area, the two-dimensional Lebesgue measure from "Lebesgue measure and null sets", under which a disc of radius rrr has area πr2\pi r^2πr2. The integral ∫s dλ\int s \, d\lambda∫sdλ is the score of the board weighted by area: every ring contributes its score times its area.

Worked example

The area-weighted score of a dart board

  1. The centre disc of radius 0.1 scores 10; its area:

    π⋅0.12\displaystyle \pi \cdot 0.1^2π⋅0.12=0.0314159
  2. The ring between 0.1 and 0.25 scores 5; its area:

    π (0.252−0.12)\displaystyle \pi\,(0.25^2 - 0.1^2)π(0.252−0.12)=0.1649336
  3. The ring between 0.25 and 0.4 scores 2:

    π (0.42−0.252)\displaystyle \pi\,(0.4^2 - 0.25^2)π(0.42−0.252)=0.3063053
  4. The ring between 0.4 and 0.5 scores 1:

    π (0.52−0.42)\displaystyle \pi\,(0.5^2 - 0.4^2)π(0.52−0.42)=0.2827433
  5. The four corners score 0; their area is what the disc of radius 0.5 leaves of the unit square:

    1−π⋅0.52\displaystyle 1 - \pi \cdot 0.5^21−π⋅0.52=0.2146018
  6. Check: the five areas fill the square, so they add up to

    0.0314159+0.1649336+0.3063053+0.2827433+0.2146018\displaystyle 0.0314159 + 0.1649336 + 0.3063053 + 0.2827433 + 0.21460180.0314159+0.1649336+0.3063053+0.2827433+0.2146018=1
  7. The integral of the score, value times measure over the five sets:

    10⋅0.0314159+5⋅0.1649336+2⋅0.3063053+1⋅0.2827433+0⋅0.2146018\displaystyle 10 \cdot 0.0314159 + 5 \cdot 0.1649336 + 2 \cdot 0.3063053 + 1 \cdot 0.2827433 + 0 \cdot 0.214601810⋅0.0314159+5⋅0.1649336+2⋅0.3063053+1⋅0.2827433+0⋅0.2146018=2.0341812

Integrals of non-negative functions

A general function takes infinitely many values, so the sum of value times measure has no finite list to run over. The remedy is to use simple functions as lower estimates. Let f≥0f \ge 0f≥0 be measurable. Every simple function φ\varphiφ with 0≤φ≤f0 \le \varphi \le f0≤φ≤f is an underestimate of the total of fff, and the best underestimate is the total:

∫f dμ=sup⁡{∫φ dμ  :  0≤φ≤f, φ simple}.\int f \, d\mu = \sup\Big\{ \int \varphi \, d\mu \;:\; 0 \le \varphi \le f, \ \varphi \text{ simple} \Big\}.∫fdμ=sup{∫φdμ:0≤φ≤f, φ simple}.

The value lies in [0,∞][0, \infty][0,∞], and it can be ∞\infty∞. If fff is itself simple, the definition returns the old formula, since fff is one of the allowed φ\varphiφ and monotonicity bounds all the others.

A supremum over all simple functions below fff looks unworkable, but one sequence suffices. The dyadic staircases of "Measurable functions", φn=min⁡(n,⌊2nf⌋/2n)\varphi_n = \min\big(n, \lfloor 2^n f \rfloor / 2^n\big)φn​=min(n,⌊2nf⌋/2n), increase to fff at every point, and their integrals increase to ∫f dμ\int f\,d\mu∫fdμ. This last step is the monotone convergence theorem, the first result of the next lesson, so here it is taken as given. For f(x)=4x(1−x)f(x) = 4x(1 - x)f(x)=4x(1−x), the set {f≥y}\{f \ge y\}{f≥y} is an interval of length 1−y\sqrt{1 - y}1−y​, as computed in "Measurable functions", and adding up the layers of φn\varphi_nφn​ gives

  • n=1n = 1n=1: 0.35360.35360.3536, with a distance of 0.31310.31310.3131 to the exact value 2/3=0.66672/3 = 0.66672/3=0.6667.
  • n=2n = 2n=2: 0.51830.51830.5183, as computed above, distance 0.14840.14840.1484.
  • n=3n = 3n=3: 0.59560.59560.5956, distance 0.07100.07100.0710.
  • n=4n = 4n=4: 0.63230.63230.6323, distance 0.03430.03430.0343; at n=6n = 6n=6 the value is 0.65850.65850.6585.

The distance roughly halves with every refinement, and the integrals of the staircases creep up on 2/32/32/3 from below.

The figure draws the staircase φn\varphi_nφn​ under the curve and, for comparison, the Riemann construction with the same number of pieces. Choose "Slice the range" or "Slice the domain" and move nnn. With the defaults, slicing the range at n=3n = 3n=3 uses 888 levels and shows the Lebesgue sum 0.59560.59560.5956 next to the exact value 0.66670.66670.6667. Switching to slicing the domain shows 888 midpoint columns and the midpoint Riemann sum 0.67190.67190.6719.

Simple functions climbing up to the integralOpen in Lebesgue Integral
3 (8)
16
φₙ = ⌊2ⁿ f⌋ / 2ⁿf(x) = 4x(1 − x)
Lebesgue sum ∫ φₙ
0.5956
Midpoint Riemann sum
0.6719
Exact ∫ f
0.6667
Levels
8

The Lebesgue sum adds each level times the length of the set where f reaches it; it never asks f to be continuous.

For this smooth hump the midpoint Riemann sums converge faster than the staircase sums: 0.67190.67190.6719 against 0.59560.59560.5956 at n=3n = 3n=3. Speed on smooth functions is not the point of the Lebesgue construction. The point is that it needs only the measure of level sets, so it works for every measurable function and for every measure.

The layer-cake formula

The staircase can be taken apart into thin flat layers. At a point where φn\varphi_nφn​ has the value j/2nj/2^nj/2n, exactly the indicators 1{f≥k/2n}\mathbf{1}\{f \ge k/2^n\}1{f≥k/2n} for k=1,…,jk = 1, \ldots, jk=1,…,j are on, and each adds 2−n2^{-n}2−n. So

φn=12n∑k=1n2n1{f≥k/2n},\varphi_n = \frac{1}{2^n} \sum_{k=1}^{n 2^n} \mathbf{1}\{ f \ge k/2^n \},φn​=2n1​k=1∑n2n​1{f≥k/2n},

a stack of slabs of height 2−n2^{-n}2−n, the kkk-th slab lying over the set where fff reaches the height k/2nk/2^nk/2n. Integrating a sum of simple functions term by term gives

∫φn dμ=12n∑k=1n2nμ(f≥k/2n).\int \varphi_n \, d\mu = \frac{1}{2^n} \sum_{k=1}^{n 2^n} \mu\big( f \ge k/2^n \big).∫φn​dμ=2n1​k=1∑n2n​μ(f≥k/2n).

The right side is a sum of rectangles of width 2−n2^{-n}2−n whose heights are the values of the tail function t↦μ(f>t)t \mapsto \mu(f > t)t↦μ(f>t), the measure of the part of the space where fff exceeds ttt. This function decreases as ttt grows, and the sum is an approximation to the area under its graph. Letting nnn grow, and using that ∫φn dμ→∫f dμ\int \varphi_n\,d\mu \to \int f\,d\mu∫φn​dμ→∫fdμ, gives the layer-cake formula:

∫f dμ=∫0∞μ(f>t) dt.\int f \, d\mu = \int_0^\infty \mu(f > t)\, dt.∫fdμ=∫0∞​μ(f>t)dt.

The integral of fff over the space equals the ordinary area under the tail function. The picture is a cake: the layer at height ttt has the size of the part of the space that reaches it, and the cake is the sum of its layers. The derivation is an outline; the passage to the limit uses monotone convergence.

For the hump, μ(f>t)=1−t\mu(f > t) = \sqrt{1 - t}μ(f>t)=1−t​ for 0≤t<10 \le t < 10≤t<1 and 000 beyond, so

∫011−t dt=[−23(1−t)3/2]01=23,\int_0^1 \sqrt{1 - t}\, dt = \Big[-\tfrac23 (1 - t)^{3/2}\Big]_0^1 = \tfrac23,∫01​1−t​dt=[−32​(1−t)3/2]01​=32​,

the same 2/32/32/3 as the column integral ∫014x(1−x) dx=2−43\int_0^1 4x(1 - x)\,dx = 2 - \tfrac43∫01​4x(1−x)dx=2−34​. For the function f(x)=1/xf(x) = 1/xf(x)=1/x on (0,1](0, 1](0,1], which is unbounded, the set {f>t}\{f > t\}{f>t} is all of (0,1](0, 1](0,1] for t<1t < 1t<1 and the interval (0,1/t)(0, 1/t)(0,1/t) for t≥1t \ge 1t≥1, so μ(f>t)=min⁡(1,1/t)\mu(f > t) = \min(1, 1/t)μ(f>t)=min(1,1/t), and the area is 1+∫1∞dt/t=∞1 + \int_1^\infty dt/t = \infty1+∫1∞​dt/t=∞: the integral exists and equals ∞\infty∞, because the layers shrink too slowly to have a finite area.

On the dart board the layers are easy to see. The score reaches at least 1 on the disc of radius 0.50.50.5, at least 2 on the disc of radius 0.40.40.4, at least 5 on the disc of radius 0.250.250.25 and at least 10 on the disc of radius 0.10.10.1. Their areas are the tail values 0.78540.78540.7854, 0.50270.50270.5027, 0.19630.19630.1963 and 0.03140.03140.0314. The score climbs from 0 to 1, 2, 5 and 10, so the layers have heights 1,1,3,51, 1, 3, 51,1,3,5, and weighting each tail area by its layer height must reproduce the integral found ring by ring, as the next worked example confirms.

Worked example

The dart board by layers

  1. Area where the score is at least 1, the disc of radius 0.5:

    π⋅0.52\displaystyle \pi \cdot 0.5^2π⋅0.52=0.7853982
  2. Area where the score is at least 2:

    π⋅0.42\displaystyle \pi \cdot 0.4^2π⋅0.42=0.5026548
  3. Area where the score is at least 5:

    π⋅0.252\displaystyle \pi \cdot 0.25^2π⋅0.252=0.1963495
  4. Area where the score is at least 10:

    π⋅0.12\displaystyle \pi \cdot 0.1^2π⋅0.12=0.0314159
  5. Layer heights times tail areas, with heights 1, 1, 3, 5:

    1⋅0.7853982+1⋅0.5026548+3⋅0.1963495+5⋅0.0314159\displaystyle 1 \cdot 0.7853982 + 1 \cdot 0.5026548 + 3 \cdot 0.1963495 + 5 \cdot 0.03141591⋅0.7853982+1⋅0.5026548+3⋅0.1963495+5⋅0.0314159=2.0341812
  6. The same layer-cake integral for the hump, with tail function 1−t\sqrt{1 - t}1−t​:

    ∫011−t dt\displaystyle \int_0^1 \sqrt{1 - t}\, dt∫01​1−t​dt=0.6666667

Functions with both signs

The construction above needs f≥0f \ge 0f≥0. A function with both signs is split into two non-negative parts: the positive part f+=max⁡(f,0)f^+ = \max(f, 0)f+=max(f,0) and the negative part f−=max⁡(−f,0)f^- = \max(-f, 0)f−=max(−f,0). Then f=f+−f−f = f^+ - f^-f=f+−f− and ∣f∣=f++f−|f| = f^+ + f^-∣f∣=f++f−. The positive part keeps the places where fff lies above the axis, and the negative part is the reflection of the places where it lies below.

A function fff is integrable if ∫∣f∣ dμ<∞\int |f|\,d\mu < \infty∫∣f∣dμ<∞, that is, if both ∫f+ dμ\int f^+\,d\mu∫f+dμ and ∫f− dμ\int f^-\,d\mu∫f−dμ are finite, and then

∫f dμ=∫f+ dμ−∫f− dμ.\int f \, d\mu = \int f^+ \, d\mu - \int f^- \, d\mu.∫fdμ=∫f+dμ−∫f−dμ.

The set of integrable functions is written L1(μ)L^1(\mu)L1(μ). As an example, f(x)=sin⁡(2πx)f(x) = \sin(2\pi x)f(x)=sin(2πx) on [0,1][0, 1][0,1] is positive on (0,12)(0, \tfrac12)(0,21​) and negative on (12,1)(\tfrac12, 1)(21​,1). By symmetry ∫f+ dλ=∫f− dλ=1/π=0.3183\int f^+ \,d\lambda = \int f^- \,d\lambda = 1/\pi = 0.3183∫f+dλ=∫f−dλ=1/π=0.3183, so ∫f dλ=0\int f\,d\lambda = 0∫fdλ=0 and ∫∣f∣ dλ=2/π=0.6366\int |f|\,d\lambda = 2/\pi = 0.6366∫∣f∣dλ=2/π=0.6366.

The finiteness requirement is not decoration. Without it, the difference ∫f+−∫f−\int f^+ - \int f^-∫f+−∫f− can read ∞−∞\infty - \infty∞−∞. On R\mathbb{R}R with length, let f=1[0,∞)−1(−∞,0)f = \mathbf{1}_{[0, \infty)} - \mathbf{1}_{(-\infty, 0)}f=1[0,∞)​−1(−∞,0)​, equal to 111 to the right of 0 and −1-1−1 to the left. Both ∫f+\int f^+∫f+ and ∫f−\int f^-∫f− equal ∞\infty∞. Adding up fff over [−N,N][-N, N][−N,N] gives 000, but adding it up over [−N,2N][-N, 2N][−N,2N] gives NNN. Different ways of exhausting the line produce different answers, so there is no reason to prefer one of them, and the integral is simply not defined. Integrability rules out exactly this: when ∫∣f∣<∞\int |f| < \infty∫∣f∣<∞, every sensible way of exhausting the space produces the same total.

Properties of the integral

The integral obeys four rules. Each is proved first for simple functions, then for non-negative functions through staircases, and finally for integrable functions by splitting into positive and negative parts; here only the meaning and the reasons are given.

  • Linearity. For integrable f,gf, gf,g and real a,ba, ba,b: ∫(af+bg) dμ=a∫f dμ+b∫g dμ\int (af + bg)\,d\mu = a\int f\,d\mu + b\int g\,d\mu∫(af+bg)dμ=a∫fdμ+b∫gdμ. On [0,1][0, 1][0,1], ∫x dλ=12\int x\,d\lambda = \tfrac12∫xdλ=21​ and ∫4x(1−x) dλ=23\int 4x(1 - x)\,d\lambda = \tfrac23∫4x(1−x)dλ=32​, so ∫(x+4x(1−x)) dλ=76\int \big(x + 4x(1 - x)\big)\,d\lambda = \tfrac76∫(x+4x(1−x))dλ=67​.
  • Monotonicity. If f≤gf \le gf≤g, then ∫f dμ≤∫g dμ\int f\,d\mu \le \int g\,d\mu∫fdμ≤∫gdμ. Applied to −∣f∣≤f≤∣f∣-|f| \le f \le |f|−∣f∣≤f≤∣f∣ this gives ∣∫f dμ∣≤∫∣f∣ dμ\big|\int f\,d\mu\big| \le \int |f|\,d\mu​∫fdμ​≤∫∣f∣dμ: cancellations between positive and negative parts can only shrink a total.
  • Null sets do not matter. If f=gf = gf=g almost everywhere, then ∫f dμ=∫g dμ\int f\,d\mu = \int g\,d\mu∫fdμ=∫gdμ. Let NNN be the null set where they differ. Every simple function below ∣f−g∣|f - g|∣f−g∣ vanishes outside NNN, so each of its terms akμ(Ak∩N)a_k \mu(A_k \cap N)ak​μ(Ak​∩N) is 0, and ∫∣f−g∣ dμ=0\int |f - g|\,d\mu = 0∫∣f−g∣dμ=0. Changing the hump 4x(1−x)4x(1 - x)4x(1−x) to the value 5 at every rational point leaves its integral at 2/32/32/3, and ∫1Q dλ=0\int \mathbf{1}_{\mathbb{Q}}\,d\lambda = 0∫1Q​dλ=0.
  • Zero integral. For f≥0f \ge 0f≥0, ∫f dμ=0\int f\,d\mu = 0∫fdμ=0 exactly when f=0f = 0f=0 almost everywhere. If f>1/nf > 1/nf>1/n on a set of measure mmm, then f≥1n1{f>1/n}f \ge \tfrac1n\mathbf{1}_{\{f > 1/n\}}f≥n1​1{f>1/n}​, and monotonicity gives ∫f dμ≥m/n\int f\,d\mu \ge m/n∫fdμ≥m/n. So ∫f dμ=0\int f\,d\mu = 0∫fdμ=0 forces every {f>1/n}\{f > 1/n\}{f>1/n} to be null, and {f>0}\{f > 0\}{f>0} is their countable union, which is null by "Lebesgue measure and null sets". The other direction is the previous rule.

The argument behind the last rule gives a general inequality: for c>0c > 0c>0, c⋅1{∣f∣>c}≤∣f∣c\cdot\mathbf{1}_{\{|f| > c\}} \le |f|c⋅1{∣f∣>c}​≤∣f∣, hence

μ(∣f∣>c)≤1c∫∣f∣ dμ.\mu(|f| > c) \le \frac{1}{c} \int |f| \, d\mu.μ(∣f∣>c)≤c1​∫∣f∣dμ.

A function with a small integral can be large only on a small set. On the dart board, ∫s dλ=2.0342\int s\,d\lambda = 2.0342∫sdλ=2.0342 and c=5c = 5c=5 give the bound 0.40680.40680.4068 on the area where the score exceeds 5, while the true area, the centre disc of radius 0.10.10.1, is 0.03140.03140.0314. The bound is cheap and holds for every measure space. The probability part of this track meets it again under the name of Markov's inequality.

Integrals against other measures

Nothing in the construction used length. The integral was built from a measure, simple functions and a supremum, so it exists for every measure space (Ω,F,μ)(\Omega, \mathcal{F}, \mu)(Ω,F,μ). The measures of "Measuring the size of sets" give familiar quantities, and each has a one-line formula.

  • Counting measure on $\mathbb{N}$. A set AAA has measure equal to its number of elements, so ∫1A dμ=∑n1A(n)\int \mathbf{1}_A\,d\mu = \sum_n \mathbf{1}_A(n)∫1A​dμ=∑n​1A​(n), and extending through simple functions and staircases gives ∫f dμ=∑n=1∞f(n)\int f\,d\mu = \sum_{n=1}^{\infty} f(n)∫fdμ=∑n=1∞​f(n). For f(n)=2−nf(n) = 2^{-n}f(n)=2−n the integral is 111, and for f(n)=1/n2f(n) = 1/n^2f(n)=1/n2 it is π2/6=1.6449\pi^2/6 = 1.6449π2/6=1.6449. On the six faces of a die with counting measure, ∫(face) dμ=1+2+⋯+6=21\int (\text{face})\,d\mu = 1 + 2 + \cdots + 6 = 21∫(face)dμ=1+2+⋯+6=21.
  • The Dirac measure $\delta_x$. All the mass sits at one point, so ∫f dδx=f(x)\int f\,d\delta_x = f(x)∫fdδx​=f(x): integrating against δx\delta_xδx​ means evaluating at xxx.
  • Weighted point masses $\sum_i w_i \delta_{x_i}$. The integral is the weighted sum ∑iwif(xi)\sum_i w_i f(x_i)∑i​wi​f(xi​). For the masses 0.50.50.5 at 0.20.20.2, 0.30.30.3 at 0.450.450.45 and 0.20.20.2 at 0.90.90.9, and the function f(x)=xf(x) = xf(x)=x, it is 0.5⋅0.2+0.3⋅0.45+0.2⋅0.9=0.4150.5 \cdot 0.2 + 0.3 \cdot 0.45 + 0.2 \cdot 0.9 = 0.4150.5⋅0.2+0.3⋅0.45+0.2⋅0.9=0.415.
  • A measure with a density $\rho$. If μ(A)=∫Aρ dλ\mu(A) = \int_A \rho\,d\lambdaμ(A)=∫A​ρdλ, then ∫f dμ=∫fρ dλ\int f\,d\mu = \int f\rho\,d\lambda∫fdμ=∫fρdλ. For an indicator this is the definition of μ\muμ, linearity carries it to simple functions, and staircases carry it to all non-negative fff. On the rod of "Measuring the size of sets", with ρ(x)=2x\rho(x) = 2xρ(x)=2x, the integral of the position is ∫x dμ=∫01x⋅2x dx=23\int x\,d\mu = \int_0^1 x \cdot 2x\,dx = \tfrac23∫xdμ=∫01​x⋅2xdx=32​.

The last integral has a physical meaning. The rod has total mass 1, and position times mass added over all its pieces is its balance point: 2/32/32/3, right of the middle because the rod is heavier towards its right end. With length instead of the rod's mass, the same integral gives ∫x dλ=12\int x\,d\lambda = \tfrac12∫xdλ=21​.

One condition deserves care. On N\mathbb{N}N with counting measure, fff is integrable exactly when ∑n∣f(n)∣<∞\sum_n |f(n)| < \infty∑n​∣f(n)∣<∞, that is, when the series converges absolutely. The alternating harmonic series 1−12+13−14+⋯1 - \tfrac12 + \tfrac13 - \tfrac14 + \cdots1−21​+31​−41​+⋯ converges, to ln⁡2=0.6931\ln 2 = 0.6931ln2=0.6931, but ∑1/n=∞\sum 1/n = \infty∑1/n=∞, so f(n)=(−1)n+1/nf(n) = (-1)^{n+1}/nf(n)=(−1)n+1/n is not integrable. This is no accident. A measure space has no order on its points, so an integral cannot depend on the order in which they are visited, while the sum of a series that does not converge absolutely changes when its terms are rearranged: by a theorem of Riemann, it can be made to converge to any number. Absolute integrability is what makes the total independent of order.

Riemann and Lebesgue compared

Whenever a bounded function on an interval has a Riemann integral, it has a Lebesgue integral with the same value. The reason is short. The upper and lower sums of a Riemann partition are integrals of step functions, and step functions are simple functions. A lower step function lies below fff and an upper one above it, so the Lebesgue integral of fff lies between the lower and upper sums, and a Riemann integral exists exactly when those can be squeezed together.

The Lebesgue integral exists for more functions. The indicator 1Q\mathbf{1}_{\mathbb{Q}}1Q​ has no Riemann integral, but its Lebesgue integral is 1⋅λ(Q∩[0,1])=01 \cdot \lambda(\mathbb{Q} \cap [0, 1]) = 01⋅λ(Q∩[0,1])=0. The two integrals also treat unbounded domains differently. The improper Riemann integral ∫0∞sin⁡xx dx\int_0^\infty \frac{\sin x}{x}\,dx∫0∞​xsinx​dx is defined as the limit of ∫0bsin⁡xx dx\int_0^b \frac{\sin x}{x}\,dx∫0b​xsinx​dx as b→∞b \to \inftyb→∞, and the limit exists and equals π/2=1.5708\pi/2 = 1.5708π/2=1.5708: the first hump above the axis has area 1.85191.85191.8519, and the following humps alternate in sign and shrink, so they cancel in a controlled way. The Lebesgue integral refuses to treat it as integrable. On the hump over [jπ,(j+1)π][j\pi, (j+1)\pi][jπ,(j+1)π], ∫∣sin⁡x∣ dx=2\int |\sin x|\,dx = 2∫∣sinx∣dx=2 and 1/x≥1/((j+1)π)1/x \ge 1/((j+1)\pi)1/x≥1/((j+1)π), so that hump of ∣sin⁡x∣/x|\sin x|/x∣sinx∣/x has area at least 2/((j+1)π)2/((j+1)\pi)2/((j+1)π). These bounds form a harmonic series, which grows without limit: 101010 humps give at least 1.86461.86461.8646, and it takes about 3.73.73.7 million humps to pass 101010. So ∫0∞∣sin⁡x∣/x dx=∞\int_0^\infty |\sin x|/x\,dx = \infty∫0∞​∣sinx∣/xdx=∞, and sin⁡x/x\sin x / xsinx/x is not integrable. This is the same ∞−∞\infty - \infty∞−∞ problem as before: the improper Riemann integral depends on cancelling in a fixed order.

The last difference matters most for the next lesson. Riemann integrals do not survive limits. Enumerate the rationals as q1,q2,…q_1, q_2, \ldotsq1​,q2​,… and let fnf_nfn​ be the indicator of the first nnn of them. Each fnf_nfn​ is zero except at finitely many points, so it has a Riemann integral, 000. Yet the pointwise limit of the fnf_nfn​ is 1Q\mathbf{1}_{\mathbb{Q}}1Q​, which has no Riemann integral at all. For the Lebesgue integral the limit is again integrable, and equals 000. Under which conditions limits and integrals may be exchanged is the subject of "Convergence theorems".

Summary

  • The Riemann integral slices the domain into columns and needs fff to be nearly constant on short stretches; the Lebesgue integral slices the range into layers and needs only the measures of level sets, as in sorting coins by value before counting them.
  • For a simple function, ∫φ dμ=∑akμ(Ak)\int \varphi\,d\mu = \sum a_k \mu(A_k)∫φdμ=∑ak​μ(Ak​); for f≥0f \ge 0f≥0, ∫f dμ\int f\,d\mu∫fdμ is the supremum of the integrals of simple functions below fff, approached by the dyadic staircases.
  • The layer-cake formula ∫f dμ=∫0∞μ(f>t) dt\int f\,d\mu = \int_0^\infty \mu(f > t)\,dt∫fdμ=∫0∞​μ(f>t)dt turns an integral over the space into an area under the tail function; on the dart board both routes give 2.03422.03422.0342.
  • A function is integrable when ∫∣f∣ dμ<∞\int |f|\,d\mu < \infty∫∣f∣dμ<∞, and then ∫f=∫f+−∫f−\int f = \int f^+ - \int f^-∫f=∫f+−∫f−; the integral is linear and monotone, ignores null sets, and vanishes for ∣f∣|f|∣f∣ only when f=0f = 0f=0 almost everywhere.
  • Against counting measure the integral is a series, against δx\delta_xδx​ an evaluation, against point masses a weighted sum, against a density ρ\rhoρ the integral of fρf\rhofρ; absolute convergence is what integrability means for series.
  • The Lebesgue integral agrees with Riemann's wherever that exists, covers 1Q\mathbf{1}_{\mathbb{Q}}1Q​ and any measure space, and is the integral that behaves well under limits.
Try itOpen the Lebesgue integral lab
Previous · 04Measurable functionsNext · 06Convergence theorems
Connections

The Lebesgue integral

Open the full graph
Builds on
05.04Measurable functions05.03Lebesgue measure and null sets05.02σ-algebras and Borel sets05.01Measuring the size of sets
Leads to
05.06Convergence theorems05.09Expectation, variance and inequalities05.10Independence and product measures05.13Measure theory in option pricing
See it in the knowledge graph
Labs for this lesson
Lebesgue Integral