Multivariable Calculus Intro
Multivariable Calculus: Comprehensive Study Notes
🧭 The Gradient and Partial Derivatives
In single variable calculus, functions of the form y=f(x) live on a curve in a plane. The two fundamental questions were: how steep is it? (answered by the derivative dy/dx) and what is the area underneath? (answered by the integral ∫f(x)dx). Moving to multivariable calculus means entering a world of surfaces where z=f(x,y). This is a fundamental shift: the slope now depends on direction, and the area question becomes a volume question.
Motivating Problem: The Hill
Consider a hill described by the height function h(x,y)=100−x2−2y2. At the point (x=1,y=1), the height is h(1,1)=97. Two critical questions arise:
From this spot, which direction is the steepest ascent?
How steep is that path? What is the slope?
In single variable calculus, slope was a single number. Here, slope depends on which direction one walks. The solution is to slice the mountain — freeze all variables except one and treat the problem as a simple 2D curve.
Partial Derivatives
Freezing variables is the core idea behind partial derivatives. To find the slope in the x-direction, lock y at a constant value (here y=1). The function becomes:
This is a single-variable function. Its derivative is:
At x=1, the slope in the x-direction is −2.
The shortcut for partial derivatives: treat all other variables as constants. The partial derivative with respect to x is written ∂x∂h. For h(x,y)=100−x2−2y2:
Derivative of 100 with respect to x: 0 (constant)
Derivative of −x2: −2x (variable)
Derivative of −2y2: 0 (treat y as constant) Thus ∂x∂h=−2x. At (1,1): −2.
Similarly, for ∂y∂h treat x as constant:
Derivative of 100: 0
Derivative of −x2: 0 (constant)
Derivative of −2y2: −4y (variable) Thus ∂y∂h=−4y. At (1,1): −4.
The Gradient Vector
The gradient packages the partial derivatives into a single vector. Written as ∇h or grad h:
Definition: The gradient ∇f points in the direction of steepest ascent of the function. Its magnitude gives the slope in that direction.
For the hill at (1,1):
Answers to the motivating problem:
Direction of steepest ascent: The gradient vector ⟨−2,−4⟩ points exactly uphill from the point.
Steepest slope: The magnitude of the gradient: $$ \nabla h(1,1) = \sqrt{(-2)^2 + (-4)^2} = \sqrt{4 + 16} = \sqrt{20} \approx 4.47 $$
The gradient is both a compass (direction) and a slope meter (magnitude).
🔧 The Jacobian: Derivative for Multiple Inputs and Outputs
When a function has multiple inputs and multiple outputs, the derivative is no longer a number or a vector — it becomes a matrix called the Jacobian.
Motivating Problem: The Factory
A factory takes inputs x (units of steel) and y (units of plastic) and produces outputs u (cars) and v (toys). The production functions are:
This can be written as a vector function f(x,y)=⟨u(x,y),v(x,y)⟩. The key question: how does a small change in inputs affect both outputs simultaneously?
Partial Sensitivities
Compute the four partial derivatives that describe sensitivities:
Steel's effect on cars: ∂x∂u=2 (one extra steel → two more cars)
Plastic's effect on cars: ∂y∂u=0.5 (one extra plastic → half a car)
Steel's effect on toys: ∂x∂v=0.1 (one extra steel → 0.1 more toys)
Plastic's effect on toys: ∂y∂v=3 (one extra plastic → three more toys)
The Jacobian Matrix
Organize these into a matrix. Rows correspond to outputs (u, v); columns correspond to inputs (x, y):
Jacobian matrix J:
J=[∂x∂u∂x∂v∂y∂u∂y∂v]=[20.10.53]
The Jacobian acts as a universal translator between input changes and output changes. For small changes Δx, Δy:
Example: Suppose 10 extra units of steel (Δx=10) and 5 extra units of plastic (Δy=5):
The Chain Rule and Backpropagation
The true power of the Jacobian appears when composing functions. Extend the factory example with a profit function P(u,v)=3000u+500v. The chain of functions is:
To find how profit changes with respect to an input (e.g., ∂P/∂x), multiply the Jacobians of each step:
Using known values:
Partial derivatives of profit: ∂P/∂u=3000, ∂P/∂v=500
Production partials: ∂u/∂x=2, ∂v/∂x=0.1
Thus: $\frac{\partial P}{\partial x} = 3000(2) + 500(0.1) = 6000 + 50 = \6050 $$
Key insight: This process of multiplying Jacobians backward through a chain of functions is exactly the algorithm of backpropagation in neural networks. A deep neural network is a composition of functions (layers); backpropagation uses the chain rule to compute gradients of the error with respect to every weight. The Jacobian is the engine that drives modern artificial intelligence.
📐 The Hessian: Second Derivatives in Multiple Dimensions
The gradient gives a first-order (linear) approximation of a surface. To understand curvature — whether a surface is bending up like a valley, down like a peak, or twisting like a saddle — requires the second derivative, which in multiple dimensions is a matrix called the Hessian.
From Concavity to Curvature
In single variable calculus, the second derivative f′′(x) indicates concavity:
f′′(x)>0: concave up (cup shape, holds water)
f′′(x)<0: concave down (frown shape, spills water)
In three dimensions, a surface can curve differently in different directions. A Pringle chip curves up along its short axis and down along its long axis — a single number cannot capture this.
Motivating Problem: The Flat Spot
When hiking, a perfectly flat spot occurs where the gradient is zero (∇f=⟨0,0⟩). This critical point could be:
Local minimum (bottom of a valley)
Local maximum (peak of a mountain)
Saddle point (mountain pass — neither min nor max)
The gradient gives no information at a critical point. To classify it, one must examine the curvature using the Hessian.
The Hessian Matrix
Definition: The Hessian matrix H is the matrix of all second-order partial derivatives:
H=[fxxfyxfxyfyy]where fxx=∂x2∂2f, fxy=∂x∂y∂2f, etc. By Clairaut's theorem, fxy=fyx for well-behaved functions.
The diagonal entries fxx and fyy describe concavity along the x- and y-directions. The off-diagonal mixed partials measure the twist of the surface.
Examples of Hessians at Critical Points
Example 1: Valley (local minimum) — f(x,y)=x2+y2
First partials: fx=2x, fy=2y → zero at (0,0)
Second partials: fxx=2, fyy=2, fxy=0
Hessian at (0,0):
H=[2002]Both diagonal entries positive: curvature up in both directions → valley.
Example 2: Peak (local maximum) — f(x,y)=−x2−y2
fxx=−2, fyy=−2, fxy=0 → Hessian [−200−2]
Both diagonal entries negative: curvature down in both directions → peak.
Example 3: Saddle point — f(x,y)=x2−y2
fxx=2, fyy=−2, fxy=0 → Hessian [200−2]
Diagonal entries have opposite signs: curvature up in x, down in y → saddle point (Pringle shape).
The Second Derivative Test in 3D
At a critical point (a,b), compute the Hessian determinant:
Classification table:
D>0 and fxx>0: local minimum (valley)
D>0 and fxx<0: local maximum (peak)
D<0: saddle point
D=0: test is inconclusive
📈 Unconstrained Optimization
Optimization in multiple dimensions follows the same two-step dance as single variable calculus, but with more powerful tools.
Algorithm: Find and Classify Critical Points
Step 1: Find critical points where the gradient is the zero vector: ∇f=0. Set all first partial derivatives to zero and solve for (x,y).
Step 2: Classify each critical point using the Hessian matrix H and the second derivative test.
Example: Maximizing Profit
A company's daily profit from producing x units of product X and y units of product Y is:
Step 1: Find critical point.
∂x∂P=−20(x−10)=−2x+20⇒−2x+20=0⇒x=10
∂y∂P=−6(y−25)=−6y+150⇒−6y+150=0⇒y=25 Critical point: (10,25).
Step 2: Classify using Hessian.
Pxx=−20, Pyy=−6, Pxy=0
Hessian at (10,25): H=[−2000−6]
Determinant: D=(−20)(−6)−(0)2=120>0
Pxx=−20<0
Since D>0 and Pxx<0, the point is a local maximum.
Maximum profit: P(10,25) = 1500 - 10(0)^2 - 3(0)^2 = \1500$.
The company should produce 10 units of X and 25 units of Y to maximize daily profit at 1500.
🔒 Constrained Optimization: Lagrange Multipliers
Real-world problems often have constraints: a limited budget, a fixed perimeter, or a strength requirement. The goal is to optimize an objective function subject to a constraint equation. The method of Lagrange multipliers finds points where the gradients of the objective and constraint are parallel.
Motivating Problem: The Perfect Pen
Build a rectangular pen with a 24-meter perimeter to maximize area.
Objective function: area f(x,y)=xy
Constraint: perimeter 2x+2y=24, simplified to x+y=12 (or g(x,y)=x+y=12)
The Point of Tangency
Imagine walking along the constraint line x+y=12 on a contour plot of f(x,y)=xy. The maximum area occurs where the constraint line is tangent to a contour curve of f. At tangency, the gradients of f and g are parallel:
where λ (lambda) is the Lagrange multiplier.
Lagrange Multiplier Algorithm
Step-by-step method:
Identify the objective f(x,y) and constraint g(x,y)=c.
Compute gradients ∇f and ∇g.
Set up the system: $$ \begin{cases} f_x = \lambda g_x f_y = \lambda g_y g(x,y) = c \end{cases} $$
Solve for x, y, and λ (the critical point candidate).
Solving the Pen Problem
Step 1: f(x,y)=xy, g(x,y)=x+y=12. Step 2: ∇f=⟨y,x⟩, ∇g=⟨1,1⟩. Step 3: Equations:
y=λ(1)
x=λ(1)
x+y=12
Step 4: From the first two equations, x=y=λ. Substitute into constraint: x+x=12⇒2x=12⇒x=6, so y=6, λ=6.
Optimal pen: square of side 6 m, with maximum area 6×6=36 m².
The Shadow Price
The Lagrange multiplier λ has a profound interpretation: it is the shadow price — the rate at which the objective changes if the constraint is relaxed by one unit. Here λ=6 means that for each additional meter of fencing, the maximum area increases by approximately 6 square meters.
📊 Double Integrals: Volume and Mass
Integration in multivariable calculus extends the single-variable notion of area under a curve to volume under a surface (and beyond, to mass and probability).
From Area to Volume
In single variable calculus:
Slicing the x-axis into tiny pieces dx, multiplying height f(x) by width dx, then summing.
In two variables:
Slicing the xy-plane into tiny patches dA, multiplying height f(x,y) by area dA, then summing.
Interpretation of f(x,y):
If f(x,y) represents height, the double integral gives volume.
If f(x,y) represents density (mass per unit area), the double integral gives mass.
Iterated Integrals
Double integrals are evaluated as iterated integrals — two nested single integrals.
Rule: Work from the inside out.
∬Rf(x,y)dA=∫cd∫abf(x,y)dxdyFirst integrate with respect to x (treating y as constant), then integrate the result with respect to y.
Example: Volume Over a Square
Find the volume under z=4−x2−y2 over the square 0≤x≤1, 0≤y≤1.
Step 1: Set up iterated integral (constant bounds):
Step 2: Inner integral with respect to x:
Step 3: Outer integral with respect to y:
The exact volume is 310 cubic units.
Variable Bounds
The real challenge of double integrals is setting up bounds for non-rectangular regions. The outer bounds are constant; the inner bound contains the variable.
Example: Mass of a Triangular Plate
Find the mass of a triangular plate with vertices at (0,0), (2,0), (2,1) and density ρ(x,y)=xy.
Region description: The triangle spans x from 0 to 2 (constant outer bound). For a given x, y goes from 0 (bottom edge) to the slanted line connecting (0,0) to (2,1), which is y=x/2. So the inner bound is 0≤y≤x/2.
Set up the integral:
Inner integral (with respect to y):
Outer integral:
The total mass of the plate is 21 unit.
Physical and Probabilistic Applications
Double integrals are the workhorse of physics, engineering, and statistics:
Mass: ∬ρ(x,y)dA for variable density
Center of mass: M1∬xρ(x,y)dA, M1∬yρ(x,y)dA
Probability: ∬Rf(x,y)dA where f(x,y) is a joint probability density function, giving the probability that the pair (X,Y) lies in region R
🔄 Change of Variables: Polar Coordinates
For regions with circular symmetry (e.g., disks, annuli), setting up bounds in Cartesian coordinates leads to messy square roots. Switching to polar coordinates simplifies the region dramatically, but requires a Jacobian factor to account for area distortion.
Cartesian Nightmare vs. Polar Relief
Problem: Find the volume under z=9−x2−y2 above the xy-plane. The base is the disk x2+y2≤9 (circle radius 3).
Cartesian bounds:
This integral is difficult due to the square root bounds and the x2+y2 term.
Polar transformation:
The region becomes a simple rectangle in (r,θ):
0≤r≤3 (radius from 0 to 3)
0≤θ≤2π (full circle)
The function becomes z=9−r2.
The Jacobian Factor
When changing coordinates, the area element dA=dxdy is not equal to drdθ. The factor is the absolute value of the determinant of the Jacobian of the transformation.
Key formula:
dxdy=∣det(J)∣drdθ
Compute the Jacobian of the map (r,θ)→(x,y):
The determinant:
Thus:
This is the golden ticket for integrations in polar coordinates: always include an extra factor of r.
Solving the Volume Problem the Easy Way
Step 1: Convert everything to polar.
Region: 0≤r≤3, 0≤θ≤2π
Function: z=9−r2
Area element: dA=rdrdθ
Step 2: Set up integral.
Step 3: Inner integral with respect to r.
Step 4: Outer integral with respect to θ.
The volume is 281π cubic units — solved in three simple lines.
General Change of Variables
The same principle extends to other coordinate systems:
Cylindrical coordinates (for problems with rotational symmetry about an axis):
dV=rdzdrdθSpherical coordinates (for spheres, planets, atoms):
dV=ρ2sinϕdρdϕdθ
In each case, the Jacobian determinant provides the correct volume/area element for the chosen coordinate system, turning impossible integrals into manageable ones.
✅ The Multivariable Calculus Toolbox
All the tools developed in this course fit together into a coherent framework for analyzing functions of multiple variables.
The Tools at a Glance
🧭 Gradient ∇f
Vector of first partial derivatives.
Points in direction of steepest ascent; magnitude gives slope.
Fundamental for finding critical points.
🔧 Jacobian J
Matrix of first partial derivatives of a vector function.
Translates changes in inputs to changes in outputs.
Essential for the multivariable chain rule and backpropagation.
📐 Hessian H
Matrix of second partial derivatives.
Describes the curvature of a surface.
Used to classify critical points (min, max, saddle) via the second derivative test.
📈 Unconstrained Optimization
Solve ∇f=0 for critical points.
Compute Hessian determinant D=fxxfyy−(fxy)2.
Classify: D>0 and fxx>0 → min; D>0 and fxx<0 → max; D<0 → saddle.
🔒 Lagrange Multipliers
Optimize f(x,y) subject to g(x,y)=c.
Solve ∇f=λ∇g along with the constraint.
λ gives the shadow price (sensitivity of objective to constraint relaxation).
📊 Double and Triple Integrals
∬Rf(x,y)dA gives volume (if f is height) or mass (if f is density).
Evaluate as iterated integrals, working from the inside out.
For non-rectangular regions, set variable bounds carefully.
🔄 Change of Variables
dxdy=∣det(J)∣dudv where J is the Jacobian of the transformation.
Key for polar (dxdy=rdrdθ), cylindrical (dV=rdzdrdθ), and spherical coordinates (dV=ρ2sinϕdρdϕdθ).
Transforms complicated regions into simple ones.
These tools, evolved from single-variable calculus, enable the analysis of real-world problems in engineering, physics, computer science, and economics. The fundamental shift from flatland to spaceand — from curves to surfaces, from scalar to vector, from one slope to infinite directions — is now a mastered perspective. Multivariable calculus clicks.

Ask anything
We've read this whole study set, so questions about it get the best answers.