Exact & Inexact ODEs
This section is concerned with a class of differential equations known as exact for which we can also identify a method of solution. We demonstrate the meaning of exactness through an example before going in to the details of the solution method.
Consider the following ODE,
We observe that Eq. (12.49) is neither separable nor linear and so neither of the methods discussed so far can be used. Note that here, the term which dictates that ODE (12.49) is nonlinear is . Now, consider a function of two variables, given as,
where . Next, we determine the total derivative of through implicit differentiation
note that the first two terms on the RHS in Eq. (12.51) are the result of the product rule when is differentiated wrt . Rearranging (12.51) yields,
which is equivalent to the LHS of Eq. (12.49). It follows that Eq. (12.49) may be expressed as
where is given by Eq. (12.50). Equation (12.53) states that the total derivative of is zero. Upon integrating both sides wrt yields
which is equal to
where is a constant. Equation (12.55) is the implicit form of the general solution to ODE (12.49). As usual, the particular solution is obtained by solving for the constant through application of an IC.
Using this 'special' function we are able to reduce an ODE which looks pretty difficult to solve at first and determine the general solution. This approach is applied to all first order exact ODEs but there are two main concerns:
- How can we tell if an ODE is exact?
- How can we determine the function for every exact ODE we encounter?
Condition for exactness
At this point let us recall the definition of the total derivative of a multivariable function. This is relevant when the variables that make up the function (like and in above) are not truly independent. To define the total rate of change of wrt , the partial derivative does not suffice because it does not give any information on how varying , changes . In such cases, to find the true slope of along the -direction, we need to define the total derivative of the function which in turn is expressed through the partial derivatives via the chain rule:
which simplifies to,
We revisit ODE (12.49) using the assumption that a special function exists and it is given by Eq. (12.50). Next, let us obtain the partial derivatives of wrt and [as always, recall that :
Observe that Eq. (12.57) gives the first two terms on LHS of Eq. (12.49) and Eq. (12.58) is the coefficient of in Eq. (12.49). This implies that ODE (12.49) may be expressed as,
Definition 12.3 Any first order ODE that is exact may be put in the following form,
It follows that we can rewrite (12.59) as,
So far we have discussed exact ODEs using the example ODE (12.49). Now, let us consider a generalised form of ODE (12.49), given by
where and are continuous functions. Note that Eq. (12.61) is often expressed in terms of the differential terms , as indicated in Eq. (12.40). However, now we look at the more general case where do not necessarily need to be homogeneous functions of the same degree. According to Definition 12.3, if there exists a function such that
then Eq. (12.62) is known to be exact.
Next, we discuss the condition for exactness. We start by partially differentiating wrt , yielding
Similarly, the partial derivative of wrt is
If and as well as all their partial derivatives exist and are continuous over some region then, the order in which we take the first and second derivatives is irrelevant. Therefore, if the continuity of the above-mentioned quantities is guaranteed, then
Equation (12.65) is equivalent to
Definition 12.4 Any ODE which can be put in the form
is exact if and only if (iff)
The above equation gives a condition that needs to be satisfied for an ODE to be exact.
Example 12.6 Show that the following ODE
is exact.
Solution Note that the ODE in this example is the equation given by Eq. (12.49) considered above. Comparing the ODE to Eq. (12.61), it is easy to see that
To show that the ODE is exact, we need the condition given by (12.66) to hold true. Differentiating wrt while keeping constant yields
while the partial derivative of wrt gives
Since , the ODE is exact.
Solving exact ODEs
We now know how to check whether a first order ODE is exact. Here, we develop a method to solve exact differential equations. To reiterate from the previous section, to solve an exact ODE we need to find the function which allows us to express the exact ODE as in Eq. (12.53) and subsequently write the solution as in Eq. (12.54).
Once we know the ODE we are trying to solve is exact, then we also know that there exists a function which satisfies
Note that integrating either Eq. (12.67) wrt or Eq. (12.68) wrt , gives us . Let us start with Eq. (12.67); integrating wrt yields,
Recall that when integrating a multivariable function only wrt one variable, we do not obtain a constant of integration but rather an arbitrary function of the variable that was kept constant in integration. Here, we obtain as was integrated solely wrt . Similarly, integrating (12.68) wrt ,
Equations (12.69) and (12.70) contain the same information [i.e. they both describe . Comparing the two equations for allows us to determine the arbitrary functions obtained as a result of integration, and . With knowledge of and , we have from either (12.69) or (12.70). The most important results for exact ODEs are summarised in the box below.
A differential equation of the form
is exact if there exists a function such that and .
The ODE is then expressed as
and the general solution to the exact differential equation is given by
The general solution represents a 1-parameter family of solutions. Here, the parameter refers to the constant above and it is determined using an IC. Example 12.7 Solve the following ODE
Solution We have shown in Example 12.6 that the ODE above with and , is exact. Using Eqs. (12.67) and (12.68), we have
and
Integrating (12.71) wrt and (12.72) wrt gives,
Since (12.73) and (12.74) both define , comparing the two equations gives
Finally, we can write down as
which is the 'special' function we defined in Eq. (12.50). With knowledge of , the original ODE is expressed as
which is integrated wrt to give the implicit solution to the ODE as follows,
Integrating factors for inexact ODEs
Consider again a differential equation given in the form of (12.61). We can imagine that there are far more cases for which the exactness condition given by (12.66) is violated, i.e.
It follows that the LHS of (12.61) cannot be expressed as the derivative of this 'special' function which is obtained using the methodology outlined in Subsec. 12.4.2. At this point let us revisit the topic of linear ODEs from Subsec. 12.2.1. We reproduce the first order LODE given by (12.19) here for convenience,
To solve the above equation, in Subsec. 12.2.1, we transformed the LHS into the derivative of some function by making use of an I.F. In solving the exact ODE (12.61), we transform the LHS to the total derivative of . It is possible, in some cases, to find an I.F. for an inexact ODE which transforms it into an exact one. An inexact ODE is a differential equation of the form (12.61) for which the exactness condition (12.66) does not hold true.
Suppose we have an inexact ODE, i.e.
We are looking for an I.F., which turns the ODE exact. To see this, we want a function which when multiplied by the ODE, i.e.
satisfies the exactness condition,
In the case of first order LODEs, we can derive the form of the I.F. which have shown to be . In the more general case of first order ODEs (i.e. where nonlinearity is a possibility), we can no longer easily show whether the I.F. is just a univariate function or, if it takes the more general form as we denoted it in Eq. (12.77) of . An I.F. is, however, guaranteed to exist as long as the differential equation has a solution.
Since , and can be functions of both the dependent and independent variables, from Eq. (12.78), we have
When rearranged, Eq. (12.79) yields
Given an ODE, the functions , and are known and therefore the only unknown in Eq. (12.80) is . However, solving for from (12.80) requires solving a partial differential equation. To find an I.F. for inexact ODEs therefore, we consider two special cases for which the I.F. reduces to a single-variable function.
Special case 1: is only a function of
Suppose that the I.F. is only a function of . Then,
Upon making the above substitutions in Eq. (12.80), we obtain the following simplifying expression
Note that the LHS of Eq. (12.81) is only a function of . If the quantity on the RHS is also only a function of then first order, separable ODE for ,
Integrating Eq. (12.82) yields the I.F.,
If the quantity on the RHS of (12.81) is not a function of only, then and we proceed to check whether (special case 2 ).
Special case 2: is only a function of
Here, we assume that the I.F. is only a function of , such that
Similarly to special case 1, upon making the above substitutions in Eq. (12.80), we obtain the following simplifying expression,
Assuming , the LHS is only a function of ; if the RHS is also only a function of then the I.F. is given by,
Method for solving inexact ODEs
We develop a simple algorithmic process as a method of solution for inexact ODEs. Given an inexact ODE, our aim is to find an I.F.. For the purposes of this course, we only consider the aforementioned two special cases.
Step 1:
Check if
If yes, the I.F. is and defined by (12.83). If no, proceed to Step 2.
Step 2:
Check if
If yes, the I.F. is and defined by (12.85). If no, then the I.F. takes a more complex form and finding it falls beyond the scope of this course. Example 12.8 Find a particular solution to the following IVP
Solution The ODE is nonlinear but separable. For the purposes of this example however we choose to solve it using integrating factors. With and , we check for exactness
since , the ODE is inexact. The next step is to look for a simple I.F. (as in special cases 1 or 2 above) if it exists to render the ODE exact. We check whether using Eq. (12.86)
Using (12.83), the I.F. is
Multiplying the original ODE by the I.F. yields the equivalent exact ODE (after simplification) as
We proceed to solve ODE (12.88) using the method developed for exact ODEs in Subsec. 12.4.2. The two equations for are
Comparing the two equations, and we obtain the general solution as
Finally, applying the IC , we arrive at the particular solution
Note that the IC is only satisfied with the positive square root.
Exercises
- Consider the following first order, nonlinear ODE:
Show that the ODE is exact and find a particular solution satisfying .
- Find the value of for which the following differential equation is exact,
Solve the ODE using that value of .