• No results found

Appraisal of the Algorithm

Given appropriate input, theSolve odealgorithm finds the general solution to many first order differential equations found in textbooks on ordinary dif-ferential equations. In addition, another approach for the integrating factor and special techniques for homogeneous equations and Bernoulli equations that extend the capacity of the algorithm are described in Exercises4, 6, and Exercise16on page241. However, compared to the differential equa-tion solver found in a CAS, the algorithm is quite limited. The operators in these systems include additional techniques for many special forms and other general techniques15.

In some cases the implicit solution that is found by our algorithm does not describe all solutions to the differential equation.

Example 4.17. Consider the differential equation dy

dx = 2 x y2 (4.50)

given in Example4.10. Our algorithm finds the solution in the form−x2 1/y = C which has the explicit form y =−1/(x2+ C). Observe that y = 0 is also a solution of the differential equation, but does not fit the general pattern. This solution, which is not found by our algorithm, is called a singular solution of the differential equation.  In order for the MPL algorithm to produce an appropriate result, the input differential equation must have a form that can be analyzed correctly

15In the Maple system, to see the methods used by the dsolve command, assign infolevel[dsolve] := 3. Try this for the differential equation

dy

dx=x + y + 4 x− y − 6

that cannot be solved by the algorithm in this section (including the additional tech-niques in the exercises), but which can be solved by Maple.

by theTransform odeprocedure. A suitable form is one that can be trans-formed by the operations in lines 1 and 2 of this procedure to a form where the actions of theCoefficient operator in lines 3 and 4 are well-defined and able to obtain the entire structure of the equation. If this is not so, the output of the algorithm may be meaningless. For example, for the equation

dy dx

1/2

+ x = y,

the expression n = (d(y, x))∧ (1/2) + x − y at line 2 is not a polynomial in d(y, x) and so the coefficient operations in lines 3 and 4 are undefined. In addition, for differential equations that contain higher order derivatives or an integer power of a derivative, the coefficient operations may be defined but the output is meaningless since the algorithm does not apply to equa-tions that include these forms. It is possible to modify Transform odeso that is does a more thorough analysis of the input equation to determine if the equation has an appropriate form (see Exercise14on page240).

Exercises

1. Consider the differential equation

(2y− x2) + (2x− y2)dy dx = 0.

Solve the equation using the algorithm in the text.

2. Consider the differential equation (y− 1/x)dy

dx+ y/x2= 0.

(a) Show that the equation is exact.

(b) Show that the manipulations in theTransform odeprocedure trans-form the equation to a non-exact equation.

(c) Show that theSolve exactprocedure can find the solution to the new equation obtained in part (b) by finding an integrating factor.

3. Consider the differential equation 1

x3y2 + 1

x2y3 + 3y dy dx= 0.

(a) Show that the equation is exact.

(b) Show that the manipulations in theTransform odeprocedure trans-form the equation to a non-exact equation.

(c) Show that the Solve ode procedure is unable to solve this equation because it is unable to find an integrating factor for the equation in part (b). (However, see Exercise4.)

4. Let R = (∂M/∂y−∂N/∂x)/(N ·y −M ·x) and suppose that R is a function of the product x y. In this case, it can be shown that for z = x y,

u(x, y) = exp R(z) dz

is an integrating factor16. For example, for the differential equation y + (x + 3x3y4)dy

dx = 0, x > 0, y > 0,

we have R =−3/(x y) = −3/z and u = 1/(x y)3. Extend theSolve exact procedure so that it determines when this integrating factor is appropriate and when this is so, uses it to find a solution. Test the procedure on the above equation. Hint: Let S =Substitute(R, x = z/y). If R has the proper form, then S is free of y.

5. Give a procedure Separable ode(M, N, x, y) that tries to determine if a differential equation (4.32) can be transformed to the form of Equation (4.30), and, when this is so, obtains an implicit solution using the separable approach. If this technique does not apply, return the global symbol Fail.

Hint: The Separate variables procedure described in Exercise13 on page 152is useful in this exercise.

6. A differential equation that can be transformed to the form dy

dx= f (y/x) (4.51)

is called a homogeneous17 differential equation. For example, the equation dy

dx= exp(y/x) + y/x

is homogeneous. A homogeneous differential equation can be solved by defining a new variable z = y/x and transforming the differential equation to one in terms of z. Using the relation y = x z, we have

dy dx = xdz

dx+ z and Equation (4.51) becomes

dz

dx= (f (z)− z)/x. (4.52)

This equation can be solved by separating the variables x and z. Then, we obtain the solution to Equation (4.51) by substituting z = y/x into the solution to Equation (4.52). Give a procedure Homogeneous (M, N, x, y)

16See Simmons [87], Exercise 1 on page 59.

17The term homogeneous has a number of meanings with regard to differential equa-tions. For example, two different meanings are given in Exercises6and7.

that determines if a first order differential equation (4.32) is homogeneous and, if so, solves the equation using the approach outlined above. If the equation is not homogeneous, return the global symbol Fail. Hint: First, represent the differential equation in the form

dy

dx=−M/N,

and let r =Substitute(f, y = z x). If r is free-of x, the original equation is homogeneous. Note that the equation

dy

dx= x + y x− y

is homogeneous (divide the numerator and denominator by x). In this case r = (x + x z)/(x− x z), and so we must apply aRational simplifyoperator to r to remove the x.

7. Consider the second order linear differential equation ad2y

dx2 + bdy

dx+ c y = f, (4.53)

where a, b, and c are rational numbers and f is analgebraic expression that is free of y.

(a) If f = 0, the equation is called a homogeneous17 equation and two linearly independent solutions to the differential equation y1 and y2 are obtained as follows: let D = b2− 4ac. If D > 0, then

Homogeneous 2(a, b, c, x) that returns the list [y1, y2].

(b) A particular solution yp to Equation (4.53) is obtained using the method variation of parameters. Using this technique, yp = v1y1+ v2y2 where y1 and y2 are the two linearly independent solutions to the homogeneous equation (described above) and the derivatives v1 and v2 satisfy the linear system

v1y1+ v2y2= 0, v1y1+ v2y2 = f /a.

The expressions v1 and v2 are obtained from their derivatives by integration. Give a procedure Variation of param (y1, y2, f, a, x) that obtains yp.

(c) The general solution to the differential equation is given by

y = d y1+ e y2+ yp, (4.54) where d and e are symbols that represent arbitrary constants. Give a procedure Solve ode 2 (a, b, c, f, x, y) that obtains the general solution to Equation (4.53). You should return the result as an equation y = u where u is the expression on the right side of Equation (4.54). A related operator is considered in Exercise15on page240.

8. See Exercise14on page240and Exercise16on page241.

Further Reading

4.2MPL’s Algorithmic Language. The Taylor series solution to a differential equation described in Exercise 17on page 154 is discussed in Zwillinger [109], Section 140. See Sconzo et al. [86] for a discussion of the classical hand calculation of F and G series (see Exercise18 on page155) and a summary of the results obtained with a CAS.

4.3 Case Study: Solution ofFirst Order Ordinary Differential Equa-tions. The techniques used in this section are described in Simmons [87], Boyce and DiPrima [12], and Derrick and Grossman [32]. Zwillinger [109] and Mu rphy [72] describe many techniques for finding analytical solutions to differential equa-tions. Postel and Zimmermann [81] summarizes techniques for solving differential equations in a computer algebra context.

5