← Back to modules

Multivariable & Vector Calculus

Partial derivatives, multiple integrals, and vector fields.

Single-variable calculus studies functions f:RRf: \mathbb{R} \to \mathbb{R} — one input, one output. Multivariable calculus extends everything to functions of two or three variables: surfaces, vector fields, and 3D geometry.

The core ideas (limits, derivatives, integrals) carry over, but with richer structure. A function of two variables has infinitely many directions to differentiate in. An integral over a region in the plane computes volume. Vector fields assign a vector to every point in space, and their integrals compute work and flux.

This module covers vectors, partial derivatives, optimization with several variables, multiple integrals, and the three great theorems of vector calculus: Green's, Stokes', and the Divergence Theorem.

Vectors and the geometry of space

A vector v=a,b,c\mathbf{v} = \langle a, b, c \rangle in R3\mathbb{R}^3 has magnitude v=a2+b2+c2|\mathbf{v}| = \sqrt{a^2 + b^2 + c^2} and direction.

Dot product: uv=u1v1+u2v2+u3v3=uvcosθ\mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2 + u_3 v_3 = |\mathbf{u}||\mathbf{v}|\cos\theta. It measures how aligned two vectors are. Zero dot product means perpendicular.

Cross product: u×v\mathbf{u} \times \mathbf{v} is a vector perpendicular to both u\mathbf{u} and v\mathbf{v}, with magnitude uvsinθ|\mathbf{u}||\mathbf{v}|\sin\theta (the area of the parallelogram they span).

Equations of lines: r(t)=r0+tv\mathbf{r}(t) = \mathbf{r}_0 + t\mathbf{v} (point plus direction). Equations of planes: n(rr0)=0\mathbf{n} \cdot (\mathbf{r} - \mathbf{r}_0) = 0 (normal vector dotted with displacement is zero).

These tools let you describe points, lines, planes, and curves in 3D space — the setting for everything that follows.

Helpful?

Vector functions and space curves

A vector function r(t)=x(t),y(t),z(t)\mathbf{r}(t) = \langle x(t), y(t), z(t) \rangle traces a curve in 3D space as the parameter tt varies. Think of tt as time: at each moment, the point (x(t),y(t),z(t))(x(t), y(t), z(t)) is the particle's position.

The derivative r(t)=x(t),y(t),z(t)\mathbf{r}'(t) = \langle x'(t), y'(t), z'(t) \rangle is the velocity vector — it points in the direction of motion and its magnitude is the speed.

Speed: r(t)=[x(t)]2+[y(t)]2+[z(t)]2|\mathbf{r}'(t)| = \sqrt{[x'(t)]^2 + [y'(t)]^2 + [z'(t)]^2}. The unit tangent vector T(t)=r(t)/r(t)\mathbf{T}(t) = \mathbf{r}'(t)/|\mathbf{r}'(t)| gives the direction of motion without the speed information.

Arc length: L=abr(t)dtL = \int_a^b |\mathbf{r}'(t)|\,dt — integrate speed over time to get total distance traveled. This is the 3D generalization of L=1+[f]2dxL = \int \sqrt{1+[f']^2}\,dx.

Curvature κ\kappa measures how sharply the curve turns: κ=T(t)/r(t)=r×r/r3\kappa = |\mathbf{T}'(t)|/|\mathbf{r}'(t)| = |\mathbf{r}' \times \mathbf{r}''|/|\mathbf{r}'|^3. A straight line has κ=0\kappa = 0; a circle of radius rr has κ=1/r\kappa = 1/r (tighter circle = higher curvature).

The acceleration vector a=r(t)\mathbf{a} = \mathbf{r}''(t) naturally decomposes into two components: a=aTT+aNN\mathbf{a} = a_T \mathbf{T} + a_N \mathbf{N} where aT=ddtra_T = \frac{d}{dt}|\mathbf{r}'| (tangential — speeding up or slowing down) and aN=κr2a_N = \kappa|\mathbf{r}'|^2 (normal — turning). This is why you feel pushed sideways on a curve and pressed back under acceleration.

Helpful?

Partial derivatives

For f(x,y)f(x, y), the partial derivative fx=fxf_x = \frac{\partial f}{\partial x} differentiates with respect to xx while treating yy as a constant.

Geometrically: fx(a,b)f_x(a, b) is the slope of the surface z=f(x,y)z = f(x, y) in the xx-direction at the point (a,b)(a, b).

