Visual walkthrough — Changing order of integration
Step 1 — What a double integral actually adds up
WHAT. We chop into a grid of small rectangles ("tiles"), each of width and height , so each tile has area . Tile number sits at point and carries the amount of dust.
WHY. The whole idea of an integral is: replace a hard curved thing by lots of easy little rectangles, add, then shrink the rectangles to zero. The total is
PICTURE. Look at the grid below: each little square is one tile, its colour shows how much dust it holds. The number we want is the total dust across all coloured tiles.
Here just means "run over every tile." That is the only object we will manipulate. Everything that follows is about the order in which we add these tiles.
Step 2 — Adding tiles: columns first, or rows first
WHAT. Take the sum and choose a route through the tiles:
- Columns first: freeze a column (fix ), add every tile up that column, then move to the next column.
- Rows first: freeze a row (fix ), add every tile across that row, then move to the next row.
WHY. Both routes visit every tile exactly once, and each tile contributes the same amount to the pile no matter when you count it. So the two grand totals are forced to be equal — this is the arithmetic heart of Fubini's theorem.
The inner bracket is "add along one strip"; the outer sum is "sweep the strips across."
PICTURE. Left panel: green vertical strips (a column of tiles) swept left→right. Right panel: pink horizontal strips (a row of tiles) swept bottom→top. Same tiles, two walking orders.
Step 3 — A concrete region: the triangle, and its vertical strips
WHAT. Pick one region so the abstract sums become real limits. Take the triangle Read it in words: (the outer, swept variable) lives between the numbers and ; for each such , the height runs from the floor up to the slanted line .
WHY columns first. Choosing as the outer variable means we sweep vertical strips. A vertical strip sits at one fixed ; we need to know where it enters (bottom) and where it exits (top).
PICTURE. Below, the red vertical strip at a fixed enters the region at (the floor) and exits at (the slanted roof). As slides from to , these strips fill the whole triangle. This is a Type I / vertically simple description.
Term by term:
- outer ::: sweep the strip across all from to — constants, because the whole region lives in that -range.
- inner ::: for the frozen , climb the strip from floor to roof — the top limit is a curve, it depends on the outer variable.
Step 4 — The same triangle with horizontal strips
WHAT. Now walk the other way: rows first, so becomes the outer swept variable. We must re-describe the exact same triangle using horizontal strips.
WHY. Nothing about the region changed — only our route through it. A horizontal strip sits at one fixed ; we need where it enters (left) and exits (right).
PICTURE. The blue horizontal strip at a fixed enters at the slanted line and exits at the right wall . Notice the left edge is the same line from Step 3 — but now it is the left boundary of a horizontal strip, so we must read it as an -value.
Step 5 — The single algebraic move: solve the boundary for the new inner variable
WHAT. Solve the shared boundary for : That is it. That one line converts a top-limit into a left-limit.
WHY. The inner limits of a horizontal strip must be written as functions of (the outer variable), because for each frozen we need the where the strip enters and exits. So every boundary curve has to be expressed in the form "".
PICTURE. Below, the same slanted line is labelled twice: green " (roof)" for the vertical strip, and blue " (left wall)" for the horizontal strip. The floor of Step 3 has turned into the corner; the right wall is now the constant .
For a fixed (with ), the horizontal strip runs and itself sweeps from the lowest point of the triangle () to the highest (). Hence
Compare with Step 3: Both describe the identical set of tiles. The flip cost exactly one algebra step: .
Step 6 — Why we bother: an inner integral that becomes possible
WHAT. Put on the exact triangle of Steps 3–5 (). Written columns first (vertical strips, ), the integral is This is the starting order — the inner limits are exactly the floor-to-roof limits we read off in Step 3. We now try to evaluate it and hit a wall.
WHY we must flip. The inner integral has no elementary antiderivative — no combination of differentiates to (see Improper and Non-elementary Integrals). So in the columns-first order we are stuck at the very first step. Flipping to rows-first changes which variable is integrated on the inside.
PICTURE. Same triangle as Steps 3–5; the shading shows growing as increases. Reading it in horizontal strips lets each strip be integrated in trivially.
Flip using the rows-first limits from Step 5 (, ):
=\int_0^1 e^{y^2}\underbrace{[x]_{y}^{1}}_{=\,1-y}\,dy =\int_0^1 (1-y)\,e^{y^2}\,dy.$$ The inner $x$-integral just multiplied by the **strip length** $1-y$ (right wall $x=1$ minus left wall $x=y$). Split the pieces: $$I=\underbrace{\int_0^1 e^{y^2}\,dy}_{\text{still no formula!}}-\int_0^1 y\,e^{y^2}\,dy.$$ The first piece is *still* the non-elementary one — so on **this** triangle the naive flip does not fully rescue us. The clean rescue happens on the **complementary** triangle where the strip length is exactly $y$. > [!example] The version that fully collapses — same idea, complementary triangle > Take the triangle $R':\ 0\le x\le1,\ x\le y\le1$ (**above** the line $y=x$). Columns-first it is > $$I'=\int_0^1\!\int_x^1 e^{y^2}\,dy\,dx,$$ > whose inner $\int e^{y^2}dy$ is again non-elementary. Its horizontal strips (fix $y$, $x$ runs $0\to y$) give strip length exactly $y$: > $$I'=\int_0^1\!\int_0^{y} e^{y^2}\,dx\,dy=\int_0^1 e^{y^2}\,[x]_0^{y}\,dy=\int_0^1 y\,e^{y^2}\,dy.$$ > Substitute $u=y^2,\ du=2y\,dy$: > $$I'=\tfrac12\int_0^1 e^u\,du=\tfrac12\big(e^1-e^0\big)=\boxed{\dfrac{e-1}{2}}\approx 0.859.$$ > The factor $y$ (the strip length) is exactly what makes $\int y\,e^{y^2}dy$ solvable. That is the payoff — and it also shows **the flip only helps when the strip length supplies the missing factor**. Always sketch first to see which triangle you are on. --- ## Step 7 — The edge cases you must not skip > [!mistake] Where a naive flip goes wrong > **Case (a) — degenerate strip at the corner.** On the Steps 3–5 triangle, at $x=0$ the vertical strip has length $0$ (floor and roof both at $y=0$); at $y=1$ the horizontal strip has length $0$ ($x$ from $1$ to $1$). These zero-length strips contribute nothing — good — but they *set the endpoints* $x=0$ and $y=1$. Never drop them. > > **Case (b) — the flip only helps if the strip length carries the missing factor.** Step 6 showed it: on the lower triangle the strip length was $1-y$ and the flip left $\int e^{y^2}dy$ behind; on the upper triangle the strip length was $y$ and everything collapsed. The sketch tells you which case you are in. > > **Case (c) — a curve that flips its role.** For a region bounded *below* by a parabola and *above* by a line, e.g. $0\le x\le1,\ x^2\le y\le x$, the two boundaries **swap which is left/right** when you flip. Solve each for $x$: line $y=x\Rightarrow x=y$; parabola $y=x^2\Rightarrow x=+\sqrt{y}$ (**positive branch only**, because the region sits at $x\ge0$). For $0<y<1$ we have $y<\sqrt y$, so the strip runs $y\le x\le\sqrt y$. > > **Case (d) — one orientation needs splitting.** If, sweeping horizontally, a strip *exits onto two different curves* depending on its height, you must split the outer $y$-range into pieces. The sketch is what tells you this — never flip limits by shuffling numbers blindly. **PICTURE.** Left: the lens between $y=x^2$ and $y=x$, showing the strip's left edge on the line ($x=y$) and right edge on the parabola ($x=\sqrt y$). Right: a region where a horizontal strip changes exit-curve halfway up, forcing a split. For the lens, the flip gives $$\int_0^1\!\int_{x^2}^{x} f\,dy\,dx=\int_0^1\!\int_{y}^{\sqrt y} f\,dx\,dy.$$ > [!recall] Quick check > Why is the parabola's inner limit $x=\sqrt y$ and not $x=-\sqrt y$? ::: The region lives at $x\ge 0$; the positive branch is the one inside $R$. Always test a point. > Why must the outer limits ($0$ and $1$) be pure numbers? ::: They mark the *full* range of the swept variable; a variable there would leave part of the region undescribed. > On which triangle does $\int\!\!\int e^{y^2}$ fully collapse after flipping? ::: The upper one ($x\le y\le 1$), where the strip length is exactly $y$. --- ## The one-picture summary This final figure compresses the whole derivation: **one triangle, two sweeps**. Green vertical strips ($dy\,dx$: inner limits $0\to x$) on the left; pink horizontal strips ($dx\,dy$: inner limits $y\to 1$) on the right. The shared slanted boundary is labelled $y=x$ on the left and its solved twin $x=y$ on the right — the single algebra step that *is* the order change. The upper-triangle version of $f=e^{y^2}$ evaluates to $\dfrac{e-1}{2}$. > [!recall]- Feynman: the whole walkthrough in plain words > Picture a triangular patio covered in tiles, each holding some dust. You want the total dust. You can walk it **column by column** — stand at one spot on the bottom edge and count the tall stack of tiles above you up to the slanted roof, then step sideways and do the next column. Or you can walk it **row by row** — stand at one height on the side and count the long row of tiles from the slanted line across to the right wall, then step up and do the next row. Every tile gets counted exactly once either way, so the two totals are the same number — that is Fubini (as long as the pile doesn't run off to infinity, which for our finite dusty triangles it never does). To switch from columns to rows, you just look at the slanted edge and *read it the other way*: as a roof it says "$y=x$", but as a left wall it says "$x=y$" — same line, solved for the other letter. That single re-reading is the entire "change of order." We do it because sometimes counting columns is impossible ($\int e^{y^2}dy$ has no formula) while counting rows hands you the exact extra factor (the strip length $y$) that makes the integral solvable. > [!mnemonic] Carry this away > **"Same tiles, new walk. Outer = numbers, inner = curves. Flip the strip, re-solve the boundary for the new inner letter."** Related tools once you master this: [[Polar Coordinates in Double Integrals]] and [[Change of Variables (Jacobian)]] change the *shape* of the tiles; [[Triple Integrals — Order of Integration]] plays the same game with a third stack.