Skip to content
Part IA Michaelmas, Lent, Easter Term

Exact Differentials

The Total Differential

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

df=∂f∂xdx+∂f∂ydydf = \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=P dx+Q dydf = P\,dx + Q\,dy

That is:

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

Test for Exactness

A differential P dx+Q dyP\,dx + Q\,dy is exact if and only if:

∂P∂y=∂Q∂x\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=P dx+Q dydf = 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 P dx+Q dyP\,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:

∂f∂y=∂∂y∫P dx+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)=∂∂y∫P dx+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+cos⁡y) dx+(x2−xsin⁡y) dy(2xy + \cos y)\,dx + (x^2 - x\sin y)\,dy exact?

Check: Py=2x−sin⁡yP_y = 2x - \sin y, Qx=2x−sin⁡yQ_x = 2x - \sin y. Yes, exact.

Find ff:

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

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

Differentiate:

fy=x2−xsin⁡y+g′(y)f_y = x^2 - x\sin y + g'(y)

Set equal to Q=x2−xsin⁡yQ = x^2 - x\sin y:

x2−xsin⁡y+g′(y)=x2−xsin⁡yx^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+xcos⁡y+Cf(x, y) = x^2y + x\cos y + C


Integrating Factors

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

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

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

For the ODE P dx+Q dy=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=TdS−PdVdU = 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
Test∂P/∂y=∂Q/∂x\partial P/\partial y = \partial Q/\partial x∂P/∂y≠∂Q/∂x\partial P/\partial y \neq \partial Q/\partial x
Integral∫P dx+Q dy\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.