Skip to content
Part IA Michaelmas, Lent, Easter Term

Exact Differentials

The Total Differential

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

df=fxdx+fydydf = \frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y}dy

This describes an exact differential: the differential of a function.


Definition

An expression P(x,y)dx+Q(x,y)dyP(x,y)dx + Q(x,y)dy is exact if there exists f(x,y)f(x,y) such that:

df=Pdx+Qdydf = P\,dx + Q\,dy

That is:

  • fx=P\frac{\partial f}{\partial x} = P
  • fy=Q\frac{\partial f}{\partial y} = Q

Test for Exactness

A differential Pdx+QdyP\,dx + Q\,dy is exact if and only if:

Py=Qx\frac{\partial P}{\partial y} = \frac{\partial Q}{\partial x}

Exact differential showing level curves of potential function f where df = P dx + Q dy

Proof (if exact):

  • If df=Pdx+Qdydf = P\,dx + Q\,dy, then P=fxP = f_x and Q=fyQ = f_y
  • Py=fxyP_y = f_{xy} and Qx=fyxQ_x = f_{yx}
  • By equality of mixed partials: Py=QxP_y = Q_x

Finding the Potential Function

If Pdx+QdyP\,dx + Q\,dy is exact, find ff by integration:

Step 1: Integrate PP with respect to xx:

f(x,y)=P(x,y)dx+g(y)f(x, y) = \int P(x, y)\,dx + g(y)

where g(y)g(y) is an arbitrary function (the “constant” of integration).

Step 2: Differentiate with respect to yy:

fy=yPdx+g(y)\frac{\partial f}{\partial y} = \frac{\partial}{\partial y}\int P\,dx + g'(y)

Step 3: Set equal to QQ and solve for g(y)g'(y):

Q(x,y)=yPdx+g(y)Q(x, y) = \frac{\partial}{\partial y}\int P\,dx + g'(y)

Step 4: Integrate g(y)g'(y) to find g(y)g(y).


Example

Is (2xy+cosy)dx+(x2xsiny)dy(2xy + \cos y)\,dx + (x^2 - x\sin y)\,dy exact?

Check: Py=2xsinyP_y = 2x - \sin y, Qx=2xsinyQ_x = 2x - \sin y. Yes, exact.

Find ff:

Integrate P=2xy+cosyP = 2xy + \cos y wrt xx:

f=x2y+xcosy+g(y)f = x^2y + x\cos y + g(y)

Differentiate:

fy=x2xsiny+g(y)f_y = x^2 - x\sin y + g'(y)

Set equal to Q=x2xsinyQ = x^2 - x\sin y:

x2xsiny+g(y)=x2xsinyx^2 - x\sin y + g'(y) = x^2 - x\sin y

So g(y)=0g'(y) = 0, hence g(y)=Cg(y) = C.

f(x,y)=x2y+xcosy+Cf(x, y) = x^2y + x\cos y + C


Integrating Factors

If Pdx+QdyP\,dx + Q\,dy is not exact, sometimes we can find μ(x,y)\mu(x, y) such that:

μPdx+μQdy\mu P\,dx + \mu Q\,dy

is exact. Then μ\mu is an integrating factor.

For the ODE Pdx+Qdy=0P\,dx + Q\,dy = 0, we then solve:

d(μf)=0μf=constantd(\mu f) = 0 \Rightarrow \mu f = \text{constant}


Physical Interpretation

Thermodynamics: State functions (energy UU, entropy SS, etc.) have exact differentials.

  • dU=TdSPdVdU = TdS - PdV is exact (energy is a state function)
  • Heat đQđQ and work đWđW are not exact (path-dependent)

The notation đđ indicates inexact differentials.

State functions: The change depends only on initial and final states, not the path.


Exact vs Inexact: Summary

PropertyExactInexact
Definitiondfdf for some ffNot dfdf for any ff
TestP/y=Q/x\partial P/\partial y = \partial Q/\partial xP/yQ/x\partial P/\partial y \neq \partial Q/\partial x
IntegralPdx+Qdy\int P\,dx + Q\,dy path-independentPath-dependent
Example in physicsState functionsHeat, work

Why Exact Differentials Matter

  • Identify when an ODE has a simple solution f(x,y)=Cf(x,y) = C
  • Connect to conservative fields in vector calculus
  • Fundamental to thermodynamics (state vs path functions)

The exactness test quickly distinguishes solvable cases from ones needing integrating factors.