Skip to main content

Partial Derivatives

Ordinary calculus asks how a quantity changes when one input changes. But almost nothing in the real world depends on just one thing. The temperature in a room depends on where you stand — on xx, yy, and zz. The profit of a company depends on price and quantity and cost. The height of a hillside depends on your east-west position and your north-south position at once. A partial derivative is the tool that lets us ask a precise question about such functions: "If I nudge this one variable and hold everything else perfectly still, how fast does the output respond?"

That single idea — freeze all but one variable, then differentiate normally — unlocks the entire landscape of multivariable calculus: gradients that point uphill, tangent planes that hug a surface, and the machinery for finding the highest peak or lowest valley of a function of many variables. If you can differentiate f(x)=x2f(x) = x^2, you already know 90% of the mechanics. The new part is learning to think about several directions of change simultaneously.

Learning Objectives

  • Compute partial derivatives by treating all but one variable as constant.
  • Interpret a partial derivative geometrically as a slope of a slice through a surface.
  • Assemble partial derivatives into the gradient vector and understand what it tells you about direction and rate of steepest change.
  • Write the equation of a tangent plane to a surface.
  • Find and classify critical points of a two-variable function using the second-derivative (Hessian) test.
  • Recognize where partial derivatives appear in physics, economics, and machine learning.

Quick Answer

A partial derivative measures the rate of change of a multivariable function with respect to one variable while all other variables are held constant. For f(x,y)f(x, y) we write fx\frac{\partial f}{\partial x} (or fxf_x) for the xx-partial and fy\frac{\partial f}{\partial y} (or fyf_y) for the yy-partial. You compute each one using ordinary differentiation rules, simply pretending the other variables are fixed numbers. Collecting all first partials into a vector gives the gradient f=fx,fy\nabla f = \langle f_x, f_y \rangle, which points in the direction of steepest increase and whose length is the maximum rate of increase. Partial derivatives also build the tangent plane to a surface and drive optimization: at a smooth maximum or minimum, every first partial is zero.

Where It Came From

Partial derivatives were forced into existence by physics, not by mathematical curiosity. In the eighteenth century, thinkers like Leonhard Euler, Jean le Rond d'Alembert, and Daniel Bernoulli were wrestling with problems that ordinary calculus could not touch: the shape of a vibrating violin string, the flow of heat through a solid, the motion of fluids. A vibrating string's displacement depends on both position along the string and time — you need to talk about how it changes in space separately from how it changes in time. D'Alembert's 1747 wave equation, 2ut2=c22ux2\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}, is essentially the birth certificate of the partial derivative, even though the crisp \partial notation came later.

The \partial symbol itself — a stylized cursive "d" — was popularized by the French mathematician Adrien-Marie Legendre in the 1780s and cemented by Carl Gustav Jacob Jacobi in the 1840s, precisely so nobody would confuse "the rate of change holding other variables fixed" with an ordinary total derivative.

The real explosion of need came from two nineteenth-century fields. Thermodynamics describes a gas by quantities like pressure, volume, and temperature that are all interlinked; to say "how does energy change if I raise the temperature but keep the volume fixed?" you must have partial derivatives — the entire subject is written in them, and the notation (UT)V\left(\frac{\partial U}{\partial T}\right)_V (the subscript naming what is held constant) is standard to this day. Field theory — electromagnetism as unified by James Clerk Maxwell in the 1860s, and later gravitation — describes quantities spread through all of space and time. Maxwell's equations are statements about partial derivatives of the electric and magnetic fields. Without partial derivatives there is no wave equation, no heat equation, no Maxwell's equations, and no modern physics. The concept exists because the universe rarely varies one input at a time.

Computing Partials: Freeze Everything Else

The mechanical rule is disarmingly simple. To find fx\frac{\partial f}{\partial x}, treat every variable except xx as if it were a constant number, then differentiate with respect to xx using all your usual rules (power, product, quotient, chain).

