← Back to College Math

Partial Derivatives

College Math · Calculus IIIPreview

1. Introduction

Single-variable calculus studies functions f(x)f(x) that depend on one input, and the derivative f(x)f'(x) captures their instantaneous rate of change. But the real world is rarely one-dimensional: the temperature in a room depends on three spatial coordinates, the profit of a company depends on dozens of decision variables, and the height of a mountain depends on two map coordinates. To analyze such functions we need a calculus of several variables.

A function of several variables, written f:RnRf:\mathbb{R}^n\to\mathbb{R}, takes a point (x1,,xn)(x_1,\dots,x_n) and returns a single number. The graph of z=f(x,y)z=f(x,y) is a surface floating above the xyxy-plane. The fundamental challenge is that at a single point a surface has infinitely many directions in which it can rise or fall — there is no single "slope." The resolution is the partial derivative: we freeze all variables but one and measure the rate of change in that single coordinate direction. From these building blocks we assemble the gradient, the directional derivative, the chain rule, tangent planes, implicit differentiation, and a complete theory of optimization for surfaces.

This article develops partial derivatives rigorously: precise limit definitions, differentiability versus mere existence of partials, Clairaut's theorem on mixed partials, the gradient as the direction of steepest ascent, the multivariable chain rule, linear approximation, the second-derivative (Hessian) test for classifying critical points, and Lagrange multipliers for constrained optimization. By the end you should be able to differentiate any reasonable multivariable function, optimize it, and understand why the machinery works.

The theory connects directly to applications in physics (gradient of potential energy gives force), economics (marginal utilities as partial derivatives), machine learning (gradient descent minimizes loss), and engineering (heat equation, fluid flow). Mastering partial derivatives is the gateway to the rest of multivariable calculus — multiple integrals, vector fields, and the theorems of Green, Stokes, and Gauss all build on the gradient and the chain rule developed here.

2. Core Concepts

2.1 The Partial Derivative: Definition

For f(x,y)f(x,y), the partial derivative with respect to xx at the point (a,b)(a,b) is the ordinary derivative of the single-variable function g(x)=f(x,b)g(x)=f(x,b) obtained by holding y=by=b fixed: fx(a,b)=fx(a,b)=limh0f(a+h,b)f(a,b)h.f_x(a,b) = \frac{\partial f}{\partial x}(a,b) = \lim_{h\to 0}\frac{f(a+h,\,b) - f(a,b)}{h}. Similarly, holding x=ax=a fixed, fy(a,b)=fy(a,b)=limh0f(a,b+h)f(a,b)h.f_y(a,b) = \frac{\partial f}{\partial y}(a,b) = \lim_{h\to 0}\frac{f(a,\,b+h) - f(a,b)}{h}. Geometrically, fx(a,b)f_x(a,b) is the slope of the curve formed by slicing the surface z=f(x,y)z=f(x,y) with the vertical plane y=by=b; it is the slope of the tangent line to that cross-section. The notations fxf_x, f/x\partial f/\partial x, xf\partial_x f, and DxfD_x f are all interchangeable.

The practical upshot is that we never compute these limits by hand: to find fxf_x we differentiate ff treating yy as a constant, using all the familiar single-variable rules (power, product, quotient, chain).

2.2 Higher-Order Partial Derivatives and Clairaut's Theorem

Because each partial is itself a function of (x,y)(x,y), we can differentiate again. The four second-order partials are fxx=2fx2,fyy=2fy2,fxy=2fyx,fyx=2fxy.f_{xx} = \frac{\partial^2 f}{\partial x^2}, \quad f_{yy} = \frac{\partial^2 f}{\partial y^2}, \quad f_{xy} = \frac{\partial^2 f}{\partial y\,\partial x}, \quad f_{yx} = \frac{\partial^2 f}{\partial x\,\partial y}. The "mixed" partials fxyf_{xy} and fyxf_{yx} differentiate once in each variable but in opposite orders. Remarkably, they almost always agree.

Clairaut's (Schwarz's) Theorem. If fxyf_{xy} and fyxf_{yx} are both continuous on an open set containing (a,b)(a,b), then fxy(a,b)=fyx(a,b).f_{xy}(a,b) = f_{yx}(a,b).

Proof sketch. Fix h,k0h,k\ne 0 small. The difference quotient Δ=f(a+h,b+k)f(a+h,b)f(a,b+k)+f(a,b)hk\Delta = \frac{f(a+h,b+k)-f(a+h,b)-f(a,b+k)+f(a,b)}{hk} can be computed by first differencing in xx then yy, or vice versa. As h,k0h,k\to 0, the first route converges to fxy(a,b)f_{xy}(a,b) and the second to fyx(a,b)f_{yx}(a,b). Continuity of the mixed partials forces the limits to agree.

This symmetry is what makes the Hessian matrix H=[fxxfxyfyxfyy]H=\begin{bmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy}\end{bmatrix} symmetric, a fact we exploit in the second-derivative test.

2.3 Differentiability and the Tangent Plane

A subtle point: the mere existence of fxf_x and fyf_y is weaker than differentiability. A function can have both partials at a point yet not even be continuous there (consider f(x,y)=xyx2+y2f(x,y)=\frac{xy}{x^2+y^2} with f(0,0)=0f(0,0)=0). We say ff is differentiable at (a,b)(a,b) if it admits a good linear approximation: f(a+Δx,b+Δy)=f(a,b)+fx(a,b)Δx+fy(a,b)Δy+ε1Δx+ε2Δy,f(a+\Delta x,\,b+\Delta y) = f(a,b) + f_x(a,b)\,\Delta x + f_y(a,b)\,\Delta y + \varepsilon_1\Delta x + \varepsilon_2\Delta y, where ε1,ε20\varepsilon_1,\varepsilon_2\to 0 as (Δx,Δy)(0,0)(\Delta x,\Delta y)\to(0,0). A clean sufficient condition: if fxf_x and fyf_y exist and are continuous near (a,b)(a,b), then ff is differentiable there (such ff is called C1C^1). Differentiable functions are automatically continuous.

