Solving Exact Differential Equations Examples 1

# Solving Exact Differential Equations Examples 1

Recall from the Exact Differential Equations page that a differential equation of the form $M(x, y) + N(x, y) \frac{dy}{dx} = 0$ is said to be exact if there exists a function $\psi (x, y)$ such that $\frac{\partial}{\partial x} \psi (x, y) = M(x, y)$ and $\frac{\partial}{\partial y} \psi (x, y) = N(x, y)$.

Furthermore, we noted that a differential is exact if and only if $\frac{\partial}{\partial y} M(x, y) = \frac{\partial}{\partial x} N(x, y)$ (and under some conditions on the continuity of $M$, $N$, $\frac{\partial M}{\partial y}$ and $\frac{\partial N}{\partial x}$.

We will now look at some more examples of solving exact differential equations.

## Example 1

Show that the differential equation $\frac{dy}{dx} = - \frac{Ax + By}{Bx + Cy}$ for $A, B, C \in \mathbb{R}$ is exact and solve this differential equation.

We first rewrite this differential equation in the form $M(x, y) + N(x, y) \frac{dy}{dx} = 0$:

(1)
\begin{align} \quad (Ax + By) + (Bx + Cy) \frac{dy}{dx} = 0 \end{align}

We have that $M(x, y) = Ax + By$ and $N(x, y) = Bx + Cy$. The partial derivative of $M$ with respect to $y$ and the partial derivative of $N$ with respect to $x$ are:

(2)
\begin{align} \quad \frac{\partial M}{\partial y} = B \\ \quad \frac{\partial N}{\partial x} = B \end{align}

Indeed this differential equation is exact, and so there exists a function $\psi (x, y)$ such that:

(3)
\begin{align} \quad \frac{\partial \psi}{\partial x} = Ax + By \quad , \quad \frac{\partial \psi}{\partial y} = Bx + Cy \end{align}

From the first equation, $\frac{\partial \psi}{\partial x} = Ax + By$, we integrate with respect to $x$ and get:

(4)
\begin{align} \quad \psi (x, y) = \int (Ax + By) \: dx \\ \quad \psi (x, y) = \frac{Ax^2}{2} + Bxy + h(y) \end{align}

We now partial differentiate with respect to $y$ and get:

(5)
\begin{align} \quad \frac{\partial \psi}{\partial y} = \frac{\partial}{\partial y} \left ( \frac{Ax^2}{2} + Bxy + h(y) \right ) \\ \quad \frac{\partial \psi}{\partial y} = Bx + h'(y) \end{align}

We are already given that $\frac{\partial \psi}{\partial y} = N(x, y) = Bx + Cy$. Therefore $h'(y) = Cy$ and so $h(y) = \int Cy \: dy = \frac{Cy^2}{2}$. Therefore the solution to our differential equation is:

(6)
\begin{align} \quad \frac{Ax^2}{2} + Bxy + \frac{Cy^2}{2} = D \end{align}

## Example 2

Show that the differential equation $\frac{dy}{dt} = \frac{- \left ( ye^{xy} \cos 2x - 2e^{xy} \sin 2x + 2x \right )}{(xe^{xy} \cos 2x - 3)}$ is an exact and solve this differential equation.

We first rewrite this differential equation in the form $M(x, y) + N(x, y) \frac{dy}{dx} = 0$:

(7)
\begin{align} \quad \left (ye^{xy} \cos 2x - 2e^{xy} \sin 2x + 2x \right ) + \left (xe^{xy} \cos 2x - 3 \right ) \frac{dy}{dx} = 0 \end{align}

Let $M(x, y) = ye^{xy} \cos 2x - 2e^{xy} \sin 2x + 2x$ and let $N(x, y) = xe^{xy} \cos 2x - 3$. The partial derivative of $M$ with respect to $y$ and the partial derivative of $N$ with respect to $x$ are:

(8)
\begin{align} \quad \frac{\partial M}{\partial y} = e^{xy} + xye^{xy} - 2xe^{xy} \sin 2x \\ \quad \frac{\partial N}{\partial x} = e^{xy} + xye^{xy} - 2xe^{xy} \sin 2x \end{align}

Therefore the given differential equation is indeed exact, and so there exists a function $\psi (x, y)$ such that:

(9)
\begin{align} \quad \frac{\partial \psi}{\partial x} = ye^{xy} \cos 2x - 2e^{xy} \sin 2x + 2x \quad , \quad \frac{\partial \psi}{\partial y} = xe^{xy} \cos 2x - 3 \end{align}

We now take the second equation and integrate with respect to $y$ (this is much simpler than integrating the first equation with respect to $x$). We have that:

(10)
\begin{align} \quad \psi (x, y) = \int \left ( xe^{xy} \cos 2x - 3 \right ) \: dy \\ \quad \psi (x, y) = e^{xy} \cos 2x - 3y + h(x) \end{align}

We now partial differentiate both sides with respect to $x$ to get that:

(11)
\begin{align} \quad \frac{\partial \psi}{\partial x} = ye^{xy} \cos 2x - 2e^{xy} \sin 2x + h'(x) \end{align}

We already note that $\frac{\partial \psi}{\partial x} = M(x, y) = ye^{xy} \cos 2x - 2e^{xy} \sin 2x + 2x$. By comparing this with above, we see that $h'(x) = 2x$, so $h(x) = x^2$, and so the solution to this differential equation is:

(12)
\begin{align} \quad e^{xy} \cos 2x - 3y + x^2 = C \end{align}