[Math] Help with solving differential Equation using Exact Equation method

calculusintegrationordinary differential equations

I need to learn how to solve differential equations using either the Exact Equation Approach and or the Special Integrating Factor methods. Below is a differential Equation to solve.

$$(2xy^2 + \cos x) \text{d}x + (2x^2 y + \sin y)\text{d}y = 0$$

I would appreciate it if you would include comments to explain steps taken. Thanks in advance.


Following your example I did the following

Given $$ (2x + y)\mathrm dx + ( x – 2y)\mathrm dy = 0$$

a) $$ M(x,y)=2x + y, N(x,y)= x – 2y $$

b) check if the d.e is exact.
$\frac{\partial M}{\partial y}=\frac{\partial}{\partial y}\left(2x + y\right)= 1 =\frac{\partial}{\partial x}\left(x – 2y\right)=\frac{dN}{\partial x}$.

c) $$ f\left(x,y\right)=\int M(x,y)\text{d}x =\int(2x + y)\text{d}x=x^{2} + xy + g(y).$$

d) To find $g\left(y\right)$
$f_{y}\left(x,y\right)=\frac{\partial}{dy}\left(x^{2}+ xy + g(y)\right)=0 + x + g'\left(y\right).$

e) Upon comparing with $N\left(x,y\right)$, I find $g'\left(y\right)= – 2y$
which implies that $g\left(y\right)=- y^{2}+K$

Therefore, the general solution is $ x^2 + xy – y^2 =C$.

Best Answer

Note that the d.e is of the form $M(x,y)\text{d}x+N(x,y) \text{d}y$ with
$$ M(x,y)=2xy^2+\cos (x),~N(x,y)=2x^2y+\sin (y) $$
and the equation is exact if and only if $\displaystyle\frac {\partial M}{\partial y}=\frac{\partial N}{\partial x}.$

Now lets check if the differential equation is indeed exact.

$\displaystyle\frac{\partial M}{\partial y}=\frac{\partial}{\partial y}\left(2xy^{2}+\cos x\right)=4xy=\frac{\partial}{\partial x}\left(2x^{2}y+\sin y\right)=\frac{dN}{\partial x}$.

So the equation is exact.

The general solution is of the form $f\left(x,y\right)=C$ and it's given by

$$ f\left(x,y\right)=\int M(x,y)\text{d}x =\int(2xy^{2}+\cos x)\text{d}x=x^{2}y^{2}+\sin(x)+ g(y).$$ To find $g\left(y\right)$ differentiate $f\left(x,y\right)$ partially with respect to $'y'$ and compare with $N\left(x,y\right).$

That is: $f_{y}\left(x,y\right)=\dfrac{\partial}{dy}\left(x^{2}y^{2}+\sin x+g(y)\right)=2x^{2}y+g'\left(y\right).$ Comparing with $N\left(x,y\right)$, we find $g'\left(y\right)=\sin y,$ which implies that $g\left(y\right)=-\cos y+K$.
Hence, the general solution is $ x^2y^2+\sin x-\cos y=C.\quad\quad\Box$

Added

What happens if $M(x,y)\text{d}x+N(x,y)\text{d}y=0$ is not exact? Then there exist a function $u(x,y)$ such that $$[u(x,y)M(x,y)]\text{d}x+[u(x,y)N(x,y)]\text{d}y=0$$ is exact. The function $u$ is called an integrating factor. Furthermore, If $$\frac{M_y-N_x}{N}$$ is a function of $x$ only, say, $v(x)$, then $u(x,y)=u(x)=e^{\int v(x)\text{d}x}$.
On the other hand if $$\frac{M_y-N_x}{-M}$$ is a function of $y$ only, say, $w(y)$, then $u(x,y)=u(y)=e^{\int w(y)\text{d}y}$.

As an example, consider $(3xy-y^2)\text{d}x+(x^2-xy)\text{d}y=0$. Clearly, this is not exact. But $\dfrac{M_y-N_x}{N}=\dfrac{1}{x}=v(x)$, a function of $x$ only. So our integrating factor becomes $$u(x)=e^{\int \frac{1}{x}\text{d}x}=e^{\ln |x|}=|x|.$$
Verify that $$(3x^2y-xy^2)\text{d}x+(x^3-x^2y)\text{d}y=0$$ is now exact!
We now proceed as before to find the general solution.

Related Question