6.6 Partial Derivatives, Total Derivative & Multivariable Optimisation

Key Takeaways

  • A partial derivative differentiates with respect to one variable while holding all others constant, whereas the total derivative accumulates the effect of every variable changing together.

  • For a continuous function with continuous second partials, the mixed partial derivatives are equal, which is the mathematical basis of the Maxwell relations in thermodynamics.

  • A function is homogeneous of degree n when scaling every variable by t scales the function by t^n, and Euler's theorem then relates the weighted partial derivatives to n times the function.

  • At a stationary point of a two-variable function, the discriminant rt - s^2 decides the nature: positive with r negative gives a maximum, positive with r positive gives a minimum, and negative gives a saddle point.

Last updated: August 2026

Partial Derivatives

When a quantity depends on several variables — the pressure of a gas on both temperature and volume, the cost of a machining operation on both cutting speed and feed — the rate of change with respect to one variable, holding the others fixed, is a partial derivative.

For z=f(x,y)z = f(x,y):

∂z∂x=lim⁡h→0f(x+h,y)−f(x,y)h\frac{\partial z}{\partial x} = \lim_{h\to0}\frac{f(x+h, y) - f(x,y)}{h}

In practice you differentiate normally, treating every other variable as a constant.

Example. For z=x3y2+4xyz = x^3y^2 + 4xy:

∂z∂x=3x2y2+4y,∂z∂y=2x3y+4x\frac{\partial z}{\partial x} = 3x^2y^2 + 4y, \qquad \frac{\partial z}{\partial y} = 2x^3y + 4x

Equality of mixed partials

If ff and its second partial derivatives are continuous, then

∂2z∂x∂y=∂2z∂y∂x\frac{\partial^2 z}{\partial x \partial y} = \frac{\partial^2 z}{\partial y \partial x}

This symmetry (Clairaut's or Schwarz's theorem) is not merely a curiosity: it is exactly the property exploited to derive the Maxwell relations in the Thermodynamics part of Paper-II, where the equality of mixed second derivatives of a property function generates relations among PP, vv, TT and ss.

The Total Derivative

A partial derivative isolates one variable; the total derivative accounts for all of them changing simultaneously. If z=f(x,y)z = f(x,y) and both xx and yy depend on a parameter tt, the chain rule gives

dzdt=∂z∂xdxdt+∂z∂ydydt\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}

and the total differential is

dz=∂z∂xdx+∂z∂ydydz = \frac{\partial z}{\partial x}dx + \frac{\partial z}{\partial y}dy

Small-error estimation

The total differential is the standard tool for propagating measurement error, which links directly to the Metrology topic in Section 4. If the volume of a cylinder is V=πr2hV = \pi r^2 h, then

dVV=2drr+dhh\frac{dV}{V} = 2\frac{dr}{r} + \frac{dh}{h}

A 1% error in radius therefore contributes 2% to the volume error, while a 1% error in height contributes only 1%. This is why bore diameter is gauged more tightly than length on a hydraulic cylinder.

Euler's Theorem on Homogeneous Functions

A function is homogeneous of degree nn if f(tx,ty)=tnf(x,y)f(tx, ty) = t^{n}f(x,y) for all tt. Euler's theorem then states

x∂f∂x+y∂f∂y=nfx\frac{\partial f}{\partial x} + y\frac{\partial f}{\partial y} = n f

To find the degree quickly, check the total power of each term: f=x3+x2y+y3f = x^3 + x^2y + y^3 is homogeneous of degree 3, so xfx+yfy=3fx f_x + y f_y = 3f without any differentiation at all.

Maxima and Minima of Two Variables

To optimise f(x,y)f(x,y), first find stationary points by solving both first-order conditions simultaneously:

∂f∂x=0and∂f∂y=0\frac{\partial f}{\partial x} = 0 \quad \text{and} \quad \frac{\partial f}{\partial y} = 0

Then classify using the second partial derivatives, conventionally written

r=∂2f∂x2,s=∂2f∂x∂y,t=∂2f∂y2r = \frac{\partial^2 f}{\partial x^2}, \qquad s = \frac{\partial^2 f}{\partial x \partial y}, \qquad t = \frac{\partial^2 f}{\partial y^2}

The discriminant is D=rt−s2D = rt - s^2:

ConditionNature of stationary point
D>0D > 0 and r<0r < 0Local maximum
D>0D > 0 and r>0r > 0Local minimum
D<0D < 0Saddle point
D=0D = 0Test fails; further investigation needed

A saddle point is a genuine physical possibility, not a mathematical oddity: it is a configuration that is a minimum along one direction and a maximum along a perpendicular one, exactly the behaviour of an unstable equilibrium in a linkage.

Worked example. Classify the stationary point of f(x,y)=x2+y2−4x−6y+20f(x,y) = x^2 + y^2 - 4x - 6y + 20.

Setting fx=2x−4=0f_x = 2x - 4 = 0 and fy=2y−6=0f_y = 2y - 6 = 0 gives the single stationary point (2,3)(2, 3). Here r=2r = 2, t=2t = 2, s=0s = 0, so D=4>0D = 4 > 0 with r>0r > 0: a local minimum, of value f(2,3)=4+9−8−18+20=7f(2,3) = 4 + 9 - 8 - 18 + 20 = 7.

Lagrange Multipliers

To optimise f(x,y,z)f(x,y,z) subject to a constraint g(x,y,z)=0g(x,y,z) = 0, form

F=f+λgF = f + \lambda g

and solve ∂F/∂x=∂F/∂y=∂F/∂z=0\partial F/\partial x = \partial F/\partial y = \partial F/\partial z = 0 together with the constraint itself. This is the standard method when a design is limited by a fixed volume, a fixed surface area, or a fixed material budget — for example, proportioning a pressure vessel of given capacity to minimise plate area.

Taylor Series in Two Variables

The expansion about (a,b)(a,b) up to second order is

f(x,y)≈f(a,b)+(x−a)fx+(y−b)fy+12[(x−a)2fxx+2(x−a)(y−b)fxy+(y−b)2fyy]f(x,y) \approx f(a,b) + (x-a)f_x + (y-b)f_y + \tfrac{1}{2}\left[(x-a)^2 f_{xx} + 2(x-a)(y-b)f_{xy} + (y-b)^2 f_{yy}\right]

with all partials evaluated at (a,b)(a,b). Retaining only the linear terms gives the tangent-plane approximation, and it is the second-order block in square brackets whose sign is precisely what the discriminant test examines.

Test Your Knowledge

For the function z = x^3 y^2 + 4xy, the partial derivative of z with respect to x is:

A

3x^2 y^2 + 4y

B

2x^3 y + 4x

C

3x^2 y^2 + 4x

D

x^3 y^2 + 4y

Test Your Knowledge

The volume of a cylinder is V = pi r^2 h. If the radius is measured with a 1% error and the height with a 1% error, the maximum percentage error in the calculated volume is approximately:

A

2%

B

3%

C

4%

D

1%

Test Your Knowledge

At a stationary point of f(x, y) the discriminant rt - s^2 is negative. The point is a:

A

Local maximum

B

Local minimum

C

Saddle point

D

Point of inflection along both axes

Test Your Knowledge

The function f(x, y) = x^3 + x^2 y + y^3 is homogeneous of degree:

A

One

B

It is not homogeneous

C

Two

D

Three

Sections you finish are checked off in the contents.