Skip to content
Tutorials Center
My learning

Topics

Lesson 30 of 68 ยท Multivariable Calculus

Change of Variables in Multiple Integrals

Learn the Jacobian determinant and change of variables for double and triple integrals, including polar, cylindrical and spherical coordinates, checked with SymPy.

In one variable, the substitution rule says integral f(g(u)) g'(u) du = integral f(x) dx. The factor g'(u) is a stretching factor: if u moves a little, x = g(u) moves g'(u) times as far. In two and three dimensions the same thing happens, but the stretching is described by a matrix, and the factor you need is a determinant: the Jacobian.

You have already used special cases. In double and triple integrals you learned that polar coordinates use dA = r dr dtheta and spherical coordinates use dV = rho**2 sin(phi) drho dphi dtheta. This lesson explains where those extra factors come from, and gives you a method that works for any change of variables, including ones you invent to make an awkward region rectangular. It uses partial derivatives and determinants.

The Jacobian

Suppose x = x(u, v) and y = y(u, v) map a region S in the (u, v) plane onto a region R in the (x, y) plane. The Jacobian determinant of this map is

J = d(x, y) / d(u, v) = (dx/du)*(dy/dv) - (dx/dv)*(dy/du)

This is the determinant of the matrix of partial derivatives. Think of a tiny rectangle in the (u, v) plane with sides du and dv. Under the map it becomes a tiny parallelogram whose sides are the vectors (dx/du, dy/du) du and (dx/dv, dy/dv) dv. The area of a parallelogram spanned by two vectors is the absolute value of their determinant. So the area scales by |J|:

dA = |J| du dv

The change-of-variables formula follows:

double integral over R of f(x, y) dA = double integral over S of f(x(u, v), y(u, v)) * |J| du dv

flowchart LR
    A["region R in (x, y)<br/>awkward"] --> B["choose u(x,y), v(x,y)"]
    B --> C["region S in (u, v)<br/>simple, often a rectangle"]
    C --> D["compute |J| = |d(x,y)/d(u,v)|"]
    D --> E["integrate f * |J| over S"]

Pick coordinates that make the region simple, then pay the Jacobian toll.

Two points deserve emphasis. First, you need the Jacobian of (x, y) with respect to (u, v): the new variables are in the denominator. If you find it easier to compute d(u, v) / d(x, y), remember that the two are reciprocals, d(x, y)/d(u, v) = 1 / (d(u, v)/d(x, y)). Second, you take the absolute value.

Polar coordinates, derived

With x = r*cos(theta) and y = r*sin(theta):

J = (cos(theta))*(r*cos(theta)) - (-r*sin(theta))*(sin(theta)) = r*cos(theta)**2 + r*sin(theta)**2 = r

So dA = r dr dtheta, exactly the extra r you used before. The same method with x = r*cos(theta), y = r*sin(theta), z = z gives r for cylindrical coordinates, and spherical coordinates give rho**2 * sin(phi).

SymPy can compute these Jacobian determinants. Matrix.jacobian builds the matrix of partial derivatives and det finishes the job.

Python Jacobians of the standard coordinate systems

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The spherical result is rho**2*sin(phi), which is non-negative because sin(phi) >= 0 on [0, pi]. Listing the variables in a different order only flips the sign of the determinant, which is why the formula uses the absolute value. The linear map x = 3u + v, y = u + 2v has the constant Jacobian 5 (3*2 - 1*1).

A linear change of variables

Many regions bounded by slanted lines become rectangles in well-chosen coordinates. Consider the parallelogram R bounded by the lines x + y = 1, x + y = 3, x - y = 0 and x - y = 2. Define

u = x + y, v = x - y, so 1 <= u <= 3 and 0 <= v <= 2.

To integrate, we need x and y in terms of u and v: x = (u + v)/2, y = (u - v)/2. The Jacobian is

d(x, y)/d(u, v) = (1/2)*(-1/2) - (1/2)*(1/2) = -1/2, so |J| = 1/2.

Now compute double integral over R of (x + y)*(x - y) dA. In new variables the integrand is u*v:

