The Total Differential
For f=f(x,y):
df=∂x∂fdx+∂y∂fdy
This describes an exact differential: the differential of a function.
Definition
An expression P(x,y)dx+Q(x,y)dy is exact if there exists f(x,y) such that:
df=Pdx+Qdy
That is:
- ∂x∂f=P
- ∂y∂f=Q
Test for Exactness
A differential Pdx+Qdy is exact if and only if:
∂y∂P=∂x∂Q

Proof (if exact):
- If df=Pdx+Qdy, then P=fx and Q=fy
- Py=fxy and Qx=fyx
- By equality of mixed partials: Py=Qx
Finding the Potential Function
If Pdx+Qdy is exact, find f by integration:
Step 1: Integrate P with respect to x:
f(x,y)=∫P(x,y)dx+g(y)
where g(y) is an arbitrary function (the “constant” of integration).
Step 2: Differentiate with respect to y:
∂y∂f=∂y∂∫Pdx+g′(y)
Step 3: Set equal to Q and solve for g′(y):
Q(x,y)=∂y∂∫Pdx+g′(y)
Step 4: Integrate g′(y) to find g(y).
Example
Is (2xy+cosy)dx+(x2−xsiny)dy exact?
Check: Py=2x−siny, Qx=2x−siny. Yes, exact.
Find f:
Integrate P=2xy+cosy wrt x:
f=x2y+xcosy+g(y)
Differentiate:
fy=x2−xsiny+g′(y)
Set equal to Q=x2−xsiny:
x2−xsiny+g′(y)=x2−xsiny
So g′(y)=0, hence g(y)=C.
f(x,y)=x2y+xcosy+C
Integrating Factors
If Pdx+Qdy is not exact, sometimes we can find μ(x,y) such that:
μPdx+μQdy
is exact. Then μ is an integrating factor.
For the ODE Pdx+Qdy=0, we then solve:
d(μf)=0⇒μf=constant
Physical Interpretation
Thermodynamics: State functions (energy U, entropy S, etc.) have exact differentials.
- dU=TdS−PdV is exact (energy is a state function)
- Heat đQ and work đ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
| Property | Exact | Inexact |
|---|
| Definition | df for some f | Not df for any f |
| Test | ∂P/∂y=∂Q/∂x | ∂P/∂y=∂Q/∂x |
| Integral | ∫Pdx+Qdy path-independent | Path-dependent |
| Example in physics | State functions | Heat, work |
Why Exact Differentials Matter
- Identify when an ODE has a simple solution f(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.