Some regions are awkward in x and y but simple in other coordinates. A map(u,v)↦(x,y) gives each point of a uv-plane a point of the xy-plane. If it sends a rectangle S onto the region R, an integral over R can be worked out over S instead.
One correction is needed. A small cell of area dudv in the uv-plane does not land on a cell of the same area. So each cell must carry the factor by which the map stretches or shrinks area near it.
A linear map
Take the map x=3u+v, y=u+2v. In matrix form it is x=Au with
A=(3112)
the matrix of lesson 3.4.1. It sends the unit square S=[0,1]×[0,1] to the parallelogram P with corners (0,0), (3,1), (4,3) and (1,2). Since detA=3⋅2−1⋅1=5, it multiplies every area by 5 (lesson 3.4.1).
The map with matrix A sends a grid of squares to a grid of parallelograms. Every cell's area is multiplied by detA=5, so P has area 5.
So a Riemann sum (lesson 4.7.1) over P can use the images of the uv cells. A cell at (u,v) lands near the point (3u+v,u+2v) and has area 5dudv:
∬Pf(x,y)dA=∫01∫01f(3u+v,u+2v)⋅5dudv
For f(x,y)=x this gives ∬PxdA=5∫01∫01(3u+v)dudv=5(23+21)=10. Without the factor 5 you would get 2.
The same numbers come from a plain grid in x and y, with no map at all. Cover the box [0,4]×[0,3] with small squares and keep those whose midpoint lies in P, edges included:
squares per unit length
10
100
1000
area of P
5.1
5.01
5.001
∬PxdA
10.2
10.02
10.002
The squares cut by the edges make this slow: the error shrinks only in step with the square's width. But both rows settle on 5 and 10.
Try it
The first line integrates over the unit square with SymPy: the area of P, then ∬PxdA with the factor detA and without it.
Then the grid check, one row of squares at a time. A midpoint is in P when its (u,v) lies in the unit square; by the inverse of lesson 3.2.3, u=52x−y and v=53y−x. Measuring x and y in grid steps, i and j, keeps the test exact for points on the edges.
⌘/Ctrl + Enter runs the cell
Rule: Change of variables, linear map
∬Rf(x,y)dA=∬Sf(x(u,v),y(u,v))∣detA∣dudv
Here x=Au sends S onto R. Each uv cell lands on a cell ∣detA∣ times as large, so dA=∣detA∣dudv.
New variables given in terms of x and y
Often the region comes as lines in x and y. Take the region R where 0≤x+y≤2 and 0≤x−y≤2: a square turned through 45°, with corners (0,0), (1,1), (2,0) and (1,−1). In the new variables u=x+y and v=x−y it becomes the square S=[0,2]×[0,2].
Here the formulas go the other way: they give (u,v) from (x,y). That map has matrix (111−1), with determinant −2. The map back from (u,v) to (x,y) is its inverse, with determinant −21=−21 (lesson 3.4.1).
The minus sign only says the map flips the plane over. The area scale is −21=21. So the area of R is 21×4=2, and
∬R(x+y)2dA=∫02∫02u2⋅21dudv=21⋅38⋅2=38
Rule: Going the other way
area scale=∣detM∣1
If the new variables are given in terms of the old ones, with matrix M, the map back from (u,v) to (x,y) has determinant detM1. Always take the absolute value: an area cannot be negative.
Try it
SymPy finds both determinants, then the integral over the square S.
dblquad (lesson 4.7.1) checks it directly over the turned square. That needs two pieces: for x from 0 to 1, y runs from −x to x; for x from 1 to 2, from x−2 to 2−x.
⌘/Ctrl + Enter runs the cell
A non-linear map
Now take the map x=u, y=uv. Read backwards, v=xy is the slope of the line from the origin to the point. So the map describes each point by its x and the slope of its ray, a cousin of the distance and angle of lesson 4.7.3.
It sends the unit square S onto the triangle T where 0≤y≤x≤1. Each line u= constant lands on a vertical segment from (u,0) to (u,u), of length u. Each line v= constant lands on the ray y=vx.
The map x=u, y=uv sends the square onto a triangle. Cells near u=0 are squeezed towards the origin; near u=1 they keep most of their area. Each cell's area is multiplied by the u at its centre.
So the area scale changes from point to point. Measure it on a small cell [u0,u0+h]×[v0,v0+h].
Its image is a trapezoid with vertical sides of lengths u0h and (u0+h)h, a distance h apart, so its area is h2(u0+2h). Divide by the cell's area h2:
side h
0.1
0.01
0.001
area ratio at u0=0.5
0.55
0.505
0.5005
area ratio at u0=0.25
0.3
0.255
0.2505
As the cell shrinks, the ratio settles on u0: the local area scale at that point.
The Jacobian matrix
A small step du in u moves the point by (∂u∂x,∂u∂y)du, the partial derivatives of lesson 4.1.2. A small step dv moves it by (∂v∂x,∂v∂y)dv. Close up, the curved grid looks straight, and a small cell lands on the parallelogram with these two sides.
Rule: Jacobian matrix
J=∂u∂x∂u∂y∂v∂x∂v∂ylocal area scale=∣detJ∣
The columns are where small steps in u and in v take the point. By lesson 3.4.1, the parallelogram they span has area ∣detJ∣dudv.
For a linear map, J=A at every point. Lesson 4.2.2 meets the same matrix in the chain rule.
For x=u, y=uv:
J=(1v0u),detJ=u
That is the u0 the table found. Along the edge u=0 the determinant is 0: the whole edge lands on the single point (0,0). An edge has no area, so this does no harm.
Rule: Change of variables
∬Rf(x,y)dxdy=∬Sf(x(u,v),y(u,v))∣detJ∣dudv
The map must send S onto R, covering each point of R once. Change three things together: the function (put in x(u,v) and y(u,v)), the region (S instead of R) and the area (∣detJ∣dudv instead of dxdy).
Example. Average the slope xy over the triangle T. With the map, xy=v and dA=ududv:
∬TxydA=∫01∫01v⋅udvdu=21⋅21=41
The direct way agrees: ∫01∫0xxydydx=∫012xdx=41. Without the factor u the answer would be 21. The area of T is ∫01∫01ududv=21, so the average slope, the integral divided by the area, is 41÷21=21.
Try it
SymPy builds J with .jacobian and takes its determinant. Then the integral of xy through the map, without the factor u, and directly; dblquad agrees.
The loop measures the area ratio of small cells at u0=0.5 and 0.25. cell_area splits the image into two triangles, each half the absolute determinant of two edge vectors (lesson 3.4.1).
⌘/Ctrl + Enter runs the cell
Folds, flips and one variable
A flip is fine. The map (u,v)↦(v,u) swaps the axes, a mirror image with detJ=−1. Areas are unchanged, which is why the rule takes ∣detJ∣.
A fold is not. The map x=u2, y=v sends [−1,1]×[0,1] onto the unit square twice over: u=0.5 and u=−0.5 land on the same point. Here ∣detJ∣=∣2u∣, and ∫01∫−11∣2u∣dudv=2, though the unit square has area 1. A map that covers R twice counts its area twice.
One variable. Substitution (lesson 2.6.1) is the same rule with a 1×1 Jacobian: x=g(u) gives dx=g′(u)du. For x=2u+1, which takes [0,1] to [1,3], ∫13x2dx=∫01(2u+1)2⋅2du=326.
In one variable a falling g needs no absolute value: the new limits run backwards, and swapping them fixes the sign (lesson 2.6.1). A region in the plane has no such order, so the rule uses ∣detJ∣ instead.
Try it
The determinants of the flip and the fold, then the fold's double count.
The last line checks the substitution x=2u+1 both ways.
⌘/Ctrl + Enter runs the cell
Lesson 4.7.3 applies the rule to polar coordinates, where detJ=r. Case study 4.7.5 uses a linear map to turn independent normal draws into correlated returns. Lesson 5.6.1 uses the rule for functions of random variables.
Common mistakes
Keep the area factor.∬PxdA is 5×2=10, not 2: every dudv becomes ∣detJ∣dudv.
Use the right map's determinant. If u and v are given in terms of x and y, the factor is ∣detM∣1: 21 for u=x+y, v=x−y, not 2.
Take the absolute value. A determinant of −21 is an area scale of 21.
Change the region too. The limits must describe S in u and v, not R.
For a non-linear map, detJ depends on the point. It stays inside the integral: ∬TxydA=∫01∫01vudvdu.
The map must cover R once.x=u2 on [−1,1] folds, and counts every area twice.
Change of variables
0 of 12 correct
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
How to type answers
Powers with ^: x^7, 2^(1/3), a^-2.
Multiply with * or by writing side by side: 3x^2, 2(x+1).
ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
Your first answer to each question is saved: it counts towards your score and brings the question back for review.
Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.
Summary card
A map (u,v)↦(x,y) sends small cells to small cells; the area scale near a point is ∣detJ∣, with J the matrix of partial derivatives ∂u∂x,∂v∂x,∂u∂y,∂v∂y.
Change of variables: ∬Rfdxdy=∬Sf(x(u,v),y(u,v))∣detJ∣dudv, with the map covering R once.
A linear map x=Au has J=A everywhere: every area is multiplied by ∣detA∣.
If u and v are given in terms of x and y by a matrix M, the factor is ∣detM∣1. The sign of a determinant only records a flip.
For a non-linear map the scale changes from point to point: x=u, y=uv has detJ=u.
In one variable the rule is substitution, dx=g′(u)du.