[Math] Proof for exact differential equations shortcut

calculusordinary differential equations

Today in my math class, we learned about exact differential equations. During class, our teacher first taught us the accepted way to solve exact equations, but then, told us of a shortcut that one of her students had apparently discovered several years ago, where you integrate both components, and "merge" the common terms.

For example, if I have the following equation: $(x^2 + y^2)dx + (2xy + \cos{y})dy = 0$, then the shortcut would be the following:

$$\begin{align}
\int(x^2 + y^2)dx \;\;\;\;\; & and\;\;\;\;\;\; \int (2xy + \cos{y})dy \\
\frac{1}{3}x^3 + xy^2 \;\;\;\;\; & and\;\;\;\;\;\; xy^2 + \sin{y}
\end{align}$$

Because $xy^2$ is a term common to both expressions, I would "merge" the equation into the following to get the final solution:

$$\frac{1}{3}x^3 + xy^2 + \sin{y} = c$$

Our teacher then told us that neither her nor the student was able to formally prove why this works, and so cautioned us against relying on this (specifically, she told us we were only allowed to use this method to double-check our work in our upcoming quiz).

Given that my teacher had difficulties figuring out how this works, I feel ill-equipped to try and prove how and why this works on my own. Can somebody help me understand or prove (or disprove) the validity of this shortcut?

Edit: I corrected the final equation from $\frac{1}{3} + xy^2 + \sin{y} = c$ to $\frac{1}{3}x^3 + xy^2 + \sin{y} = c$

Best Answer

I do not think this is a trick because it is a way to solve exact differential equations. Suppose we are given an exact differential equation $$M(x, y)dx + N(x, y)dy = 0$$ whose solution is the family $f(x, y) = \text{const.}$ You probably know that if $f(x, y)$ has continuous second partials, then $$\frac{\partial^2 f}{\partial x \partial y} = \frac{\partial^2 f}{\partial y \partial x}.$$ Now, if $$\frac{\partial f}{\partial x} = M$$ and $$\frac{\partial f}{\partial y} = N,$$ then $$\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}.$$ This allows us to test exactness. One way to find $f(x, y)$ is to integrate $M$ w.r.t. $x$ and $N$ w.r.t. $y$. Then we need to add an arbitrary function of $y$ to the first integral and an arbitrary function of $x$ to the second. Then we can "merge" the equations as you mentioned. For example, suppose $$\int M(x, y)dx = x - x^2 y + Y(y)$$ and $$\int N(x, y)dy = y^4 - x^2 y + X(x).$$ We see that $\partial f/\partial x = M$ and $\partial f/\partial y = N$, and $$f(x, y) = x - x^2 y + y^4.$$ As a result, $$x - x^2 y + y^4 = \text{const.}$$ Hope this helps.