Visual walkthrough — Exact equations — exactness condition, finding potential function
Before line one, let me name the characters so no symbol sneaks in unearned.
Step 1 — See the hill and its contour lines
WHAT. Draw a hill and slice it at equal heights. Each slice, projected down onto the floor, is a contour line — the set of spots where equals one fixed value .
WHY. The entire theory of exact equations is the sentence "walk so your height never changes." To make that precise we must first see what "same height" looks like on the floor: a contour. Everything else is squeezed out of this one picture.
PICTURE.

On the right you see the floor with three contour lines. Each carries a label like : every point on that curve sits at exactly the same height on the hill. Move along a contour and your height is frozen; move across it and your height changes.
Step 2 — Turn "stay level" into
WHAT. Take a tiny step on the floor: a bit East, , and a bit North, . The height changes by the total differential Now demand that we stay on the contour: height must not change, so .
WHY. This is where the differential equation is born. "Stay on one contour" literally means "," and writing out gives an equation in and . Naming the East slope and the North slope turns it into the parent's form.
PICTURE.

The little step vector hugs the contour (red). Climbing East gains of height; walking North gains ; to stay level these must cancel.
Step 3 — The fingerprint: why
WHAT. If and F$. Differentiate each one in the other direction:
\frac{\partial N}{\partial x} \;=\; \frac{\partial}{\partial x}\!\left(\frac{\partial F}{\partial y}\right).$$ Both are "slope of the East-slope in the North direction" vs "slope of the North-slope in the East direction" — the same mixed second slope, just built in a different order. **WHY.** We need a **cheap test** we can run *before* hunting for $F$. A real hill leaves a fingerprint: measuring its curvature clockwise or counter-clockwise gives the same answer. That's [[Clairaut's Theorem (Equality of Mixed Partials)]]. **PICTURE.** ![[deepdives/dd-maths-4.6.06-d2-s03.png]] The little square shows two routes to the same far corner of the hill. Route A: step East then read how the North-slope changed. Route B: step North then read how the East-slope changed. For a smooth hill both routes land on the identical corner height — so the two mixed slopes are equal. > [!formula] Exactness condition (the test) > $$\boxed{\;\frac{\partial M}{\partial y} \;=\; \frac{\partial N}{\partial x}\;}$$ > Read it as: *"cross-differentiate — differentiate the $dx$-coefficient by $y$, and the $dy$-coefficient by $x$; they must match."* If they don't, no single hill $F$ exists and the recipe below is forbidden. > [!mistake] Don't differentiate $M$ by $x$ > $M$ sits next to $dx$, so it *feels* tied to $x$. But the fingerprint is a **cross**: $M$ by $y$, $N$ by $x$. It mirrors $F_{xy}=F_{yx}$, not $F_{xx}$. --- ## Step 4 — Rebuild the hill: integrate $M$ in $x$ **WHAT.** We know the East slope everywhere: $F_x = M$. To recover the height itself, **undo the East-slope** by integrating in $x$: $$F(x,y) \;=\; \int M\,dx \;+\; g(y).$$ **WHY.** Integration is the reverse of slope-taking, so it rebuilds height from slope. But when we integrate *in $x$*, anything that depends only on $y$ was invisible (its East-slope is zero). So we must carry an unknown $y$-only piece $g(y)$ — a "constant of integration that is allowed to depend on $y$." **PICTURE.** ![[deepdives/dd-maths-4.6.06-d2-s04.png]] We march East along one North-line, adding up slope to recover height (the filled area under the East-slope curve). Each different North-line may start at a different base height — that vertical shift is precisely $g(y)$, drawn as the unknown lift of each blue profile. > [!mistake] $g(y)$ is not a plain "$+C$" > A normal integral adds a number. Here the frozen variable $y$ can ride inside the constant, so we write $g(y)$, a whole function. Dropping it deletes real terms of the answer. --- ## Step 5 — Patch the leftover using $F_y = N$ **WHAT.** We also know the North slope: $F_y = N$. Differentiate the rebuilt $F$ in $y$ and force it to equal $N$: $$\frac{\partial}{\partial y}\!\left(\int M\,dx\right) \;+\; g'(y) \;=\; N.$$ The first term is already known (it fell out of Step 4). Whatever $N$ has *left over* must be $g'(y)$. Integrate that once in $y$ to get $g(y)$. **WHY.** Step 4 pinned the hill everywhere *except* its $y$-only wobble. The second slope $N$ is exactly the extra information that fixes that wobble. Exactness (Step 3) is what guarantees the leftover depends on $y$ alone — otherwise no $g(y)$ could absorb it. **PICTURE.** ![[deepdives/dd-maths-4.6.06-d2-s05.png]] Left: the hill from Step 4 with an unknown vertical wobble along the North axis. Right: matching $F_y$ to $N$ removes the wobble — the surface snaps into its one correct shape. > [!mistake] Don't re-integrate what's already inside $F$ > The part of $N$ produced by $\partial_y\!\int M\,dx$ is **already** in your $F$. Only the *remainder* becomes $g'(y)$. Subtract carefully, or you double-count. --- ## Step 6 — Read the solution off the contour **WHAT.** Once $F$ is fully rebuilt, the ODE said $dF=0$, i.e. $F$ is constant along the motion. So the solution is simply $$\boxed{\,F(x,y) = c\,}.$$ **WHY.** We never needed to solve for $y$ explicitly. The equation *was* "stay on a contour"; naming the contour's height $c$ is the whole answer. Different starting points give different $c$ — a whole family of contour curves. **PICTURE.** ![[deepdives/dd-maths-4.6.06-d2-s06.png]] The reconstructed hill and, beneath it, its contour map: each curve is one solution $F=c$. Pick your initial point, it lands on one contour, and that contour is *the* solution. Let's run the machine on the parent's Example 1, $(2xy+3)\,dx + (x^2-1)\,dy = 0$: > [!example] The recipe, one line per step > - **Test:** $M_y = 2x = N_x$ ✓ (a hill exists). > - **Integrate $M$:** $F = \int(2xy+3)\,dx + g(y) = x^2y + 3x + g(y)$. > - **Match $N$:** $F_y = x^2 + g'(y) = x^2 - 1 \Rightarrow g'(y) = -1 \Rightarrow g(y) = -y$. > - **Solution:** $\;x^2 y + 3x - y = c.$ --- ## Step 7 — The degenerate case: when the fingerprint fails **WHAT.** Take $y\,dx - x\,dy = 0$, so $M=y$, $N=-x$. Then $M_y = 1$ but $N_x = -1$. They disagree. **WHY show it.** You must never launch the rebuild on an equation with no hill — Step 4 would carry a leftover that still depends on *both* $x$ and $y$, and $g(y)$ could never absorb it. Seeing the fingerprint fail is what protects you. **PICTURE.** ![[deepdives/dd-maths-4.6.06-d2-s07.png]] The two mixed-slope routes now land at *different* heights (the square doesn't close). No single hill. The rescue is a multiplier $\mu = 1/x^2$, turning it into $d(y/x)=0$ — that's the story of [[Integrating Factors for ODEs]]. > [!recall]- Which special families are secretly exact? > [[Separable Equations]] and [[Linear First-Order ODEs]] can each be massaged into exact form (sometimes needing an integrating factor first). Exactness is the umbrella idea; those are corners under it. And an exact field is precisely a **curl-free / conservative** one — see [[Conservative Vector Fields & Potential Functions]]. --- ## The one-picture summary ![[deepdives/dd-maths-4.6.06-d2-s08.png]] One image, whole derivation: the hill $F$ on the left flows to its contours; "stay level" births $M\,dx+N\,dy=0$; the mixed-slope square gives the test $M_y=N_x$; integrating $M$ then patching with $N$ rebuilds $F$; and the answer is the contour $F=c$. > [!recall]- Feynman: tell the whole walkthrough to a friend > Imagine a hill. Draw the lines that trace equal heights — contours. The equation $M\,dx+N\,dy=0$ is a walking rule: "move so your height never changes." That's only possible if a real hill exists behind the two numbers $M$ and $N$. To check, you measure the hill's twist two ways — climb East-then-feel-North versus North-then-feel-East. A genuine smooth hill gives the same answer both ways, which is the test $M_y = N_x$. Once it passes, you rebuild the hill: walk East adding up slope (that recovers $F$ except for how high each North-line starts, an unknown lift $g(y)$), then use the North slope $N$ to fix that lift. The finished hill's contour, $F=c$, *is* your answer. And if the two twist-measurements disagree, there is no hill — you first hunt for a magic multiplier that builds one. > [!mnemonic] The whole page in six beats > **See → Stay level → Fingerprint → Integrate → Patch → Read the contour.** ($ \text{contour}\to dF=0\to M_y=N_x\to \int M\,dx\to F_y=N\to F=c$.) --- ## Recall check Why does "stay on a contour" become $M\,dx+N\,dy=0$? ::: Staying level means $dF=0$; writing $dF = F_x\,dx + F_y\,dy$ and calling $F_x=M$, $F_y=N$ gives $M\,dx+N\,dy=0$. What is $M_y = N_x$ geometrically? ::: The hill's mixed second slope is the same measured both ways (Clairaut); it's the fingerprint that a single hill $F$ exists. Why does integrating $M$ in $x$ leave $g(y)$? ::: Any function of $y$ alone has zero East-slope, so it is invisible to $M$; we carry it as an unknown and fix it with $F_y=N$. For $(2xy+3)dx+(x^2-1)dy=0$, what is $F$? ::: $F = x^2y + 3x - y$, so the solution is $x^2y+3x-y=c$. Is $y\,dx - x\,dy=0$ exact? ::: No: $M_y=1\ne N_x=-1$; the mixed-slope square doesn't close, so no hill exists (needs an integrating factor).