Visual walkthrough — Integrating factors for non-exact equations
We only assume you can add, multiply, and follow an arrow on a picture. Everything else is built.
Step 1 — What a "differential form" is, as arrows on a grid
WHAT. We start from an equation written like this:
Read as "a tiny step right" and as "a tiny step up". At each point on the grid, and are just two numbers. Pack them into a little arrow — this is the field the equation lives in.
WHY this picture. The equation says . That combination is the dot product of the arrow with your tiny step . Dot product zero means perpendicular. So the equation is secretly telling you: "walk only in the direction perpendicular to my arrow." Those allowed walking-directions trace the solution curves.
PICTURE. Look at the pale-yellow arrows and the chalk-blue tick that is perpendicular to each — that tick is the direction a solution is allowed to move.
Step 2 — What "exact" looks like: the field is a hill's slope
WHAT. Sometimes the arrow field is the uphill-steepness arrow of a hill. Call the hill's height . Its steepness arrow (the gradient) is Here means "how fast height climbs as you step right", "as you step up". If , we call the equation exact.
WHY it matters. If the arrows are a real hill's uphill arrows, then walking perpendicular to them (Step 1) means walking along a line of constant height — a contour. Staying on a contour is exactly . That single sentence is the solution.
PICTURE. The chalkboard shows a hill (contour rings). Pink uphill arrows point straight up the slope; the blue solution curve hugs a contour, always sideways to the arrows.
Step 3 — The test that detects a real hill:
WHAT. How do you know if came from a hill without finding ? Measure two twists:
N_x=\frac{\partial N}{\partial x}\quad(\text{how }N\text{ changes as you move right}).$$ **WHY these two.** If $(M,N)=(F_x,F_y)$, then $M_y=F_{xy}$ and $N_x=F_{yx}$. For a smooth hill the order of these two slopes does not matter — that is [[Mixed partial derivatives (Clairaut's theorem)|Clairaut's theorem]]. So a genuine hill forces $$\boxed{M_y=N_x.}$$ If the two twists disagree, **no hill exists** — the field is warped, it "curls". **PICTURE.** Two tiny loops: on the left the arrows match around the loop ($M_y=N_x$, no curl — hill-like); on the right they rotate around the loop ($M_y\neq N_x$, curl — no hill). > [!definition] Exactness test > $M\,dx+N\,dy=0$ is exact $\iff M_y=N_x$. Unequal twists mean the field ==curls==, so no > potential hill can produce it. --- ## Step 4 — The stubborn case, and the one legal move **WHAT.** Most equations fail the test: $M_y\neq N_x$. There is no hill, so we cannot read off a contour. The one legal repair: multiply the whole equation by a nonzero function $\mu(x,y)$: $$\mu M\,dx+\mu N\,dy=0.$$ **WHY it is legal.** Multiplying "= 0" by something nonzero cannot move where the expression is zero. The **solution curves are identical**. But the *arrows* got rescaled — different length at different points — and maybe now they DO line up with some hill's slope. Same as the special factor $e^{\int P\,dx}$ that rescues a [[Linear first-order ODEs|linear first-order ODE]]. **PICTURE.** Left: warped field (arrows uneven, no hill). We stretch each arrow by its local $\mu$ (right), and now they knit into a proper hill's slope field — contours appear. > [!intuition] Magic glasses, not a new map > $\mu$ rescales arrow lengths point-by-point. It never changes which curves solve the equation — > only whether the field *looks like* a hill. --- ## Step 5 — Demanding exactness gives a PDE for $\mu$ **WHAT.** We now *demand* the rescaled field be exact. Apply the Step 3 test to $(\mu M,\ \mu N)$: $$\frac{\partial}{\partial y}(\mu M)=\frac{\partial}{\partial x}(\mu N).$$ Use the product rule (rate of a product = each factor's rate in turn): $$\underbrace{\mu_y M}_{\substack{\mu\text{ changes}\\ \text{up-ward}}}+\underbrace{\mu M_y}_{\substack{M\text{'s}\\\text{own twist}}} =\underbrace{\mu_x N}_{\substack{\mu\text{ changes}\\\text{right-ward}}}+\underbrace{\mu N_x}_{\substack{N\text{'s}\\\text{own twist}}}.$$ Collect the $\mu$-derivative terms on one side: $$\boxed{\,N\,\mu_x-M\,\mu_y=\mu\,(M_y-N_x)\,.}$$ **WHY this is progress and a trap at once.** The right side $\mu(M_y-N_x)$ is the *original curl* we must cancel; the left side is how $\mu$'s own variation can supply that cancellation. But this is a **PDE** ($\mu$ still depends on two variables) — as hard as the original problem. The escape: *guess* $\mu$ uses only ONE variable, killing one term. **PICTURE.** A flow chart of the two terms: $N\mu_x$ (arrow, changing rightward) minus $M\mu_y$ (arrow, changing upward) must equal the curl $\mu(M_y-N_x)$ we want gone. > [!formula] Master condition on $\mu$ > $$N\,\mu_x-M\,\mu_y=\mu\,(M_y-N_x).$$ > Every special formula below is this one equation with a term switched off. --- ## Step 6 — Case $\mu=\mu(x)$: switch off the $y$-term **WHAT.** Suppose $\mu$ depends on $x$ only. Then it never changes as you move up: $\mu_y=0$, and $\mu_x=\mu'$ (an ordinary derivative). The master equation collapses: $$N\,\mu'=\mu\,(M_y-N_x)\ \Longrightarrow\ \frac{\mu'}{\mu}=\frac{M_y-N_x}{N}.$$ The left side $\mu'/\mu$ is "fractional growth rate of $\mu$" — and it is a function of $x$ **alone**. **WHY the consistency check.** A pure-$x$ thing cannot equal something still carrying $y$. So this route is *allowed only if* the right side $\dfrac{M_y-N_x}{N}$ has all its $y$'s cancel. Call that $g(x)$; then undoing $\mu'/\mu=g$ (which is what the exponential-of-integral does) gives $$\mu(x)=\exp\!\left(\int g(x)\,dx\right).$$ **PICTURE.** The board strips $\mu$ down to a curve over the $x$-axis only — constant along vertical lines — and shows the ratio's $y$'s cancelling to leave a clean $x$-profile. > [!formula] $x$-only integrating factor > If $g(x)=\dfrac{M_y-N_x}{N}$ has no $y$, then $\mu(x)=\exp\!\left(\int g(x)\,dx\right)$. > [!example] Watch it work: $(3xy+y^2)\,dx+(x^2+xy)\,dy=0$ > $M_y=3x+2y,\ N_x=2x+y$ (not exact). Then > $$\frac{M_y-N_x}{N}=\frac{x+y}{x(x+y)}=\frac1x\ \Rightarrow\ \mu=e^{\int dx/x}=x.$$ > After multiplying, $F=x^3y+\tfrac12x^2y^2$, so the solution is $x^3y+\tfrac12x^2y^2=C$. --- ## Step 7 — Case $\mu=\mu(y)$: switch off the $x$-term (mind the sign) **WHAT.** Now suppose $\mu$ depends on $y$ only: $\mu_x=0$, $\mu_y=\mu'$. The master equation gives $$-M\,\mu'=\mu\,(M_y-N_x)\ \Longrightarrow\ \frac{\mu'}{\mu}=\frac{N_x-M_y}{M}.$$ Notice the numerator **flipped sign** — it is $N_x-M_y$, not $M_y-N_x$. That flip is not a choice; it fell out of the $-M$ on the left. **WHY.** Same logic mirrored: a pure-$y$ growth rate can only equal a pure-$y$ ratio, so this works *only if* $\dfrac{N_x-M_y}{M}=h(y)$ loses all its $x$'s. Then $\mu(y)=\exp\!\left(\int h(y)\,dy\right).$ **PICTURE.** Mirror of Step 6: $\mu$ now a curve over the $y$-axis, constant along horizontal lines, with a big pink reminder that the sign in the numerator is reversed. > [!mistake] The sign trap > $y$-case uses $\dfrac{N_x-M_y}{M}$ — **not** $\dfrac{M_y-N_x}{M}$. It comes from the $-M$; the > minus hops over. Copying the $x$-case sign is the classic slip. > [!example] Watch it work: $y\,dx+(2x-ye^y)\,dy=0$ > $M_y=1,\ N_x=2$. The $x$-ratio $\frac{-1}{2x-ye^y}$ keeps an $x$ (fails), but > $\frac{N_x-M_y}{M}=\frac{1}{y}$ is pure $y$, so $\mu=y$. Result: $xy^2-e^y(y^2-2y+2)=C.$ --- ## Step 8 — Degenerate & edge cases you must not trip on **WHAT.** Three boundary situations decide whether the machinery even runs: 1. **Already exact ($M_y=N_x$).** Then $M_y-N_x=0$, so $g=h=0$ and $\mu=e^0=1$. The factor is just $1$ — no rescaling needed. The method *contains* the exact case as a no-op. 2. **$N=0$ somewhere.** The $x$-formula divides by $N$, so it blows up on the line $N=0$. Try the $y$-route (divide by $M$) instead, or restrict to a region where $N\neq0$. 3. **Neither ratio simplifies.** If $\frac{M_y-N_x}{N}$ keeps $y$ *and* $\frac{N_x-M_y}{M}$ keeps $x$, no single-variable $\mu$ exists. You must try richer guesses ($\mu(xy)$, $\mu(x/y)$) or a different method entirely — [[Separable equations]] or a substitution. **WHY show all three.** The reader must never meet an equation the page didn't warn about: exact (µ=1), a forbidden divide (µ from the other variable), and total failure (no 1-variable µ). **PICTURE.** Three mini-boards: a flat field (µ=1), a field with a "wall" where $N=0$ (µ undefined there), and a hopelessly warped field no single-axis stretch can fix. > [!recall]- Check yourself > If the equation is already exact, what is $\mu$? ::: $\mu=1$, because $M_y-N_x=0$ so $g=0$ and $e^0=1$. > The $x$-formula fails because $N=0$ on some curve — what do you do? ::: Switch to the $y$-formula (divide by $M$), or restrict to $N\neq0$. > Both single-variable ratios keep the other variable. Conclusion? ::: No $x$-only or $y$-only $\mu$ exists; try $\mu(xy)$, a substitution, or another method. --- ## The one-picture summary The whole journey on one board: a warped, hill-less field $(M,N)$ → the twist test $M_y$ vs $N_x$ catching the curl → stretch by $\mu$ → the field becomes a real hill's slope → read off the contour $F=C$. > [!recall]- Feynman retelling (say it to a 12-year-old) > Draw a little arrow at every point of your paper — that's the equation. You're allowed to walk > only sideways to the arrows; the trails you make are the answers. **If** those arrows happen to be > the "straight-uphill" arrows of some invisible hill, walking sideways just means staying at one > height — so the answer is "stay at height $C$." You can tell whether a real hill is hiding there by > a twist test: how the sideways-number changes going up should match how the up-number changes going > sideways ($M_y=N_x$). When it doesn't match, there is no hill — the arrows curl. So you put on magic > glasses ($\mu$) that stretch each arrow by a chosen amount. Stretching can't change your trails, but > it *can* make the arrows finally line up into a genuine hill. To find the right glasses, you demand > "now it's a hill" and out pops one equation for $\mu$. Guess the glasses only care about left–right > ($\mu(x)$) or only up–down ($\mu(y)$); that guess is legal exactly when a certain ratio forgets the > other letter. Then $\mu$ is the exponential of that ratio's integral, and you read off the contour > $F=C$. If neither guess works, the hill is too twisted for simple glasses — reach for a fancier > trick. --- ## Connections - [[Integrating factors for non-exact equations]] — the parent this walkthrough visualises - [[Exact differential equations]] — the target form we force $\mu$ to create - [[Total differentials and potential functions]] — the "hill height" $F$ - [[Mixed partial derivatives (Clairaut's theorem)]] — why $M_y=N_x$ is the right test - [[Conservative vector fields]] — same "no curl ⇒ a potential exists" idea - [[Linear first-order ODEs]] — $e^{\int P\,dx}$ is a special integrating factor - [[Separable equations]] — a fallback when no single-variable $\mu$ exists