Calculus

Change of Variables

Why does the same scalar quantity, the Jacobian determinant, rescale integrals in calculus and probability densities in machine-learning generative models?

  • NVIDIA RTX rendering pipeline: every coordinate transformation (world -> camera -> screen) carries a Jacobian that determines volume distortion
  • Real NVP, Glow, Neural ODEs: normalising-flow generative models train on log|det J| of an invertible neural network, enabling exact-likelihood deep learning
  • Cartography: every map projection (Mercator, Lambert, Mollweide) has a position-dependent Jacobian that explains why Greenland looks bigger than it is
  • Continuum mechanics: deformation gradient F is the Jacobian of the displacement map; det F < 0 means the material has folded onto itself (failure mode)

Предварительные знания

  • Double and triple integrals
  • Partial derivatives and matrix determinants
  • Polar and spherical coordinates
  • Triple Integrals

The Jacobian Determinant

When NVIDIA renders a scene, it transforms coordinates dozens of times: world -> camera -> clip -> screen. Each transformation's volume distortion is captured by a Jacobian determinant. PyTorch's normalising-flows for generative models use Jacobian determinants to compute exact log-likelihoods. The same scalar quantity that rescales an integral also rescales a probability density.

In 3D the formula is identical with a 3x3 Jacobian. In general dimension n, the volume element transforms as dV_new = |det DT| * dV_old. This is just the chain rule + multilinear algebra of determinants.

T must be (almost everywhere) injective on S, smooth, and have non-vanishing Jacobian. Singularities (J = 0 on a set of positive measure) break the formula and require careful treatment.

For the polar map x = r cos theta, y = r sin theta, what is the Jacobian determinant?

J = (dx/dr)(dy/d theta) - (dx/d theta)(dy/dr) = cos theta * r cos theta - (-r sin theta) * sin theta = r. So dA = r dr d theta.

Polar, Cylindrical, Spherical: All Special Cases

Polar, cylindrical, and spherical aren't three independent ideas; they're three applications of the same Jacobian formula. Understanding the general theorem means never having to memorise another coordinate-specific volume element. You compute it once, from the partial derivatives.

If you forget a Jacobian, derive it from scratch: write the map (u, v, w) -> (x, y, z), differentiate, take the determinant. Faster than searching the textbook, and you don't get the wrong sign.

Why is sin(phi) in the spherical Jacobian but not in the cylindrical Jacobian?

On a sphere of radius rho, lines of constant phi (latitude circles) have radius rho sin phi. Near the poles, sin phi -> 0, so the cells degenerate. The Jacobian's sin phi factor reflects this geometry.

Non-Standard Substitutions

Sometimes the region itself begs for a custom substitution. A parallelogram is easier as a unit square; an ellipse is easier as a unit disk; a region bounded by hyperbolae is easier in (u, v) = (xy, y/x). The Jacobian theorem doesn't care if the substitution is famous; it just needs the determinant.

The hyperbolic substitution u = xy, v = y/x has Jacobian J = (du/dx)(dv/dy) - (du/dy)(dv/dx) = -2 v (verify). Useful for regions bounded by xy = const and y/x = const.

Substitution strategy: choose new variables so the region becomes a rectangle, disk, or other shape with clean limits. Even if the Jacobian is messy, simpler limits usually win.

Use a substitution to find the area of the ellipse x^2/4 + y^2/9 = 1.

Substitute x = 2u, y = 3v. The Jacobian is ab = 6. Area = 6 * (area of unit disk) = 6 pi.

The General Change-of-Variables Theorem

Normalising-flow models in machine learning (Real NVP, Glow, Neural ODEs) generate complex distributions by warping a Gaussian through an invertible neural network. The training loss requires log |det J| at every step. The same change-of-variables theorem that computes ellipse areas is the foundation of a $10B research area.

The theorem requires T to be a C^1 diffeomorphism (smooth, smooth inverse) on the interior. Boundary effects and measure-zero singularities are handled separately. In practice, almost all useful substitutions satisfy the hypothesis.

Mnemonic: 'new dA equals |J| times old dA'. Whether you're computing an ellipse area or training a neural-network flow, the Jacobian is the same conversion factor.

Why does the change-of-variables formula require |det J| rather than just det J?

Measure (area/volume) is non-negative. If T reverses orientation, det J < 0, and the integral would come out negative without the absolute value. |det J| restores positivity.

The Jacobian, everywhere

The change-of-variables theorem is the algebraic shadow of a geometric truth: smooth maps locally rescale volume, and the rescaling factor is the determinant of the differential.

  • Line and surface integrals — Parametrisations are 1D and 2D special cases of the same theorem
  • Probability theory — Density transformation under a change of variables is the same formula
  • Differential geometry — Volume forms transform via the Jacobian; the coordinate-free language unifies everything
  • Machine learning normalising flows — log|det J| terms enable exact-likelihood generative modelling

Итоги

  • The 2D Jacobian is J = det of the matrix of partial derivatives of T. dA_new = |J| dA_old
  • Change-of-variables formula: double integral over R of f dA = double integral over S of f(T(u,v)) |J| du dv
  • Polar: |J| = r. Cylindrical: |J| = r. Spherical: |J| = rho^2 sin phi. All three are special cases of one theorem
  • Custom substitutions (e.g. x = a u, y = b v for ellipses, or u = xy, v = y/x for hyperbolic regions) often simplify limits even when |J| is non-trivial
  • The same formula governs probability density transformation, which is why normalising-flow neural networks are trained against log|det J|

Связанные уроки

  • calc-21-double-integrals — Double integrals in polar coordinates are the simplest non-trivial change of variables
  • calc-22-triple-integrals — Cylindrical and spherical coordinates are special cases of the general theorem
  • calc-24-line-integrals — Parametrisations of curves are 1D versions of the change-of-variables idea
Change of Variables

0

1

Sign In