Worked example. Let

f(x,y)=3x2y+5xy3. f(x, y) = 3x^2 y + 5x - y^3.

To get fxf_x, hold yy constant. The term 3x2y 3x^2 y becomes 6xy 6xy (the yy rides along as a constant coefficient); 5x 5x becomes 5 5; and y3-y^3 is a pure constant, so it dies:

fx=6xy+5. f_x = 6xy + 5.

To get fyf_y, hold xx constant. Now 3x2y 3x^2 y becomes 3x2 3x^2 (the yy differentiates to 1 1); 5x 5x is constant, so it vanishes; and y3-y^3 becomes 3y2-3y^2:

fy=3x23y2. f_y = 3x^2 - 3y^2.

Evaluate at the point (2,1)(2, 1): fx(2,1)=6(2)(1)+5=17f_x(2,1) = 6(2)(1) + 5 = 17, and fy(2,1)=3(4)3(1)=9f_y(2,1) = 3(4) - 3(1) = 9. This says that near (2,1)(2,1), moving in the +x+x direction increases ff about 17 units per unit step, while moving in +y+y increases it about 9 units per unit step.

Geometric meaning. Picture the surface z=f(x,y)z = f(x, y) floating above the xyxy-plane. Slicing it with the vertical plane y=1y = 1 produces a curve; fx(2,1)=17f_x(2,1) = 17 is the ordinary slope of that curve at x=2x = 2. Each partial derivative is the slope of a slice taken parallel to one axis.

Higher-order partials. You can differentiate again. From fx=6xy+5f_x = 6xy + 5 we get fxx=6yf_{xx} = 6y and fxy=6xf_{xy} = 6x; from fy=3x23y2f_y = 3x^2 - 3y^2 we get fyy=6yf_{yy} = -6y and fyx=6xf_{yx} = 6x. Notice fxy=fyxf_{xy} = f_{yx}. This is Clairaut's theorem: for functions with continuous second partials, the order of differentiation doesn't matter.

The Gradient: Packaging the Partials

Individually, partials tell you about the axis directions. Bundled together, they tell you about every direction. The gradient of f(x,y)f(x, y) is the vector

f=fx,fy. \nabla f = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right\rangle.

Two facts make the gradient one of the most useful objects in all of applied math:

  1. The gradient points in the direction of steepest ascent. If you stand on a hill described by z=f(x,y)z = f(x,y) and want to climb fastest, walk in the direction of f\nabla f.
  2. Its magnitude f\lVert \nabla f \rVert is the maximum rate of increase at that point.

Worked example. For f(x,y)=x2+y2f(x, y) = x^2 + y^2 (a bowl), the gradient is f=2x,2y\nabla f = \langle 2x, 2y \rangle. At the point (3,4)(3, 4), f=6,8\nabla f = \langle 6, 8 \rangle. This points directly away from the origin — exactly the "uphill" direction on a bowl — and its magnitude is 62+82=36+64=100=10\sqrt{6^2 + 8^2} = \sqrt{36 + 64} = \sqrt{100} = 10. So the steepest possible slope at (3,4)(3,4) is 10, achieved by heading straight outward.

The gradient also underlies the directional derivative: the rate of change in an arbitrary unit direction u\mathbf{u} is Duf=fuD_\mathbf{u} f = \nabla f \cdot \mathbf{u}. Because the dot product is largest when the two vectors align, the maximum occurs exactly along f\nabla f — a clean proof of fact 1 above.

Tangent Planes: The Best Flat Approximation

In single-variable calculus, the tangent line is the best straight-line approximation to a curve. In two variables, the analog is the tangent plane — the flat sheet that best hugs a surface at a point. For z=f(x,y)z = f(x, y), the tangent plane at (a,b)(a, b) is

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).

Each partial supplies the tilt of the plane in one axis direction.

