Suppose a curve $y(x)$ stays on a level curve $F(x, y) = C$ of a function of two variables. Differentiating with the chain rule gives $F_x + F_y\,y' = 0$, or in differential form $$F_x\,dx + F_y\,dy = 0.$$ So if an equation $M\,dx + N\,dy = 0$ has $M = F_x$ and $N = F_y$ for some $F$, its solutions are simply the level curves $F(x, y) = C$. Such equations are called exact, and recognizing them uses the mixed partials from Higher-Order Partials.
Key idea
Why it works
Worked example: Find the potential
- Check: $M_y = 2x$ and $N_x = 2x$. Exact.
- Integrate $M$ in $x$ (holding $y$ fixed): $F = x^{2}y + x^{3} + h(y)$.
- Then $F_y = x^{2} + h'(y)$ must equal $N = x^{2} + 2y$, so $h'(y) = 2y$ and $h = y^{2}$.
- $F = x^{2}y + x^{3} + y^{2}$.
Answer: $x^{2}y + x^{3} + y^{2} = C$
Worked example: With an initial condition
- $M_y = \cos x = N_x$. Exact.
- $F = \int (y\cos x + 2x)\,dx$ $= y\sin x + x^{2} + h(y)$.
- $F_y = \sin x + h'(y)$ $= \sin x - 3y^{2}$, so $h = -y^{3}$.
- At $(0, 1)$: $F = 0 + 0 - 1 = -1$.
Answer: $y\sin x + x^{2} - y^{3} = -1$, an implicit solution.
Worked example: Not exact, but close
- $M_y = 3x + 2y$ but $N_x = 2x + y$: not exact.
- Multiply by $x$: $M = 3x^{2}y + xy^{2}$, $N = x^{3} + x^{2}y$.
- Now $M_y = 3x^{2} + 2xy = N_x$: exact. Integrating gives $F = x^{3}y + \frac{1}{2}x^{2}y^{2}$.
Answer: $x^{3}y + \frac{1}{2}x^{2}y^{2} = C$. (Here $\frac{M_y - N_x}{N} = \frac{1}{x}$ depends on $x$ only, which is the signal that $\mu = e^{\int dx/x} = x$ works.)
Common mistake