When ff is differentiable, the surface has a genuine tangent plane at (a,b)(a,b): z=f(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).

The total differential packages the linear part: df=fxdx+fydydf = f_x\,dx + f_y\,dy. If xx and yy each have measurement error dxdx, dydy, then dfdf approximates the resulting error in ff — the foundation of error propagation in engineering.

2.4 The Gradient and Directional Derivatives

The partials assemble into a single vector, the gradient: f=fx,fy(or fx,fy,fz in three variables).\nabla f = \langle f_x, f_y \rangle \quad\text{(or } \langle f_x, f_y, f_z\rangle \text{ in three variables)}. The directional derivative of ff at a point in the direction of a unit vector u\mathbf{u} measures the rate of change as we move along u\mathbf{u}: Duf=fu,u=1.D_{\mathbf{u}} f = \nabla f \cdot \mathbf{u}, \qquad |\mathbf{u}| = 1.

Proof that the gradient gives steepest ascent. For fixed u=1|\mathbf{u}|=1, by Cauchy–Schwarz Duf=fufu=fD_{\mathbf{u}}f = \nabla f\cdot\mathbf{u} \le |\nabla f|\,|\mathbf{u}| = |\nabla f|, with equality iff u\mathbf{u} is parallel to f\nabla f. Thus the maximum rate of increase is f|\nabla f|, achieved when u=f/f\mathbf{u}=\nabla f/|\nabla f|.

Three geometric facts follow:

  • The gradient points in the direction of steepest ascent, with maximal rate f|\nabla f|.
  • The steepest descent is along f-\nabla f.
  • The directional derivative is zero when uf\mathbf{u}\perp\nabla f: the gradient is orthogonal to level curves f(x,y)=cf(x,y)=c (and to level surfaces in 3D).

2.5 The Multivariable Chain Rule

If z=f(x,y)z=f(x,y) where x=x(t)x=x(t) and y=y(t)y=y(t), then dzdt=fxdxdt+fydydt=fx(t),y(t).\frac{dz}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt} = \nabla f\cdot\langle x'(t), y'(t)\rangle. If instead xx and yy each depend on two variables s,ts,t, then for each independent variable we sum over every path: zs=fxxs+fyys,zt=fxxt+fyyt.\frac{\partial z}{\partial s} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial s}, \qquad \frac{\partial z}{\partial t} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial t} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial t}. A tree diagram — draw a branch for every dependency and multiply along branches, add across branches — keeps the bookkeeping straight.

2.6 Implicit Differentiation

When F(x,y,z)=0F(x,y,z)=0 defines zz implicitly as a function of xx and yy, differentiate both sides treating zz as a function of (x,y)(x,y): Fx+Fzzx=0zx=FxFz,zy=FyFz,F_x + F_z\frac{\partial z}{\partial x} = 0 \quad\Rightarrow\quad \frac{\partial z}{\partial x} = -\frac{F_x}{F_z}, \qquad \frac{\partial z}{\partial y} = -\frac{F_y}{F_z}, provided Fz0F_z\ne 0. The gradient F\nabla F is normal to the level surface F=cF=c, giving the tangent plane F(P)xx0,yy0,zz0=0\nabla F(P)\cdot\langle x-x_0,y-y_0,z-z_0\rangle=0.

2.7 Critical Points and the Second-Derivative Test

At an interior local maximum or minimum of a differentiable ff, the tangent plane must be horizontal, so f=0\nabla f=\mathbf{0}. Points where f=0\nabla f=\mathbf{0} (or where a partial fails to exist) are critical points. Not every critical point is an extremum — a saddle point rises in one direction and falls in another.

Second-Derivative (Hessian) Test. Let (a,b)(a,b) be a critical point of a C2C^2 function and define the discriminant D=fxxfyyfxy2=det[fxxfxyfxyfyy],D = f_{xx}f_{yy} - f_{xy}^2 = \det\begin{bmatrix} f_{xx} & f_{xy} \\ f_{xy} & f_{yy}\end{bmatrix}, evaluated at (a,b)(a,b). Then:

  • D>0D>0 and fxx>0f_{xx}>0 \Rightarrow local minimum;
  • D>0D>0 and fxx<0f_{xx}<0 \Rightarrow local maximum;
  • D<0D<0 \Rightarrow saddle point;
  • D=0D=0 \Rightarrow test is inconclusive (investigate by other means).

The discriminant DD is the determinant of the Hessian; its sign records whether the two eigenvalues (the principal curvatures) have the same or opposite signs.

2.8 Lagrange Multipliers

To optimize f(x,y)f(x,y) subject to g(x,y)=cg(x,y)=c, extrema occur where f\nabla f and g\nabla g are parallel: f=λg,g(x,y)=c.\nabla f = \lambda \nabla g, \qquad g(x,y)=c. The scalar λ\lambda is the Lagrange multiplier; it measures the rate of change of the optimal value with respect to the constraint level cc.

Continue reading with Premium

Upgrade to read the full article and unlock all Premium features.

Free

  • Unlimited practice — all difficulties
  • 3 hints / day
  • Community solutions
  • 2 timed mocks / month

Premium

  • Full article + all 57+ theory guides
  • Unlimited hints on practice problems
  • Unlimited timed mock exams & PDF worksheets
Log in