Worked example. Find the tangent plane to f(x,y)=x2+y2f(x, y) = x^2 + y^2 at (1,2)(1, 2). First, f(1,2)=1+4=5f(1,2) = 1 + 4 = 5. The partials are fx=2xf_x = 2x and fy=2yf_y = 2y, so fx(1,2)=2f_x(1,2) = 2 and fy(1,2)=4f_y(1,2) = 4. The tangent plane is

z=5+2(x1)+4(y2), z = 5 + 2(x - 1) + 4(y - 2),

which simplifies to z=2x+4y5z = 2x + 4y - 5. You can sanity-check: at (1,2)(1,2) this gives z=2+85=5z = 2 + 8 - 5 = 5, matching the surface exactly, as a tangent plane must.

This linear approximation is the foundation of linearization and of the total differential df=fxdx+fydydf = f_x\,dx + f_y\,dy, which estimates how much ff changes when xx and yy each change a little — the everyday workhorse of error analysis in the sciences.

Optimization: Finding Peaks and Valleys

At a smooth maximum or minimum of f(x,y)f(x, y), the surface is momentarily level in every direction, so both partials vanish. A point where fx=0f_x = 0 and fy=0f_y = 0 is a critical point. But not every critical point is an extremum — some are saddle points, high in one direction and low in another (think of a mountain pass). To classify them, use the second-derivative test with the discriminant

D=fxxfyy(fxy)2. D = f_{xx}\,f_{yy} - (f_{xy})^2.

  • If D>0 D > 0 and fxx>0f_{xx} > 0: local minimum.
  • If D>0 D > 0 and fxx<0f_{xx} < 0: local maximum.
  • If D<0 D < 0: saddle point.
  • If D=0 D = 0: test is inconclusive.

Worked example. Classify the critical points of f(x,y)=x2+y24x6y+13f(x, y) = x^2 + y^2 - 4x - 6y + 13. The partials are fx=2x4f_x = 2x - 4 and fy=2y6f_y = 2y - 6. Setting both to zero gives x=2x = 2 and y=3y = 3, so the only critical point is (2,3)(2, 3). The second partials are fxx=2f_{xx} = 2, fyy=2f_{yy} = 2, fxy=0f_{xy} = 0, so

D=(2)(2)02=4>0, D = (2)(2) - 0^2 = 4 > 0,

and since fxx=2>0f_{xx} = 2 > 0, the point (2,3)(2,3) is a local minimum. Plugging in, f(2,3)=4+9818+13=0f(2,3) = 4 + 9 - 8 - 18 + 13 = 0, so the lowest value of this bowl is 0 0 at (2,3)(2,3).

Saddle example. For g(x,y)=x2y2g(x,y) = x^2 - y^2, the only critical point is (0,0)(0,0), with gxx=2g_{xx} = 2, gyy=2g_{yy} = -2, gxy=0g_{xy} = 0, giving D=(2)(2)0=4<0 D = (2)(-2) - 0 = -4 < 0 — a saddle point, exactly the Pringle-chip shape you'd expect.

Real-World Applications

  • Thermodynamics. Heat capacity at constant volume is literally a partial derivative, CV=(UT)VC_V = \left(\frac{\partial U}{\partial T}\right)_V. Every Maxwell relation in thermodynamics equates two mixed partials.
  • Machine learning. Training a neural network is optimization in millions of dimensions. Gradient descent repeatedly steps in the direction of f-\nabla f (downhill on the loss surface); "backpropagation" is just the chain rule for partial derivatives applied efficiently.
  • Economics. The marginal utility of a good and the marginal rate of substitution between two goods are ratios of partial derivatives of a utility function. Firms find profit-maximizing output by setting partials to zero.
  • Physics and engineering. Maxwell's equations, the heat equation, fluid flow (Navier–Stokes), and the Schrödinger equation are all partial differential equations built from partial derivatives of fields.
  • Image processing. An image is a function of pixel coordinates; the gradient's magnitude highlights edges, which is how edge-detection filters like Sobel work.

