We notice immediately that the integration factor method and separation of variables both do not work for the DE
$$2x + y^2 + 2xyy' = 0.$$On the other hand, we notice that
$$0 = 2x + y^2 + 2xyy' = \frac{d}{dx}(x^2 + xy^2),$$where $y = y(x)$. Hence
for some constant $c$.
Let us recall the standard chain rule for partial derivatives of $\psi(x, y)$, where $x = x(t)$ and $y = y(t)$:
Let us now revisit the above example and write
$$\psi(x, y) = x^2 + xy^2.$$Then we have by chain rule above that
$$0 = \frac{d}{dx}\psi(x, y) = \frac{\partial \psi}{\partial x}\frac{dx}{dx} + \frac{\partial \psi}{\partial y}\frac{dy}{dx} = \frac{\partial \psi}{\partial x} + \frac{\partial \psi}{\partial y}\frac{dy}{dx}$$which was the calculation for $\psi = x^2 + xy^2$ we have computed above. So the conclusion is
$$\psi(x, y) = c$$for some constant $c$. We note that if we denote $M(x, y) = \partial\psi/\partial x$ and $N(x, y) = \partial\psi/\partial y$, then we could write the DE $2x + y^2 + 2xyy' = 0$ in the form
$$M(x, y) + N(x, y)\,y'(x) = 0.$$The equation
$$M(x, y) + N(x, y)\,y'(x) = 0 \tag{1}$$is called exact if it can be integrated as
$$\frac{d}{dx}[\psi(x, \phi)] = 0$$for $y = \phi(x)$. That is, $\psi(x, y(x)) = c$ for some constant $c$.
We note that if $M(x, y) = M(x)$ and $N(x, y) = N(y)$ in the above consideration, then the DE becomes
$$M(x) + N(y)\frac{dy}{dx} = 0$$which was the separable form DE considered earlier. In this case, the exactness of the DE criterion
$$M_y = 0 = N_x$$holds in an appropriate $R$ automatically. Hence the DE can be integrated.
Let $M(x, y)$, $N(x, y)$, $M_y(x, y)$, $N_x(x, y)$ be continuous functions defined in the rectangle $R$: $\alpha < x < \beta$; $\gamma < y < \delta$. Then
$$M(x, y) + N(x, y)\frac{dy}{dx} = 0$$is exact in $R$ if and only if there is a $\psi = \psi(x, y)$ such that
$$\frac{\partial \psi}{\partial x} = M(x, y), \qquad \frac{\partial \psi}{\partial y} = N(x, y)$$and
holds at each point of $R$. The equivalent statement is
$$\frac{\partial^2 \psi}{\partial y\,\partial x} = \frac{\partial^2 \psi}{\partial x\,\partial y},$$holds at each point of $R$, i.e., the DE can be solved.
($\Rightarrow$) Suppose first that the DE (1) is exact, that is, we can find a function $\psi(x, y)$ such that
$$\psi_x = M(x, y), \qquad \psi_y = N(x, y)$$holds in $R$. But $\psi_x$ and $\psi_y$ are continuous, so
$$\psi_{xy} = \psi_{yx}$$in $R$. But this is precisely the equation $M_y = N_x$.
($\Leftarrow$) Suppose we now assume $M_y = N_x$. Let us integrate the first equation $\psi_x = M$ with respect to $x$ (keeping $y$ constant). This yields
$$\psi(x, y) = Q(x, y) + h(y) = \int_{x_0}^{x} M(s, y)\,ds + h(y), \qquad \alpha < \alpha_0 < x < \beta_0 < \beta.$$We differentiate this equation both sides respect to $y$ and ask if the formula:
$$\frac{\partial Q}{\partial y} + h'(y) = N(x, y)$$holds. This is, if
$$h' = N(x, y) - \frac{\partial Q}{\partial y}.$$Differentiating the RHS with respect to $x$ yields
$$\frac{\partial N}{\partial x} - \frac{\partial}{\partial x}\frac{\partial Q}{\partial y} = \frac{\partial N}{\partial x} - \frac{\partial}{\partial y}\frac{\partial Q}{\partial x} = \frac{\partial N}{\partial x} - \frac{\partial}{\partial y}M = 0$$since $M_y = N_x$. Hence
$$0 = \frac{\partial h'(y)}{\partial x}$$holds and that the above $h'(y)$ and $h(y)$ are indeed functions of $y$ only. Upon integration of the above formula with respect to $y$ yields
$$h(y) = \int N(x, t)\,dt - Q + c,$$for some constant $c$. We further notice that
$$\psi(x, y) = Q(x, y) + h(y) = Q(x, y) + \int N(x, t)\,dt - Q + c = \int N(x, t)\,dt + c.$$Hence
$$\frac{\partial \psi}{\partial y} = N(x, y).$$Since we have found a function $\psi(x, y)$ such that $\psi_x = M(x, y)$, $\psi_y = N(x, y)$, so the original DE is exact.
The DE
$$2x + y^2 + 2xy\,y' = 0$$with
$$M(x, y) = 2x + y^2, \qquad N(x, y) = 2xy,$$is exact in the whole coordinate plane since
$$\frac{\partial M}{\partial y} = \frac{\partial}{\partial y}(2x + y^2) = 2y,$$and
$$\frac{\partial N}{\partial x} = \frac{\partial}{\partial x}(2xy) = 2y$$holds at every point of the $xy$-plane.
Consider the equation
$$y\cos x + 2xe^y + (\sin x + x^2 e^y - 1)\frac{dy}{dx} = 0.$$It is straightforward to check that
$$\frac{\partial M}{\partial y} = \cos x + 2xe^y = \frac{\partial N}{\partial x},$$holds everywhere where
$$M(x, y) = y\cos x + 2xe^y, \qquad N(x, y) = \sin x + x^2 e^y - 1.$$So the theorem asserts that there is a $\psi$ such that
\begin{align} \frac{\partial \psi}{\partial x} &= M = y\cos x + 2xe^y, \tag{2}\\[6pt] \frac{\partial \psi}{\partial y} &= N = \sin x + x^2 e^y - 1. \tag{3} \end{align}Integrating the equation (2) with respect to $x$ yields
$$\psi(x, y) = y\sin x + x^2 e^y + h(y)$$where $h(y)$ is a function of $y$ only. Differentiating this $\psi$ with respect to $y$ implies that
$$\psi_y = \sin x + 2e^y + h'(y),$$so that a comparison with (3) yields
$$h'(y) = -1.$$That is,
$$h(y) = -y$$ignoring an integration constant.* We deduce
where $c$ is a constant.
*Since this constant can be relegated to the constant in the final solution.
We leave as an exercise to the readers to verify that one can derive the same solution should one integrate the equation (3) with respect to $y$ instead of integration of (2) with respect to $x$.
Consider the equation
$$3xy + y^2 + (x^2 + xy)\,y' = 0.$$Let
$$M(x, y) = 3xy + y^2, \qquad N(x, y) = x^2 + xy.$$Then
\begin{align} M_y &= 3x + 2y \\[4pt] &\neq 2x + y = N_x. \end{align}That is, $\psi_{yx} \neq \psi_{xy}$ so that the DE above is not exact unless at $(x, y) = (0, 0)$. So the DE cannot be integrated so solve for $\psi$.
For suppose that there is such $\psi$, then we would have
$$\frac{\partial \psi}{\partial x} = M = 3xy + y^2,$$so that
$$\psi(x, y) = \frac{3}{2}x^2 y + xy^2 + h(y)$$where $h = h(y)$ is a function depends on $y$ only. We also have
$$\frac{\partial \psi}{\partial y} = N = x^2 + xy.$$But then we must have, combining the two sources of $\psi_y$:
\begin{align} h'(y) &= \psi_y - \Big(\frac{3}{2}x^2 + 2xy\Big) \\[4pt] &= x^2 + xy - \Big(\frac{3}{2}x^2 + 2xy\Big) \\[4pt] &= -\frac{1}{2}x^2 - xy \end{align}which is not a function of $y$ only, a contradiction to our earlier deduction that $h(y)$ is a function of $y$ only. Hence no such $\psi$ can exist.
We have just met an example of a DE that is not exact so that it cannot be integrated via the familiar method. However, there is a corresponding integrating factor method (not the same one we encountered earlier).
Suppose that
$$M_y \neq N_x,$$but there is a $\mu = \mu(x, y)$ such that
$$[\mu(x, y)M(x, y)]_y = [\mu(x, y)N(x, y)]_x.$$That is, we require
$$0 = [M_y - N_x]\mu + \mu_y M - \mu_x N$$to hold. But such an integration factor is difficult to find and we resort to assume $\mu(x, y) = \mu(x)$. Then the above requirement simplifies to
$$0 = [M_y - N_x]\mu - \mu_x N$$or
$$\mu_x N = [M_y - N_x]\mu,$$and so
This equation for $\mu(x)$ can be solved by separation method if the right hand-side is a function of $x$ only.
Let us consider the non-exact DE
$$3xy + y^2 + (x^2 + xy)\,y' = 0.$$Recall that
$$M(x, y) = 3xy + y^2, \qquad N(x, y) = x^2 + xy.$$We check to see if the right hand-side of $\mu_x$ is a function of $x$ only:
\begin{align} \frac{\frac{d\mu}{dx}}{\mu} &= \frac{[M_y - N_x]}{N} = \frac{3x + 2y - (2x + y)}{x^2 + xy} \\[6pt] &= \frac{x + y}{x(x + y)} = \frac{1}{x}, \end{align}is indeed a function of $x$ only. Moreover, solving the above DE for $\mu$
$$\frac{1}{\mu}\frac{d\mu}{dx} = \frac{1}{x},$$yields $\mu(x) = x$. Multiplying this $\mu$ on both sides of the original DE:
$$3x^2 y + xy^2 + (x^3 + x^2 y)\,y' = 0.$$Let
$$\tilde{M} = 3x^2 y + xy^2, \qquad \tilde{N} = x^3 + x^2 y.$$Then
$$\tilde{M}_y = 3x^2 + 2xy = \tilde{N}_x = 3x^2 + 2xy$$thus verifying the new DE above is EXACT. It is left as an exercise to check that
for some constant $c$.
If it turns out that the non-exact DE
$$M + Ny' = 0,$$has
$$\frac{N_x - M_y}{M} = Q,$$is a function of $y$ only, that is $\mu(x, y) = \mu(y)$ instead, then one can show that it has an integration factor of the form
Determine if the following DEs are exact and solve them if so.
Solve the following non-exact DEs:
Given the differential equation:
$$y\cos x + 2xe^y + (\sin x + x^2 e^y - 1)\frac{dy}{dx} = 0$$In the form $M + N\frac{dy}{dx} = 0$, identify $M(x,y)$ and $N(x,y)$:
What condition must we check for exactness?
Compute $M_y = \frac{\partial}{\partial y}(y\cos x + 2xe^y)$:
Compute $N_x = \frac{\partial}{\partial x}(\sin x + x^2 e^y - 1)$:
Compare $M_y$ and $N_x$. Is the equation exact?
We need $\psi_x = M = y\cos x + 2xe^y$. Integrating with respect to $x$:
Now differentiate $\psi = y\sin x + x^2 e^y + h(y)$ with respect to $y$:
We need $\psi_y = N = \sin x + x^2 e^y - 1$. Comparing with $\psi_y = \sin x + x^2 e^y + h'(y)$:
Final solution $\psi(x,y) = c$:
Determine if the following DE is exact:
$$(3xy + y^2) + (x^2 + xy)\frac{dy}{dx} = 0$$Identify $M$ and $N$:
Compute $M_y$:
Compute $N_x$:
Is the equation exact?
Find an integrating factor for the non-exact DE:
$$(3xy + y^2) + (x^2 + xy)\frac{dy}{dx} = 0$$(We showed this is not exact since $M_y = 3x + 2y \neq 2x + y = N_x$)
To find an integrating factor $\mu$, we first try $\mu = \mu(x)$. What must we check?
Compute $M_y - N_x$:
Compute $\dfrac{M_y - N_x}{N} = \dfrac{x + y}{x^2 + xy}$:
Since $\frac{M_y - N_x}{N} = \frac{1}{x}$ depends only on $x$, we can find $\mu(x)$. What equation does $\mu$ satisfy?
Solve $\frac{1}{\mu}\frac{d\mu}{dx} = \frac{1}{x}$ by integrating both sides:
Multiply the original DE by $\mu = x$. What is the new $\tilde{M}$?
What is the new $\tilde{N}$?
Verify exactness: compute $\tilde{M}_y$ and $\tilde{N}_x$:
Solve the exact equation (from Exercise 1):
$$(4x^3 y^3 - 2xy)\,dx + (3x^4 y^2 - x^2)\,dy = 0$$With $M = 4x^3 y^3 - 2xy$ and $N = 3x^4 y^2 - x^2$, verify $M_y = N_x$:
Integrate $\psi_x = M = 4x^3 y^3 - 2xy$ with respect to $x$:
Differentiate $\psi = x^4 y^3 - x^2 y + h(y)$ with respect to $y$ and compare with $N$:
Since $h'(y) = 0$, we have $h(y) = $ constant. The solution $\psi = c$ is:
— End of Exact and Non-exact Equations Notes —