What Are We Actually Doing?
An exact differential equation is secretly a disguised surface. The equation isn't really asking you to "solve" anything in the traditional sense — it's asking you to recover a hidden function that someone differentiated and then forgot about.
The cleanest way to understand this is to run the movie forwards and backwards. First build the equation yourself from a function you know. Then pretend you never knew it — and recover it from scratch. When you get the same answer, the whole structure clicks.
The one-sentence version: someone took a surface \(f(x,y)\), measured its slopes in both directions, and handed you those slopes as a differential equation. Your job is to reconstruct the original surface from just those two slope measurements.
Start with a Known Surface
Pick a function with interesting structure in both variables. Something that won't flatten out to a constant when you take a partial derivative:
Picture this as a 3D terrain — a hillside. At every point \((x,y)\) on the ground, the height of the hill is \(f(x,y)\). Some places are steep, some are flat, some curve in different directions depending on where you're standing.
The two partial derivatives will tell us the slope of this terrain — how steeply it tilts east-west, and how steeply it tilts north-south. Those are \(M\) and \(N\).
Read the Slopes: Take the Partial Derivatives
A partial derivative measures the slope in one direction while everything else is frozen. Think of slicing the hillside with a vertical plane — the slope of that slice is the partial derivative in that direction.
East-West slope — partial with respect to \(x\)
Freeze \(y\). Treat it like a plain number. Differentiate only the \(x\) parts:
\(x^2 y\): \(y\) is a frozen constant, so this is just \(y \cdot x^2\). Power rule gives \(y \cdot 2x = 2xy\).
\(y^3\): no \(x\) anywhere in this term. Its \(x\)-derivative is zero.
North-South slope — partial with respect to \(y\)
Now freeze \(x\). Differentiate only the \(y\) parts:
\(x^2 y\): \(x^2\) is frozen, so this is \(x^2 \cdot y\). Derivative of \(y\) is \(1\). Result: \(x^2\).
\(y^3\): standard power rule. Gives \(3y^2\).
What \(M\) and \(N\) mean physically: \(M = 2xy\) is the east-west tilt at every point on the hill. \(N = x^2 + 3y^2\) is the north-south tilt. Together they form the gradient \(\nabla f = \langle M, N \rangle\), which points uphill — always perpendicular to the level curves you saw in the canvas above.
Assemble the Differential Equation
The total differential of \(f\) adds both tilts together, accounting for motion in both directions at once:
Plug in our \(M\) and \(N\):
Now set \(df = 0\). This means: only allow movement that keeps \(f\) constant. You're walking the terrain without going uphill or downhill — staying on a contour line.
What \(df = 0\) means: you're constrained to move along the surface where the height never changes. That constraint — \(f(x,y) = C\) for some constant \(C\) — is the solution. There's a whole family of them, one for each starting height. We just built the equation from the terrain itself.
The Exactness Test: Do These Slopes Come From the Same Hill?
Before you try to reconstruct \(f\), you need to verify that \(M\) and \(N\) are actually consistent — that they genuinely came from the same potential function. If someone handed you random slopes that don't match up, no single hill can produce them.
The test is: compute the mixed second partial both ways and check if they agree.
Why? Because if \(M = f_x\), then \(\frac{\partial M}{\partial y} = f_{xy}\). And if \(N = f_y\), then \(\frac{\partial N}{\partial x} = f_{yx}\). For any smooth function, \(f_{xy} = f_{yx}\) (Clairaut's theorem — order of differentiation doesn't matter). So both sides must be equal if \(M\) and \(N\) really did come from the same \(f\).
Differentiate \(M = 2xy\) with respect to \(y\):
\[\frac{\partial M}{\partial y} = 2x\]Differentiate \(N = x^2 + 3y^2\) with respect to \(x\):
\[\frac{\partial N}{\partial x} = 2x\]\(\dfrac{\partial M}{\partial y} = 2x = \dfrac{\partial N}{\partial x}\) ✓
The mixed partials match. The slopes are consistent — a single surface \(f\) generated both. We're clear to reconstruct it.
Why the Integration Constant Becomes \(h(y)\)
This is the part that trips people up the most. When we integrate \(M\) with respect to \(x\), we're doing a partial reconstruction of \(f\). But partial integration has a blind spot.
Normal integration gives you \(+C\) as a constant. But partial integration — where you're only integrating in one variable — has a bigger blind spot: any function that depends only on the other variable is completely invisible.
That zero means: when you took \(\partial f / \partial x\) to get \(M\), any pure-\(y\) structure in \(f\) got wiped out completely. It was erased before it even reached you. So when you reverse that step — integrate \(M\) in \(x\) — you have to acknowledge the erased piece:
The \(h(y)\) is a placeholder for everything that was invisible during the \(x\)-integration.
A plain constant \(C\) is a single number. But the missing piece could be any function of \(y\) — like \(y^3\) or \(\sin(y)\) or \(5y^2 - 7\). Those are all invisible to \(\partial/\partial x\).
Because we already accounted for all the \(x\)-dependence when we integrated \(M\). Adding new \(x\)-structure would contradict the equation we're solving. The missing piece can only be a function of \(y\).
The mental model: integrating \(M\) in \(x\) reconstructs the east-west slope story. But the hill also has a north-south story that's completely missing from \(M\). The \(h(y)\) is the placeholder for that missing north-south structure. Then you use \(N\) to figure out exactly what that missing piece must be.
"Integrate one partial → get a draft of the surface. Use the other partial → fill in what was invisible."
Reconstruct \(f(x,y)\) From Scratch
Now pretend you've never seen \(f\). You're handed:
You've confirmed it's exact. Reconstruct \(f\) step by step.
Name your pieces.
\[M = 2xy, \qquad N = x^2 + 3y^2\]Integrate \(M\) in \(x\) — build the first draft of \(f\).
Since \(f_x = M\), integrate with respect to \(x\) (hold \(y\) constant):
\[f = \int 2xy\,dx = y \int 2x\,dx = y \cdot x^2 = x^2 y\]Don't forget the invisible piece — add \(h(y)\) to account for whatever pure-\(y\) structure was erased:
\[f(x,y) = x^2 y + h(y)\]Differentiate the draft with respect to \(y\).
We'll use the second condition \(f_y = N\) to find \(h(y)\). First, take \(\partial/\partial y\) of what we have:
\[\frac{\partial f}{\partial y} = \frac{\partial}{\partial y}\bigl(x^2 y + h(y)\bigr) = x^2 + h'(y)\]Match to \(N\) and solve for \(h'(y)\).
Set equal to \(N\):
\[x^2 + h'(y) = x^2 + 3y^2\]The \(x^2\) terms cancel. This is not a coincidence — the exactness test guarantees the \(x\)-terms cancel here. If they didn't cancel, the equation wasn't exact and no single \(f\) exists. Subtract:
\[h'(y) = 3y^2\]Integrate to recover \(h(y)\).
\[h(y) = \int 3y^2\,dy = y^3\]No \(+C\) needed here — it gets absorbed into the solution's constant \(C\) at the end.
Assemble the complete solution.
\[f(x,y) = x^2 y + y^3 = C\]Started with \(f = x^2 y + y^3\). Recovered \(f = x^2 y + y^3\). Exactly.
What Actually Happened — The Full Map
Every step in both directions has a clear geometric meaning. Here's the whole story at once:
| Pass | Operation | What it means |
|---|---|---|
| Forward ① | \(f \xrightarrow{\partial/\partial x} M\) | Measure the east-west slope of the terrain |
| Forward ② | \(f \xrightarrow{\partial/\partial y} N\) | Measure the north-south slope of the terrain |
| Forward ③ | \(M\,dx + N\,dy = 0\) | Constrain movement to constant-height contours |
| Backward ① | \(\int M\,dx = x^2y + h(y)\) | Partially rebuild terrain — east-west story only |
| Backward ② | \(f_y = N \Rightarrow h'(y) = 3y^2\) | Use north-south slopes to fill in what was missing |
| Backward ③ | \(f(x,y) = C\) | Full terrain recovered — solution is its level curves |
The two-step reconstruction logic: \(M\) tells you the east-west tilt. Integrating it gives you a draft of the surface — but the north-south story is missing. \(N\) tells you the north-south tilt. You differentiate your draft in \(y\) and force it to match \(N\). That match pins down exactly what was missing. The whole reconstruction works because both slopes came from the same hill — and the exactness test proves that before you start.
The Hiking Analogy That Makes \(h(y)\) Obvious
Imagine you're mapping a mountain blindfolded. A friend tells you the slope at every point going east-west. You integrate those slopes as you walk east — and you get a picture of the terrain.
But here's the thing: your east-west walk never told you anything about elevation changes going north-south. You could be on a ridge that runs perfectly east-west — your data would look the same whether the ridge is 100m high or 1000m high. That's the \(h(y)\) problem.
You reconstruct the terrain from the east-west slopes. You get \(x^2 y\) — the \(x\)-story is complete.
But anything that varies only in the north-south direction is invisible to this walk.
You now walk north-south and check slopes. You differentiate your draft in \(y\) and compare to \(N\).
The difference tells you exactly what north-south structure was missing: \(h'(y) = 3y^2 \Rightarrow h = y^3\).
Both slopes agree on the same hill. That's the whole game. The exactness test confirms the slopes are compatible — they came from one surface. The reconstruction uses one slope to build a draft, then the other slope to patch the draft. When you're done, both slopes are satisfied simultaneously by the recovered \(f\).
"We integrate one partial to get a draft. We use the other partial to find what was invisible. The exactness condition guarantees those two pieces fit together."
Why the \(x^2\) Cancels — The Consistency Payoff
In Step 4.4, when you set \(f_y = N\), the \(x^2\) terms cancel perfectly. Students often feel like this is lucky. It's not — it's the exactness condition paying its dividend.
Here's why it must happen. You integrated \(M\) in \(x\) to get the draft \(f = x^2 y + h(y)\). When you differentiate that draft in \(y\), you get:
The \(x^2\) came from differentiating the part you already reconstructed. Now you set this equal to \(N = x^2 + 3y^2\). The \(x^2\) on both sides represents the same thing — the part of \(N\) that was already captured in the first integration. Of course it cancels: you reconstructed it correctly.
If the equation weren't exact — if \(M_y \neq N_x\) — those \(x\)-terms wouldn't cancel. You'd have leftover \(x\) terms in the equation for \(h'(y)\), making it impossible to solve for a pure-\(y\) function. That's the system telling you: no single surface generated both \(M\) and \(N\).
The exactness test pre-certifies the cancellation. When you check \(M_y = N_x\) up front and it passes, you're guaranteeing that this cancellation will happen later. The test and the cancellation are two faces of the same condition: mixed partials commute \((f_{xy} = f_{yx})\), meaning the terrain has no internal contradictions.