Common Mistakes

Mistake 1: Differentiating the "frozen" variables anyway. A student computing fxf_x for f=3x2yf = 3x^2 y writes 6xy+3x2 6xy + 3x^2, accidentally differentiating yy too. Why it's wrong: when taking /x\partial/\partial x, yy is a constant multiplier, not a variable. Correction: fx=6xyf_x = 6xy only; treat yy exactly like the number 7.

Mistake 2: Forgetting that constant terms in the other variable survive as constants but their derivatives don't. For f=5xy3f = 5x - y^3, some write fx=53y2f_x = 5 - 3y^2. Why it's wrong: y3-y^3 has no xx in it, so its xx-partial is 0 0, not 3y2-3y^2. Correction: fx=5f_x = 5. The 3y2-3y^2 term belongs to fyf_y, not fxf_x.

Mistake 3: Assuming every critical point is a max or min. Setting f=0\nabla f = \mathbf{0} and stopping there. Why it's wrong: saddle points also have zero gradient, so you can mislabel a pass as a peak. Correction: always run the second-derivative test; a negative discriminant D<0 D < 0 means saddle, not extremum.

Mistake 4 (bonus): Confusing the gradient's direction with the surface's slope. Students think f\nabla f points "along" the surface. Correction: f\nabla f lives in the input plane (the xyxy-plane) and points toward increasing ff; it is perpendicular to the level curves of ff.

Comparison and Connections

ConceptFunction typeWhat it measuresNotation
Ordinary derivativeone variable f(x)f(x)slope of a curvedfdx\frac{df}{dx}, ff'
Partial derivativemany variables, one at a timeslope of an axis-parallel slicefx\frac{\partial f}{\partial x}, fxf_x
Gradientmany variables, all at oncedirection and rate of steepest ascentf\nabla f
Directional derivativemany variables, chosen directionrate of change along a unit vectorDuf=fuD_\mathbf{u} f = \nabla f \cdot \mathbf{u}
Total differentialmany variables, small changesnet change from all inputs shiftingdf=fxdx+fydydf = f_x\,dx + f_y\,dy

The partial derivative is the building block; the gradient bundles the partials into a vector; the directional derivative projects that vector onto any direction; and the total differential uses them to approximate change. Partial derivatives are also the ingredients of partial differential equations, which describe how fields evolve in space and time.

Practice Questions

Recall

State in one sentence what it means to compute fy\frac{\partial f}{\partial y}.

Answer: It means to differentiate ff with respect to yy while treating every other variable (such as xx) as a constant.

Understanding

For f(x,y)=x3y2f(x, y) = x^3 y^2, compute fxf_x and fyf_y.

Answer: Holding yy constant, fx=3x2y2f_x = 3x^2 y^2. Holding xx constant, fy=2x3yf_y = 2x^3 y.

Application

Find the gradient of f(x,y)=x2+3xy+y2f(x, y) = x^2 + 3xy + y^2 at the point (1,2)(1, 2), and state the maximum rate of increase there.

Guidance: fx=2x+3yf_x = 2x + 3y and fy=3x+2yf_y = 3x + 2y. At (1,2)(1,2): fx=2+6=8f_x = 2 + 6 = 8, fy=3+4=7f_y = 3 + 4 = 7, so f=8,7\nabla f = \langle 8, 7 \rangle. The maximum rate of increase is f=64+49=11310.63\lVert \nabla f \rVert = \sqrt{64 + 49} = \sqrt{113} \approx 10.63.

Analysis

Classify the critical point(s) of f(x,y)=x24xy+y2f(x, y) = x^2 - 4xy + y^2.

