---
tag: 2X5V81FS0J
kind: proof
name: Proof of the test for exactness
msc: [34A05]
proves: 0MSCQNFTM8
uses: [0EC7AGJ0PX, 0BARQY52N5, 0NC2A3HWGT, 0AR06W1E1B, 0NHGY0N0JB, 0KXSK8TEEB]
sources:
  - url: https://en.wikipedia.org/wiki/Exact_differential_equation
    locator: Identifying first-order exact differential equations
---

## Proof

We write $M_y = \partial M / \partial y$ and $N_x = \partial N / \partial x$.

1. Necessity. Assume the equation is [[exact|0EC7AGJ0PX]] on $R$. So there is a differentiable $\psi : R \to \R$ with $\partial \psi / \partial x = M$ and $\partial \psi / \partial y = N$ on $R$.
2. Fix $(x, y) \in R$. Since $R$ is open, there is $h_0 > 0$ with $[x, x + h] \times [y, y + h] \subseteq R$ for each $h \in (0, h_0]$. Fix such an $h$.
3. Let $\Delta = \psi(x + h, y + h) - \psi(x + h, y) - \psi(x, y + h) + \psi(x, y)$.
4. Let $g(s) = \psi(s, y + h) - \psi(s, y)$ for $s \in [x, x + h]$. Then $g$ is differentiable with $g'(s) = M(s, y + h) - M(s, y)$, since $\partial \psi / \partial x = M$.
5. By the [[mean value theorem|0BARQY52N5]], $\Delta = g(x + h) - g(x) = h\, g'(\xi)$ for some $\xi \in (x, x + h)$.
6. The function $t \mapsto M(\xi, t)$ is differentiable with derivative $M_y(\xi, t)$. The mean value theorem gives $\eta \in (y, y + h)$ with $M(\xi, y + h) - M(\xi, y) = h\, M_y(\xi, \eta)$. So $\Delta = h^2 M_y(\xi, \eta)$.
7. In the same way, let $k(t) = \psi(x + h, t) - \psi(x, t)$ for $t \in [y, y + h]$. Then $k'(t) = N(x + h, t) - N(x, t)$, since $\partial \psi / \partial y = N$.
8. Two uses of the mean value theorem, first for $k$ and then for $s \mapsto N(s, \eta')$, give points $\xi' \in (x, x + h)$ and $\eta' \in (y, y + h)$ with $\Delta = h^2 N_x(\xi', \eta')$.
9. By steps 6 and 8, $M_y(\xi, \eta) = N_x(\xi', \eta')$. Both points lie in the square $[x, x + h] \times [y, y + h]$.
10. Let $h \to 0$ along $h = h_0 / j$. Both points tend to $(x, y)$. Since $M_y$ and $N_x$ are continuous, $M_y(x, y) = N_x(x, y)$.
11. Sufficiency. Assume $M_y = N_x$ on $R$. Fix $(x_0, y_0) \in R$, and for $(x, y) \in R$ let $\psi(x, y) = \int_{x_0}^{x} M(s, y_0)\, ds + \int_{y_0}^{y} N(x, t)\, dt$.
12. Since $R$ is a rectangle, the segments from $(x_0, y_0)$ to $(x, y_0)$ and from $(x, y_0)$ to $(x, y)$ lie in $R$. The integrands are continuous, so $\psi$ is well defined.
13. The first term of $\psi$ does not depend on $y$. The function $t \mapsto N(x, t)$ is continuous on $(\gamma, \delta)$. By [[the antiderivative theorem|0NC2A3HWGT]], $\partial \psi / \partial y (x, y) = N(x, y)$.
14. Fix $(x_1, y_1) \in R$. The first term $A(x) = \int_{x_0}^{x} M(s, y_0)\, ds$ has $A'(x_1) = M(x_1, y_0)$, by the antiderivative theorem.
15. Let $B(x) = \int_{y_0}^{y_1} N(x, t)\, dt$. If $y_1 = y_0$, then $B = 0$ and $B'(x_1) = 0$.
16. Otherwise let $c = \min(y_0, y_1)$ and $d = \max(y_0, y_1)$, and choose $h > 0$ with $[x_1 - h, x_1 + h] \subseteq (\alpha, \beta)$. Then $N$ and $N_x$ are continuous on $[x_1 - h, x_1 + h] \times [c, d] \subseteq R$.
17. By [[differentiation under the integral sign|0AR06W1E1B]], $B'(x_1) = \int_{y_0}^{y_1} N_x(x_1, t)\, dt$. Here $B$ is $\pm \int_c^d N(x, t)\, dt$, so the rule applies to it.
18. By hypothesis $N_x(x_1, t) = M_y(x_1, t)$. The function $t \mapsto M(x_1, t)$ is continuous on $[c, d]$ with derivative $M_y(x_1, t)$.
19. The [[fundamental theorem of calculus|0NHGY0N0JB]] gives $\int_c^d M_y(x_1, t)\, dt = M(x_1, d) - M(x_1, c)$. So $B'(x_1) = M(x_1, y_1) - M(x_1, y_0)$ in both orders of $y_0, y_1$.
20. This also holds when $y_1 = y_0$. Adding steps 14 and 19 gives $\partial \psi / \partial x (x_1, y_1) = M(x_1, y_1)$.
21. So the partial derivatives of $\psi$ are $M$ and $N$, which are continuous on the open set $R$. By [[continuous partial derivatives imply differentiability|0KXSK8TEEB]], $\psi$ is differentiable on $R$.
22. Hence $\psi$ is a potential function, and the equation is exact on $R$.

## Idea

For necessity, the double difference $\Delta$ of $\psi$ over a small square can be computed as $h^2 M_y$ or as $h^2 N_x$, at nearby points. Shrinking the square and using continuity gives $M_y = N_x$. For sufficiency, we integrate $M$ along a horizontal segment and $N$ along a vertical one. The condition $M_y = N_x$ makes the $x$-derivative of the second integral cancel the error of the first.
