# Exact Differential Equations

We will now look at another type of first order differential equation that we can solve known as exact differential equations which we define below.

Definition: Let $M(x, y)$ and $N(x, y)$ be functions, and suppose we have a differential equation in the form $M(x, y) + N(x, y) \frac{dy}{dx} = 0$. This differential equation is said to be Exact if there exists a function $\psi (x, y)$ such that $\frac{\partial}{\partial x} \psi (x, y) = \psi_x = M(x, y)$ and $\frac{\partial}{\partial y} \psi (x, y) = \psi_y = N(x, y)$. |

Now consider a differential equation of the following form where $M$ and $N$ are functions of $x$ and $y$:

(1)Suppose that there exists a function $\psi (x, y)$ such that:

(2)Then this first order differential equation is an exact differential equation. Plugging these equalities into the differential equation gives us:

(3)Now the chain rule for multivariable functions tells gives us a way to compress the formula for our differential equation above. Note that:

(4)When we plug this into our differential equation from above - we see that:

(5)The above equation is the solution to our differential equation when the variable $y$ is isolated.

Now we want to know how we can immediately tell whether or not a differential equation is exact. We will not prove this result, but provided that the functions $M$, $N$, $\frac{\partial M}{\partial y}$ and $\frac{\partial N}{\partial x}$ are continuous in a region $R$, then a differential equation of the form $M(x, y) + N(x, y) \frac{dy}{dx} = 0$ is exact if and only if:

(6)We will now look at an example of solving an exact differential equation.

## Example 1

**Solve the differential equation $(e^x \sin y - 2y \sin x) + (e^x \cos y + 2 \cos x) \frac{dy}{dt} = 0$.**

We first need to check that the differential equation is indeed exact. Let $M(x, y) = e^x \sin y - 2y \sin x$ and let $N(x, y) = e^x \cos y + 2 \cos x$. The partial derivative of $M$ with respect to $y$ and the partial derivative of $N$ with respect to $x$ are respectively:

(7)So indeed this differential equation is exact. Let $\psi (x, y)$ be the function such that:

(9)From the first equation, we have that $\frac{\partial}{\partial x} \psi (x, y) = e^x \sin y - 2y \sin x$. If we integrate both sides with respect to $x$ then we have that:

(10)Note that we do not have a constant of integration but instead a "function" of integration, $h(y)$. This is because if we were to partial differentiate both sides of the equation above with respect to $x$, then any function of $y$ would disappear.

We now take the equation above and partial differentiate it with respect to $y$ to get:

(11)We have two expressions for $\frac{\partial}{\partial y} \psi (x, y)$ - the one directly above, and $\frac{\partial}{\partial y} \psi (x, y) = N(x, y) = e^x \cos y + 2 \cos x$. In comparing these two, we see that $h'(y) = 0$. Therefore $h(y) = C$, and so therefore:

(12)Therefore the solution to our differential equation is of the form $\psi (x, y) = D$, where $D$ is an arbitrary constant. In absorbing the constant $C$ into $D$, we have that then:

(13)