Guidance: fx=2x4yf_x = 2x - 4y and fy=4x+2yf_y = -4x + 2y. Setting both to zero: from the first, x=2yx = 2y; substituting into the second, 8y+2y=6y=0-8y + 2y = -6y = 0, so y=0y = 0 and x=0x = 0. The only critical point is (0,0)(0,0). Second partials: fxx=2f_{xx} = 2, fyy=2f_{yy} = 2, fxy=4f_{xy} = -4, so D=(2)(2)(4)2=416=12<0 D = (2)(2) - (-4)^2 = 4 - 16 = -12 < 0. It is a saddle point.

FAQ

Why is the symbol \partial different from dd? The rounded \partial signals "hold the other variables constant." A total derivative ddt\frac{d}{dt} accounts for all the ways a quantity can change, including through its dependence on other changing variables; the partial deliberately ignores those. Using distinct symbols prevents catastrophic confusion, especially in physics.

Do partial derivatives obey the product and chain rules? Yes. When you take a partial, you're doing ordinary single-variable differentiation with the other variables frozen, so all the familiar rules apply. There is also a multivariable chain rule for when the inputs themselves depend on other variables — a common next topic.

Is fxyf_{xy} always equal to fyxf_{yx}? For essentially every function you'll meet in a course — those with continuous second partial derivatives — yes, by Clairaut's theorem. Pathological counterexamples exist, but they require deliberately constructed functions that are not continuously twice-differentiable at a point.

How is the gradient related to gradient descent in machine learning? Gradient descent minimizes a loss function by repeatedly stepping in the direction of f-\nabla f, the direction of steepest decrease. Each partial derivative tells the algorithm how to nudge one parameter to reduce error; there can be millions of them, but the principle is identical to the two-variable case.

What's the difference between a saddle point and an extremum if both have zero gradient? At an extremum the surface curves the same way in every direction (all up for a minimum, all down for a maximum). At a saddle it curves up in one direction and down in another, so it's neither. The second-derivative test's discriminant D D detects this difference: D>0 D > 0 for extrema, D<0 D < 0 for saddles.

Can I have partial derivatives with three or more variables? Absolutely. For f(x,y,z)f(x, y, z) you compute fxf_x, fyf_y, and fzf_z, each time freezing the other two. The gradient becomes f=fx,fy,fz\nabla f = \langle f_x, f_y, f_z \rangle, and everything generalizes. This is exactly the setting of field theory and thermodynamics.

Quick Revision

  • Partial derivative: differentiate with respect to one variable, hold the rest constant. Notation fx\frac{\partial f}{\partial x} or fxf_x.
  • Geometric meaning: slope of the slice of the surface parallel to one axis.
  • Gradient: f=fx,fy\nabla f = \langle f_x, f_y \rangle; points uphill (steepest ascent); f\lVert \nabla f \rVert = max rate of increase.
  • Directional derivative: Duf=fuD_\mathbf{u} f = \nabla f \cdot \mathbf{u} for a unit vector u\mathbf{u}.
  • Tangent plane: 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).
  • Critical points: where fx=0f_x = 0 and fy=0f_y = 0.
  • Second-derivative test: D=fxxfyy(fxy)2 D = f_{xx}f_{yy} - (f_{xy})^2. D>0 D>0, fxx>0f_{xx}>0 → min; D>0 D>0, fxx<0f_{xx}<0 → max; D<0 D<0 → saddle; D=0 D=0 → inconclusive.
  • Clairaut: fxy=fyxf_{xy} = f_{yx} when second partials are continuous.

Prerequisites

  • Derivatives — the single-variable foundation, including the power, product, quotient, and chain rules that all carry over here; partials are just ordinary derivatives with other variables frozen.
  • The gradient, directional derivatives, and multivariable chain rule extend the ideas here (see the Calculus overview).
  • Linear Algebra — vectors and the dot product power the gradient and directional derivatives.

Next Topics

  • Multiple Integrals — integration over multivariable regions, the counterpart to partial differentiation.
  • Differential Equations — partial derivatives are the language of partial differential equations that describe heat, waves, and fields.