Higher-order partials: fxxf_{xx}, fyyf_{yy}, fxyf_{xy}, fyxf_{yx}. Clairaut's Theorem: if fxyf_{xy} and fyxf_{yx} are continuous, then fxy=fyxf_{xy} = f_{yx} (the order of differentiation doesn't matter).

Example: if f(x,y)=x2y+sin(xy)f(x,y) = x^2 y + \sin(xy), then fx=2xy+ycos(xy)f_x = 2xy + y\cos(xy) and fy=x2+xcos(xy)f_y = x^2 + x\cos(xy).

Limits and continuity in multiple variables: lim(x,y)(a,b)f(x,y)=L\lim_{(x,y)\to(a,b)} f(x,y) = L means ff approaches LL from every possible path. To show a limit doesn't exist, find two paths that give different limits.

Helpful?

The gradient vector and directional derivatives

The gradient of f(x,y)f(x,y) is the vector f=fx,fy\nabla f = \langle f_x, f_y \rangle. It encodes all the directional information about how ff changes. Its direction points toward the steepest uphill, and its magnitude f|\nabla f| is the rate of steepest ascent.

The directional derivative of ff in the direction of unit vector u\mathbf{u} is Duf=fu=fcosθD_{\mathbf{u}} f = \nabla f \cdot \mathbf{u} = |\nabla f|\cos\theta, where θ\theta is the angle between f\nabla f and u\mathbf{u}. This tells you the rate of change of ff in any direction.

Key consequences: DufD_{\mathbf{u}} f is maximized when u\mathbf{u} points in the direction of f\nabla f (steepest ascent, θ=0\theta=0). It's minimized in the direction of f-\nabla f (steepest descent, θ=π\theta=\pi). It's zero when u\mathbf{u} is perpendicular to f\nabla f — this is the 'contour direction' where ff stays constant.

The gradient is perpendicular to level curves (in 2D) and level surfaces (in 3D). This is why contour maps work: if you walk along a contour line (f=f = constant), you're moving perpendicular to f\nabla f, so ff doesn't change.

The tangent plane to z=f(x,y)z = f(x,y) at (a,b,f(a,b))(a, b, f(a,b)) is zf(a,b)=fx(a,b)(xa)+fy(a,b)(yb)z - f(a,b) = f_x(a,b)(x-a) + f_y(a,b)(y-b). This is the multivariable analog of the tangent line — the best linear approximation to the surface at that point.

Helpful?

Optimization and Lagrange multipliers

To find extrema of f(x,y)f(x,y): set fx=0f_x = 0 and fy=0f_y = 0 simultaneously. Solutions are critical points.

Second derivative test: compute D=fxxfyy(fxy)2D = f_{xx} f_{yy} - (f_{xy})^2 at a critical point. If D>0D > 0 and fxx>0f_{xx} > 0: local min. If D>0D > 0 and fxx<0f_{xx} < 0: local max. If D<0D < 0: saddle point. If D=0D = 0: inconclusive.

Lagrange multipliers solve constrained optimization: maximize/minimize f(x,y)f(x,y) subject to a constraint g(x,y)=cg(x,y) = c.

Method: solve f=λg\nabla f = \lambda \nabla g and g(x,y)=cg(x,y) = c simultaneously. The scalar λ\lambda is the Lagrange multiplier.

Geometric insight: at a constrained extremum, the gradient of ff must be parallel to the gradient of gg. They point in the same (or opposite) direction along the constraint curve.

Helpful?

Multiple integrals

A double integral Rf(x,y)dA\iint_R f(x,y)\,dA computes the volume under z=f(x,y)z = f(x,y) over a region RR in the xyxy-plane.

Iterated integrals: RfdA=abg1(x)g2(x)f(x,y)dydx\iint_R f\,dA = \int_a^b \int_{g_1(x)}^{g_2(x)} f(x,y)\,dy\,dx. Evaluate the inner integral first (treating the outer variable as a constant).

Fubini's Theorem: if ff is continuous on RR, you can integrate in either order: fdydx=fdxdy\int\int f\,dy\,dx = \int\int f\,dx\,dy. Sometimes one order is much easier.

Polar coordinates: for circular or radial regions, use x=rcosθx = r\cos\theta, y=rsinθy = r\sin\theta, dA=rdrdθdA = r\,dr\,d\theta. The extra factor of rr is critical.