integral from v=0 to 2, integral from u=1 to 3 of u*v * (1/2) du dv = (1/2) * (integral of u du = 4) * (integral of v dv = 2) = 4.

The area of R itself is |J| times the area of the uv rectangle: (1/2) * (2 * 2) = 2. In the original coordinates this region needs several pieces; in the new ones it is a single rectangle.

Python Change of variables, checked by Monte Carlo

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The Monte Carlo estimates, which never use the Jacobian, land very close to the exact values 2 and 4.

Ellipses and ellipsoids

Stretching a circle into an ellipse is a change of variables. Let x = a*u, y = b*v. The ellipse x**2/a**2 + y**2/b**2 <= 1 becomes the unit disk u**2 + v**2 <= 1. The Jacobian is a*b, so

Area = a*b * (area of unit disk) = pi*a*b.

In three dimensions, an ellipsoid with semi-axes a, b, c has volume a*b*c * (4*pi/3): the stretching factor is a*b*c times the volume of the unit ball. This combination of a linear stretch and a spherical coordinate system is the standard trick for integrals over ellipses and ellipsoids, and it is the geometric meaning of det(A) as a volume scale factor.

Python Ellipse area and ellipsoid volume

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Choosing a transformation

A good change of variables does at least one of two things:

  1. It makes the region simple. Circles become rectangles in polar coordinates (0 <= r <= R, 0 <= theta <= 2*pi); regions between curves x*y = c1, x*y = c2 and y/x = k1, y/x = k2 become rectangles with u = x*y, v = y/x.
  2. It makes the integrand simple. If the integrand contains x**2 + y**2, x + y, or x*y, name that combination as a new variable.

Often you can only write u and v as functions of x and y, not the other way round. That is fine: compute d(u, v)/d(x, y) and take its reciprocal. For example, for u = x*y, v = y/x, the matrix is [[y, x], [-y/x**2, 1/x]] with determinant y/x + y/x = 2*y/x = 2*v. So d(x, y)/d(u, v) = 1/(2*v) and dA = du dv / (2*v).

Python Jacobian via the inverse map

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The area comes out as (3/2)*ln 2, about 1.0397.

Common mistakes

  • Using the Jacobian of the wrong direction. The formula needs d(x, y)/d(u, v), with old variables on top.
  • Forgetting the absolute value, which gives negative areas.
  • Transforming the integrand and the region but forgetting the |J| factor.
  • Using a transformation that is not one-to-one on the region (for instance polar coordinates with theta ranging over more than 2*pi).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the Jacobian determinant |J| measure?

    A tiny rectangle in (u, v) becomes a parallelogram in (x, y) whose area is |J| times as large. That is why dA = |J| du dv.
  2. 2. What is the Jacobian of polar coordinates x = r cos(theta), y = r sin(theta)?

    J = cos(theta) * r cos(theta) - (-r sin(theta)) * sin(theta) = r.
  3. 3. For x = (u + v)/2 and y = (u - v)/2, what is |d(x, y)/d(u, v)|?

    J = (1/2)(-1/2) - (1/2)(1/2) = -1/2, so the absolute value is 1/2.
  4. 4. The ellipse x^2/a^2 + y^2/b^2 <= 1 is mapped from the unit disk by x = a u, y = b v. What is its area?

    The Jacobian is a b, and the unit disk has area pi, so the ellipse has area pi a b.

Summary

  • The Jacobian J = d(x, y)/d(u, v) is the determinant of the partial-derivative matrix; areas scale by |J|.
  • Change of variables: double integral over R of f dA = double integral over S of f(x(u,v), y(u,v)) * |J| du dv; triple integrals work with a 3-by-3 determinant.
  • Polar J = r, cylindrical J = r, spherical J = rho**2 * sin(phi); linear maps have a constant Jacobian equal to their determinant.
  • Choose variables that make the region a rectangle or the integrand simple; if you only know u(x, y), take the reciprocal of d(u, v)/d(x, y).
  • Always use the absolute value, and keep the map one-to-one on the region.

Next: for the "shape" side of calculus, see Curve Tracing: Polar and Parametric Curves.