We illustrate the idea behind exact equations with the following example:
Since the right hand side of (??) is neither of the form nor of the form , it cannot be solved either by separation of variables or by substitution. However, it is possible to determine all solutions of (??), as we now explain.We may rewrite (??) as
Suppose that is a solution to (??) and let . Then differentiation shows that with the last equality coming from (??). Thus, if is a solution, then the function is constant. It follows that for each solution there is a real constant such that
Since (??) is quadratic in , the quadratic formula determines two solutions for each value of , namely, When , the radical in (??) is a perfect square and the two solutions to (??) are: as can readily be checked.Solutions Lie on Level Contours
To derive a geometric interpretation for the identity (??), define the function by A level set or contour of is defined to be the set of points in the -plane for which for some real constant . Thus, (??) can now be restated as follows: solutions of the differential equation (??) lie on the level sets of , since .
Drawing Contours Using MATLAB
We use the MATLAB command contour to illustrate how this information helps us to visualize all the solutions. Type
[t,x] = meshgrid(-1.5:0.1:1.5,-1.5:0.1:1.5);After these commands the data for the surface defined by the function in the square is stored in the MATLAB variable F. The command contour(F) allows us to display the level sets of . To have the correct scales on the axes, type
F = x.^2 - x.*t + t;
contour(t,x,F)Now the contour lines — the level sets corresponding to different levels — are displayed. Moreover, we want to know to which levels the curves in that picture belong. Suppose that we are interested in the level sets corresponding to . Then we obtain this information by typing
cs = contour(t,x,F,[-2,-1,0,1,2,3,4,5]);The command clabel allows us to label the different contour lines by their actual level. The desired information is displayed in Figure ??.
clabel(cs)
xlabel(’t’)
ylabel(’x’)
Note that the straight line solutions and correspond to the level set for , as expected. We can also see from Figure ?? that the contour lines for the levels have a turning point, that is, they cannot be parameterized entirely by .
Setting in (??) we find the expressions These functions are not real-valued for . In particular, they cannot correspond to solutions of (??) for these values of . This provides an explanation for the existence of the turning point at and why the solutions and “collide” at this point.
Finally, we use dfield5 to confirm our theoretical discussion. We set the values in the display window as in Figure ?? and start the computation in using the Keyboard input. The result — which is in good agreement with the contour plot — is shown in Figure ??. Observe that dfield5 will not stop the computation of the forward orbit on its own and one has to use the Stop button to stop the numerical solution. The reason is that the program encounters numerical difficulties approaching the turning point , since the right hand side of the differential equation is not defined at .
The General Definition of Exact Differential Equations
After this motivating example, we consider the general situation. Suppose that we have an ordinary differential equation of the form
where and are real-valued continuous functions. In (??), and . The differential equation (??) is exact if there is a function such that Indeed, the differential equation (??) is exact — just set .Supposing that the differential equation (??) is exact, proceed as in the example by rewriting (??) as
Let be a solution to (??) and use the chain rule, (??), and (??) to obtain Hence, solutions of (??) must lie on a level set of defined by . We have proved:On the Existence of
In order to solve exact differential equations, we must answer two questions:
- When does a function exist that satisfies the conditions in (??)?
- If the function exists, then how can we compute it?
The following proposition, based on the equality of mixed partial derivatives, gives a necessary condition for having a positive answer to the first question.
- Proof
- Using (??) we compute Since and are continuous, equality of mixed partial derivatives holds, and as desired.
Two Examples
We use two examples to illustrate the test for exactness of the underlying differential equation given by (??).
(a) Consider (??), that is, suppose and . Then and according to Remark ?? a function with the desired properties may be found.
(b) Suppose that and . Then and by Proposition ?? a function satisfying (??) cannot exist.
On the Computation of
Next, consider the second question, namely, how can be computed when it exists. By (??) we have Therefore, there is a differentiable function such that
where is an indefinite integral of with respect to the variable . Condition (??) also implies that that is Equations (??) and (??) can now be used to compute the function as long as the corresponding integrations can be performed.Equivalently, we can first integrate the condition to obtain
where is an indefinite integral of with respect to . Then (??) leads to In practice, we prefer one way to the other depending on which integrations are easier to perform.Two Examples
(a) Reconsider (??), that is, suppose and . We can choose and (??) becomes We can then choose and, by (??), obtain
(b) Next, consider the differential equation
In our notation Therefore, Hence the equation is exact (see Proposition ?? and Remark ??).It is easier to compute than . We choose and (??) becomes Now we use (??) to obtain Solutions of the differential equation (??) lie on level sets of . In particular, the solution determined by the initial condition satisfies since . To see the qualitative behavior of the solutions we use the following sequence of MATLAB commands
[t,x] = meshgrid(1:0.02:3,0.5:0.01:1.5);The result is shown in Figure ??.
F = t.^2.*(x.^2-1) + t.*x.^6 + x.^3;
cs = contour(t,x,F,[0,3,6,9,12]);
clabel(cs)
hold on
plot(2,1,’o’)
xlabel(’t’)
ylabel(’x’)
Exercises
In Exercises ?? – ?? determine whether or not the given differential equations is exact.