Triple integrals extend to 3D: EfdV\iiint_E f\,dV computes mass (if ff is density), or volume (if f=1f = 1).

Cylindrical coordinates (r,θ,z)(r, \theta, z): dV=rdrdθdzdV = r\,dr\,d\theta\,dz. Use for problems with cylindrical symmetry.

Spherical coordinates (ρ,ϕ,θ)(\rho, \phi, \theta): dV=ρ2sinϕdρdϕdθdV = \rho^2 \sin\phi\,d\rho\,d\phi\,d\theta. Use for spheres and cones.

Applications: mass = ρdA\iint \rho\,dA, center of mass = xρdAmass\frac{\iint x\rho\,dA}{\text{mass}}, moments of inertia.

Helpful?

Vector fields

A vector field assigns a vector to every point in space: F(x,y)=P(x,y),Q(x,y)\mathbf{F}(x,y) = \langle P(x,y), Q(x,y) \rangle in 2D, or F(x,y,z)=P,Q,R\mathbf{F}(x,y,z) = \langle P, Q, R \rangle in 3D. Visually, draw a small arrow at each point showing the direction and magnitude.

Physical examples: gravitational fields (arrows point toward massive objects), electric fields (arrows show the force on a positive charge), fluid velocity fields (arrows show speed and direction of flow at each point), wind maps, and magnetic fields.

A vector field is conservative if F=f\mathbf{F} = \nabla f for some scalar function ff (called the potential function). This means the field is the gradient of something. Conservative fields have a crucial property: the line integral between two points is independent of the path taken — only the endpoints matter.

Test for conservative fields in 2D: F=P,Q\mathbf{F} = \langle P, Q \rangle is conservative if and only if Py=Qx\frac{\partial P}{\partial y} = \frac{\partial Q}{\partial x} on a simply connected domain (no holes). This is the 'cross-partial' test.

Finding the potential function: if F=P,Q\mathbf{F} = \langle P, Q \rangle passes the cross-partial test, find ff by integrating: f(x,y)=Pdxf(x,y) = \int P\,dx (treating yy as constant), then determine any leftover function of yy by matching fy=Qf_y = Q.

Non-conservative fields include anything with a nonzero curl (in 3D) or failing the cross-partial test. The work done by such a field depends on the path, not just the endpoints. Example: F=y,x\mathbf{F} = \langle -y, x \rangle has Py=1P_y = -1 but Qx=1Q_x = 1, so it's not conservative — it swirls.

Helpful?

Line integrals

A line integral computes a quantity accumulated along a curve CC in space. There are two main types, and they answer different questions.

Scalar line integral: Cfds=abf(r(t))r(t)dt\int_C f\,ds = \int_a^b f(\mathbf{r}(t)) |\mathbf{r}'(t)|\,dt. Here ds=r(t)dtds = |\mathbf{r}'(t)|\,dt is the arc length element. This computes the 'weighted length' of the curve — for example, the mass of a wire with density ff at each point, or the total cost of a path where ff is the cost per unit length.

Vector line integral (work integral): CFdr=abF(r(t))r(t)dt\int_C \mathbf{F} \cdot d\mathbf{r} = \int_a^b \mathbf{F}(\mathbf{r}(t)) \cdot \mathbf{r}'(t)\,dt. The dot product picks out the component of F\mathbf{F} in the direction of motion. This computes the work done by the force field F\mathbf{F} on a particle moving along CC. Force components perpendicular to the path contribute zero work.

Fundamental Theorem for Line Integrals: if F=f\mathbf{F} = \nabla f (conservative), then Cfdr=f(end)f(start)\int_C \nabla f \cdot d\mathbf{r} = f(\text{end}) - f(\text{start}). The integral depends only on the endpoints, not the path. This is the multivariable analog of abF(x)dx=F(b)F(a)\int_a^b F'(x)\,dx = F(b) - F(a).

Corollary: for a conservative field, the line integral around any closed loop is zero (Cfdr=0\oint_C \nabla f \cdot d\mathbf{r} = 0). You end where you started, so the potential difference is zero.

Helpful?

Curl and divergence

Divergence measures how much a vector field 'spreads out' from a point: divF=F=Px+Qy+Rz\text{div}\,\mathbf{F} = \nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}.

