Back to the on-screen lesson ·
Reading $M\,dx + N\,dy = 0$ as the statement that a potential is constant, testing it with $M_y = N_x$, and recovering the potential whose level curves are the solutions.
Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.
By the end of this lesson you will be able to write a first-order equation in differential form, decide whether it is exact by comparing the two cross partial derivatives, build the potential by integrating one of them and fixing the rest with the other, write the solution as an implicit relation and use an initial condition to find its constant, and recognise when the test has failed and say why the recovery then breaks down.
You can separate, and you can use an integrating factor on a linear equation. You also know from multivariable calculus that a function of two variables has two partial derivatives, and that for a well-behaved function the mixed second derivatives agree whichever order they are taken in. That last fact is the whole of the test in this lesson.
| Term | What it means |
|---|---|
| Differential form | A first-order equation written as $M(x, y)\,dx + N(x, y)\,dy = 0$. |
| Exact | The form is exact on a region when some function $F$ has $F_x = M$ and $F_y = N$ there. |
| Potential | That function $F(x, y)$; the equation then says $dF = 0$. |
| Level curve | A curve $F(x, y) = C$; the solutions of an exact equation are its level curves. |
| Exactness test | The check $M_y = N_x$, which decides whether a potential exists. |
| Implicit solution | An answer of the form $F(x, y) = C$: a relation the solution satisfies rather than a formula for $y$. |
| Integrating factor | A function $\mu$ that makes $\mu M\,dx + \mu N\,dy = 0$ exact when the original was not. |
Write the equation as
$$M(x, y)\,dx + N(x, y)\,dy = 0.$$
Suppose there is a function $F$ with $F_x = M$ and $F_y = N$. Then the left-hand side is the total differential $dF$, the equation says $dF = 0$, and every solution lies on a level curve
$$F(x, y) = C.$$
That is the whole idea, and it makes the method the easiest in the unit once the potential is known — the answer is read off rather than integrated towards.
The test. If such an $F$ exists then $M_y = (F_x)_y$ and $N_x = (F_y)_x$ are the two mixed second derivatives of one function, so they are equal. That gives a necessary condition, and on a region without holes it is sufficient too:
$$\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}.$$
Recovering $F$. Integrate $M$ with respect to $x$. Because $y$ was held fixed, the constant of integration is an unknown function $g(y)$:
$$F(x, y) = \int M\,dx + g(y).$$
Now differentiate that with respect to $y$ and set it equal to $N$. Everything involving $x$ cancels — it must, or the test would have failed — and what is left is $g'(y)$, which integrates to finish the job.
Another way: picture
Think of $F$ as the height of a landscape. The pair $(M, N)$ is the gradient, pointing straight uphill at every point, and the equation $M\,dx + N\,dy = 0$ says: move in a direction with no uphill component. The paths that obey it are the contour lines. The exactness test asks whether the arrows you were handed really are the gradient of some landscape, and a field of arrows that curls cannot be.
Another way: steps
The condition $M_y = N_x$ looks like an arbitrary piece of bookkeeping and is nothing of the kind. If $F$ exists then $M = F_x$ and $N = F_y$, so
$$M_y = \frac{\partial^{2}F}{\partial y\,\partial x}, \qquad N_x = \frac{\partial^{2}F}{\partial x\,\partial y},$$
and Clairaut's theorem says those are equal whenever the second derivatives are continuous. So the test is not a test for exactness invented for the occasion; it is the one fact about mixed partial derivatives, used backwards.
That also explains the shape of the recovery. When $F$ is differentiated in $y$ at step 4, every term that came from integrating $M$ must produce exactly the $x$-dependent part of $N$ — and it does, precisely because $M_y = N_x$. If an $x$ survives in your expression for $g'(y)$, the test was failed or the differentiation was wrong, and the appearance of that stray $x$ is the cheapest self-check the method offers.
An equation that is not exact can sometimes be multiplied into one that is. Take $y\,dx + (2x - y)\,dy = 0$: here $M_y = 1$ and $N_x = 2$, so it is not exact. Multiply through by $y$:
$$y^{2}\,dx + (2xy - y^{2})\,dy = 0,$$
and now $M_y = 2y = N_x$. The same word, integrating factor, is doing the same job it did for linear equations: turning a left-hand side that is not a derivative into one that is.
Finding such a factor in general is harder than solving the equation, so it is not a routine step. Two special cases are worth keeping: when $(M_y - N_x)/N$ depends on $x$ alone, there is a factor $\mu(x)$, and when $(N_x - M_y)/M$ depends on $y$ alone, there is a factor $\mu(y)$. Both are found by solving a separable equation, which is where this unit started.
An exact equation is solved in the same order every time, and each move has a reason.
Step 3 can be done the other way round, integrating $N$ in $y$ with a function $h(x)$ as the constant and then matching $F_x$ with $M$. Choose whichever integral is easier; the answer is the same potential.
How to check the answer. Differentiate your $F$ both ways. $F_x$ must be exactly $M$ and $F_y$ must be exactly $N$, term by term; if one term is off, the slip is in step 3 or step 5. Then put the given point into $F = C$ and confirm it holds. For an answer solved for $y$, differentiate it and substitute into $M + Ny' = 0$, which is the original equation divided by $dx$.
When an integrating factor is used, check that the multiplied equation passes the test before integrating: if $M_y$ and $N_x$ still differ, the factor was wrong. Remember too that multiplying by $\mu$ can add solutions where $\mu = 0$ or remove them where $\mu$ is undefined, so the lines where the factor vanishes are checked separately in the original equation.
A force field $\mathbf{F} = (M, N)$ in the plane is conservative when the work it does moving an object from one point to another does not depend on the path. That is exactly when $M\,dx + N\,dy$ is exact, and the potential $F$ found in this lesson is then (up to a sign) the potential energy: the work from $P$ to $Q$ is $F(Q) - F(P)$, whatever route is taken.
Take the field $M = 2xy + 3$, $N = x^{2} + 4y$ in newtons, with distances in metres. The test $M_y = 2x = N_x$ passes, and this lesson's first example found $F = x^{2}y + 3x + 2y^{2}$. The work done moving from $(0, 0)$ to $(1, 1)$ is $F(1, 1) - F(0, 0) = (1 + 3 + 2) - 0 = 6$ joules, along a straight line, a curve or a detour of any length. Computing that as a line integral along a chosen path gives the same $6$ after considerably more work.
The same test tells an engineer when this shortcut is not available. Friction and air drag are not conservative: their $M$ and $N$ fail $M_y = N_x$, the work depends on the path, and no potential energy exists for them. Gravity, springs and the electrostatic force pass it, which is why energy conservation can be used with them and not with friction.
In thermodynamics the heat $\delta Q$ added to a gas is not the differential of anything: the heat taken to go from one state to another depends on the route. For one mole of an ideal gas, with temperature $T$ and volume $V$, $\delta Q = C_V\,dT + \frac{RT}{V}\,dV$. Test it with $M = C_V$ and $N = \frac{RT}{V}$: $M_V = 0$ but $N_T = \frac{R}{V}$. Not exact.
Now divide by $T$. The new coefficients are $\frac{C_V}{T}$ and $\frac{R}{V}$, and $\frac{\partial}{\partial V}\frac{C_V}{T} = 0 = \frac{\partial}{\partial T}\frac{R}{V}$. Exact. The factor $\frac{1}{T}$ is an integrating factor, and the potential of the exact equation is
$$S = C_V\ln T + R\ln V + \text{constant},$$
the entropy. That $\frac{\delta Q}{T}$ is exact while $\delta Q$ is not is one statement of the second law of thermodynamics, and it was found by exactly the calculation in this lesson's section on integrating factors. Along a reversible adiabatic process no heat flows, $dS = 0$, and the level curves $S = C$ give $TV^{R/C_V} = \text{constant}$, the curve a gas follows when compressed quickly in an engine cylinder.
The test pairs $M$ with $y$ and $N$ with $x$, which feels back to front and is routinely written the other way round as $M_x = N_y$. That crossing is the entire content of the test. $M$ is supposed to be $F_x$, so the only new information it can give about $F$ is what happens when it is differentiated in the other variable; differentiating $M$ in $x$ again just asks about $F_{xx}$, which has nothing to do with $N$. Getting the pairing wrong does not usually produce an error message — it produces a verdict, and about half the time the verdict is right by accident, which is what makes the habit so durable. A second and quieter version of the same haste is skipping the test altogether. Every method in this course answers one shape of equation and no other. So the first question is never how do I solve this but what is this — the order, whether it is linear, and which of the standard shapes it already is. An integrating factor applied to a nonlinear equation produces confident nonsense.
Solve $(2xy + 3)\,dx + (x^{2} + 4y)\,dy = 0$. Test first.
$M = 2xy + 3 \Rightarrow M_y = 2x, \qquad N = x^{2} + 4y \Rightarrow N_x = 2x$
The cross derivatives agree, so the equation is exact.
Integrate $M$ in $x$, with a function of $y$ as the constant.
$\displaystyle F = \int (2xy + 3)\,dx = x^{2}y + 3x + g(y)$
Holding $y$ fixed, $2xy$ integrates to $x^{2}y$.
Differentiate in $y$ and match with $N$.
$F_y = x^{2} + g'(y) = x^{2} + 4y \quad\Rightarrow\quad g'(y) = 4y$
The $x^{2}$ cancels, as the test guaranteed.
Integrate $g'$ and write the level curves.
$g(y) = 2y^{2} \quad\Rightarrow\quad x^{2}y + 3x + 2y^{2} = C$
The answer is a relation, not a formula for $y$.
Pick the curve through $(1, 1)$.
$C = 1 \cdot 1 + 3 + 2 = 6 \quad\Rightarrow\quad x^{2}y + 3x + 2y^{2} = 6$
The constant is $F$ evaluated at the point.
Test $(y^{2} + x)\,dx + (x + y)\,dy = 0$: differentiate $M$ in $y$ and $N$ in $x$.
$M = y^{2} + x \Rightarrow M_y = 2y, \qquad N = x + y \Rightarrow N_x = 1$
Two different functions, so the test fails.
Notice where the two derivatives happen to agree.
$2y = 1 \iff y = \tfrac{1}{2}$
They agree on a single line, and a line is not a region, so there is no potential.
Attempt the recovery anyway, to see how it fails: integrate $M$ in $x$ and match $F_y$ with $N$.
$F = \tfrac{1}{2}x^{2} + xy^{2} + g(y) \;\Rightarrow\; F_y = 2xy + g'(y) = x + y \;\Rightarrow\; g'(y) = x + y - 2xy$
A function of $y$ alone cannot contain $x$: the stray $x$ is the method reporting that it does not apply.
Look for an integrating factor that depends on $x$ alone.
$\dfrac{M_y - N_x}{N} = \dfrac{2y - 1}{x + y}$
This ratio still contains $y$, so no factor $\mu(x)$ exists.
Look for one that depends on $y$ alone.
$\dfrac{N_x - M_y}{M} = \dfrac{1 - 2y}{y^{2} + x}$
This ratio still contains $x$, so no factor $\mu(y)$ exists either. The equation needs a different method, and the two quick tests said so in two lines.
Solve $y\,dx + (2x - y)\,dy = 0$ through $(1, 1)$. Test first.
$M = y \Rightarrow M_y = 1, \qquad N = 2x - y \Rightarrow N_x = 2$
The test fails, so look for a factor.
Compute the ratio that decides whether a factor $\mu(y)$ exists.
$\dfrac{N_x - M_y}{M} = \dfrac{2 - 1}{y} = \dfrac{1}{y}$
It depends on $y$ alone, so a factor of $y$ alone exists, with $\frac{\mu'}{\mu}$ equal to this ratio.
Solve for the factor.
$\dfrac{\mu'}{\mu} = \dfrac{1}{y} \quad\Rightarrow\quad \ln\mu = \ln y \quad\Rightarrow\quad \mu = y$
A separable equation for $\mu$; any one solution will do, so no constant is needed.
Multiply the whole equation by $y$ and test again.
$y^{2}\,dx + (2xy - y^{2})\,dy = 0: \quad M_y = 2y, \quad N_x = 2y$
The new cross derivatives agree, so the new equation is exact.
Integrate the new $M$ in $x$, with a function of $y$ as the constant.
$\displaystyle F = \int y^{2}\,dx = xy^{2} + g(y)$
$y^{2}$ is a constant while $x$ varies.
Differentiate in $y$ and match with the new $N$.
$F_y = 2xy + g'(y) = 2xy - y^{2} \quad\Rightarrow\quad g'(y) = -y^{2} \quad\Rightarrow\quad g(y) = -\dfrac{y^{3}}{3}$
The $2xy$ terms cancel, which is the exactness test paying off.
Write the level curves and put in the point $(1, 1)$.
$xy^{2} - \dfrac{y^{3}}{3} = C, \qquad C = 1 - \dfrac{1}{3} = \dfrac{2}{3}$
The solution through $(1, 1)$ is $xy^{2} - \frac{y^{3}}{3} = \frac{2}{3}$.
Check by differentiating $F$ back.
$dF = y^{2}\,dx + (2xy - y^{2})\,dy = y\left[y\,dx + (2x - y)\,dy\right]$
The differential of $F$ is the factor times the original equation, so $dF = 0$ exactly when the original holds (away from $y = 0$).
Test for exactness.
$M = 3x^{2} + y \Rightarrow M_y = 1, \qquad N = x - 2y \Rightarrow N_x = 1$
Always test first: they agree, so a potential exists.
Integrate $M$ in $x$ and match $F_y$ with $N$.
Integrate $g'$ and pick the level curve through $(1, 0)$.
Is $(2xy + 1)\,dx + (x^{2} + 4y)\,dy = 0$ exact?
Complete the worked solution: solve $(5y + 2)\,dx + (5x + 6y)\,dy = 0$ through the point $(2, 3)$.
Test for exactness.
$M_y = \dfrac{\partial}{\partial y}(5y + 2) = 5, \qquad N_x = \dfrac{\partial}{\partial x}(5x + 6y) = 5$
They agree, so a potential $F$ exists.
Integrate $M$ with respect to $x$, holding $y$ fixed.
$\displaystyle F = \int (5y + 2)\,dx = 5xy + 2x + g(y)$
The constant of integration is any function of $y$.
Differentiate in $y$ and match with $N$.
$F_y = 5x + g'(y) = 5x + 6y \quad\Rightarrow\quad g'(y) = 6y \quad\Rightarrow\quad g(y) = 3y^{2}$
The $5x$ terms cancel, as the test promised.
Evaluate the first term of $F$ at $(2, 3)$.
$5 \cdot 2 \cdot 3 =$ u
The solution through a point is the level curve whose value is $F$ there.
Evaluate the other two terms.
$2 \cdot 2 + 3 \cdot 3^{2} =$ w
Square $3$ before multiplying by $3$.
Add the parts to get the constant, and write the solution.
$C = F(2, 3) =$ z $\quad\Rightarrow\quad 5xy + 2x + 3y^{2} = C$
The answer is left implicit: an equation for the level curve.
Put the steps of solving $(2y + 2)\,dx + (2x + 2y)\,dy = 0$ into the order they must be done.
Number the steps in order (write the number in the box):
For each equation, give $\partial M/\partial y$ and $\partial N/\partial x$ at the point $(1, 1)$.
| $\partial M/\partial y$ at $(1, 1)$ | $\partial N/\partial x$ at $(1, 1)$ | |
|---|---|---|
| $(10xy + 5)\,dx + (5x^{2} + 1)\,dy = 0$ | ||
| $(5y + 5)\,dx + (5x - y)\,dy = 0$ | ||
| $(5y^{2} + 5)\,dx + (5x + 1)\,dy = 0$ |
An exact equation has potential $F(x, y) = 5xy + 4x + 3y^{2}$, and its solution passes through $(1, 2)$. What is the value of $C$ in $F(x, y) = C$?
Answer:
A bead slides along a wire through a conservative force field, and the wire follows a curve on which the potential energy stays constant, so its shape satisfies the exact equation $(2xy + 2)\,dx + x^{2}\,dy = 0$. The wire passes through $(1, 5)$. Solve for its shape with $y(1) = 5$, for $x > 0$, and write $y$ as a formula in $x$.
Answer:
$(3y + 5)\,dx + (3x + 8y)\,dy = 0$ is exact. Write the potential $F(x, y)$ whose level curves are its solutions, taking the arbitrary constant to be zero.
Answer:
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
A bead slides along a wire through a conservative force field, and the wire follows a curve on which the potential energy stays constant, so its shape satisfies the exact equation $(2xy + 4)\,dx + x^{2}\,dy = 0$. The wire passes through $(1, 3)$. Solve for its shape with $y(1) = 3$, for $x > 0$, and write $y$ as a formula in $x$.
Answer:
You can test an equation for exactness, recover the potential, and write the solution as a level curve with its constant fixed by the initial point. Say in your own words why the test compares $M_y$ with $N_x$ rather than $M_x$ with $N_y$.
14. Your turn: solve $(3x^{2} + y)\,dx + (x - 2y)\,dy = 0$ through the point $(1, 0)$, step 2
$F = x^{3} + xy + g(y), \quad F_y = x + g'(y) = x - 2y \;\Rightarrow\; g'(y) = -2y$
Compare with $N$; the $x$ cancels.
14. Your turn: solve $(3x^{2} + y)\,dx + (x - 2y)\,dy = 0$ through the point $(1, 0)$, step 3
$g(y) = -y^{2}, \qquad x^{3} + xy - y^{2} = C, \qquad C = 1 + 0 - 0 = 1$
One level curve of a surface, picked out by one point on it: $x^{3} + xy - y^{2} = 1$.