Positive divergence: source (field flows outward). Negative: sink (field flows inward). Zero: incompressible flow.

Curl measures the 'rotation' or 'circulation' of a field: curlF=×F=RyQz,PzRx,QxPy\text{curl}\,\mathbf{F} = \nabla \times \mathbf{F} = \left\langle \frac{\partial R}{\partial y} - \frac{\partial Q}{\partial z},\, \frac{\partial P}{\partial z} - \frac{\partial R}{\partial x},\, \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} \right\rangle.

If curlF=0\text{curl}\,\mathbf{F} = \mathbf{0} everywhere, the field is irrotational (no swirling). For simply connected domains, irrotational implies conservative.

Physical examples: the curl of a fluid velocity field tells you how fast and around which axis a small paddle wheel would spin. The divergence tells you whether fluid is being created or destroyed at a point.

Helpful?

Green's, Stokes', and the Divergence Theorem

These three theorems are the pinnacle of vector calculus. Each relates an integral over a boundary to an integral over the region it encloses.

Green's Theorem (2D): CPdx+Qdy=D(QxPy)dA\oint_C P\,dx + Q\,dy = \iint_D \left(\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\right) dA. A line integral around a closed curve equals a double integral over the enclosed region.

Stokes' Theorem (3D surfaces): CFdr=S(×F)dS\oint_C \mathbf{F} \cdot d\mathbf{r} = \iint_S (\nabla \times \mathbf{F}) \cdot d\mathbf{S}. A line integral around the boundary of a surface equals the surface integral of the curl.

Divergence Theorem (3D volumes): SFdS=E(F)dV\oiint_S \mathbf{F} \cdot d\mathbf{S} = \iiint_E (\nabla \cdot \mathbf{F})\,dV. The flux through a closed surface equals the triple integral of the divergence inside.

Unified pattern: in every case, an integral over the boundary = an integral of a derivative over the interior. This is the same idea as the Fundamental Theorem of Calculus (abf(x)dx=f(b)f(a)\int_a^b f'(x)\,dx = f(b) - f(a)), generalized to higher dimensions.

Green's Theorem is the 2D special case of Stokes'. The Divergence Theorem is the 3D analog for flux instead of circulation.

Helpful?

Worked Practice Problems (5 examples)

Study these solved examples to understand the techniques. Then head to Practice to try problems on your own.

Practice on your own →
1

Problem 1

Find the magnitude of the vector v=3,4\vec{v} = \langle 3, 4 \rangle.

Step-by-Step Solution

1

v=32+42=9+16=25|\vec{v}| = \sqrt{3^2 + 4^2} = \sqrt{9+16} = \sqrt{25}.

Final Answer: 55

2

Problem 2

Compute the dot product 1,2,34,1,2\langle 1, 2, 3 \rangle \cdot \langle 4, -1, 2 \rangle.

Step-by-Step Solution

1

1(4)+2(1)+3(2)=42+6=81(4) + 2(-1) + 3(2) = 4 - 2 + 6 = 8.

Final Answer: 88

3

Problem 3

Find the cross product 1,0,0×0,1,0\langle 1, 0, 0 \rangle \times \langle 0, 1, 0 \rangle. Give your answer as a vector.

Step-by-Step Solution

1

Using the determinant formula, i(0001)j(1000)+k(1100)=0,0,1\vec{i}(0\cdot0 - 0\cdot1) - \vec{j}(1\cdot0 - 0\cdot0) + \vec{k}(1\cdot1 - 0\cdot0) = \langle 0, 0, 1 \rangle.

Final Answer: 0,0,1\langle 0, 0, 1 \rangle

4

Problem 4

Find x(x2y+3y)\frac{\partial}{\partial x}(x^2 y + 3y).

Step-by-Step Solution

1

Treat yy as constant. x(x2y)=2xy\frac{\partial}{\partial x}(x^2 y) = 2xy and x(3y)=0\frac{\partial}{\partial x}(3y) = 0.

Final Answer: 2xy2xy

5

Problem 5

Find y(x3+5xy2)\frac{\partial}{\partial y}(x^3 + 5xy^2).

Step-by-Step Solution

1

Treat xx as constant. y(x3)=0\frac{\partial}{\partial y}(x^3) = 0 and y(5xy2)=10xy\frac{\partial}{\partial y}(5xy^2) = 10xy.

Final Answer: 10xy10xy