Computer Physics Communications ELSEVIER
Computer Physics Communications 113 (1998) 239-260
Symmetries and first order ODE patterns E.S. Cheb-Terrab a,b, A.D. Roche c a Department of Mathematics, University of British Columbia, Vancouver, Canada b Symbolic Computation Group, Department of Theoretical Physics, State University of Rio de Janeiro, Rio de Janeiro, Brazil c Symbolic Computation Group, Computer Science Department, Faculty of Mathematics, University of Waterloo, Ontario, Canada Received 27 March 1998; revised 8 June 1998
Abstract A scheme for determining symmetries for certain families of first order ODEs, without solving any differential equations, and based mainly in matching an ODE to patterns of invariant ODE fitmilies, is presented. The scheme was implemented in Maple, in the framework of the ODEtools package and its ODE-solver. A statistics of the performance of this approach in solving the first order ODE examples of Kamke's book (E. Kamke, Differentialgleichungen: Lrsungsmethoden und LOsungen (Chelsea, New York, 1959)) is shown. © 1998 Published by Elsevier Science B.V. Kew'ords: First order ordinary differential equations; Symmetry methods; Symbolic computation
PROGRAM SUMMARY Title of software package: Extension to the Maple ODEtools package Catalogue identifier: ADIP Program Summary URL: http://www.cpc.cs.qub.ac.uk/cpc/summaries/ADIP Program obtainable from: CPC Program Library, Queen's University of Belfast, N. Ireland Licensing provisions: none Operating systems under which the program has been tested: UNIX, Macintosh, Windows (95/NT) Programming language used." Maple V Release 4 and 5
No. of bytes in distributed program, including test data. etc'.: 56012 Distribution format: uuencoded compressed tar file Keyword~: First order ordinary differential equations, symmetry methods, invariant ODE patterns, symbolic computation Nature of mathematical problem Analytical solving of first order ordinary differential equations using symmetry methods. Methods of solution Matching ODEs to the patterns of a predetermined set of invariant ODE families. Restrictions concerning the complexity of the problem The computational scheme presented works when the input ODE has a symmetry of one of the forms considered in this work. This set of symmetry patterns can be extended, but there are symmetry patterns fi)r which the ideas of this work cannot be applied.
Memory required to execute with typical data: 16 Megabytes 0010-4655/98/$19.00 (~) 1998 Published by Elsevier Science B.V. All rights reserved. PII S001 0-4655 ( 9 8 ) 0 0 0 7 1 - X
240
E.S. Cheb-Terrab, A.D. Roche~Computer Physi,:s Communications 113 (1998) 239-260
Typical running time The methods being presented were implemented in the framework of the ODEtools Maple package. On the average, over Kamke's l l] first order nontrivialexamples (see Section 5), the ODE-solver of ODEtools is now spending ~ 5 seconds per ODE when successjhl, and ~ 20 sec. when unsuccessjul. When considering only ODEs of first degree in y~, these timings drop by 50~. The timings of this paper were obtained using Maple R5 on a Pentium 200 - 128 Mb of RAM - running Windows95. Unusttal ~¢batures ~" the program The computationalscheme being presented is able to find symmetries by matching a given ODE to the patterns of a varied set of invariant ODE families. When such a symmetry exists, the routines can explicitly determine it, without solving any differential
,~quations, and use it to return a closed form solution without requiring further participation from the user. The invariant ODE families that are covered include, as particular cases, more than "70% of Kamke's first order examples, as well as many subfamilies for which there is no standard classification. Many of these subfamiliescannot be solved by using other methods nor by ODEs:olversof other computeralgebra systems. The combinationof this ~ymmetry & pattern matching approach with the standard classification methods of the ODEtools package succeeds in solving 94% of Kamke's first order examples. F~eJerences [liE. Kamke, Differentialgleichungen:L6sungsmethoden und L0sungen (Chelsea, New York, 1959).
LONG WRITE-UP
1.
Introduction
One of the most remarkable aspects of Lie's method of symmetries for differential equations (DEs) is its generality; roughly speaking, all solving schemes for DE's can be correlated to particular forms of the corresponding symmetry generators [ 1,2]. However, from a practical point of view, the problem of determining symmetry generators for a given nth order ODE is not trivial: one needs to solve a related determining nth order P D E in n + 1 variables for the components of the infinitesimal symmetry generator (infinitesimals) [3]. The usual strategy for tackling this determining PDE consists of restricting the cases handled to the universe of ODEs having point symmetries, so that the infinitesimals depend on just two variables, and then the determining PDE splits into a system of PDEs. Although solving such a PDE system may be a major problem in itself [4], the hope is that one will be able to solve it by taking advantage of the fact that it is overdetermined. For first order ODEs, however, this strategy of splitting the determining PDE is inapplicable, so that in this case most of the computer algebra implementations of Lie methods just do not work. A computational alternative to this situation was presented in two recent works [5], where the authors explore different ideas for finding particular solutions for an unsplit determining PDE, and use these ideas to tackle first and second order ODEs. Although the performance obtained with that approach is good I, those works did not explore the fact that by imposing certain restrictions on the form of the infinitesimals, these can be determined directly in closed form [7]. In such cases, the search for symmetries can be reduced to matching an ODE to (predetermined) invariant ODE patterns. Bearing all this in mind, this paper develops an approach for finding symmetries based on matching a first order ODE to the patterns of a selected set of invariant ODE families. Nine different symmetry patterns were considered. Concretely, the scheme consists of analyzing an input ODE in order to determine if it belongs to one of these nine ODE families, and if so determine the symmetry, all without solving any auxiliary differential equations. Due to the simplicity and generality of the scheme, it appears to us appropriate for a computer algebra implementation in the framework of ODE solvers and we have implemented it in Maple R5. Other relevant features of the scheme are - the determination of the symmetries of the types considered, when they exist, is systematic; - the scheme works at a remarkably high speed (see Section 5); I Symmetries for more than 85% of Kamke's first order ODE examples [6] were found by looking for particular solutions to Eq. (2) in 15l.
241
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
- a good variety of first order ODEs is covered, including families not solved by other methods or ODE-solvers (see Sections 4 and 5) and 73% of the examples in Kamke's book [6]. The exposition is organized as follows. In Section 2, symmetry methods for first order ODEs are briefly described. In Section 3, the main ideas developed in this work are summarized and some basic concepts are introduced. In Section 4, the computational schemes for obtaining the aforementioned symmetries of various different types are presented and some examples are given. Section 5 contains statistics concerning the performance of the new scheme with the first order examples of Kamke's book, as well as a brief discussion about the symmetries of these examples and their use as a testing arena for ODE-solvers. Finally, the conclusions contain general remarks about this work and its possible exten,;ions.
2. Symmetry methods for 1st order ODEs
Generally speaking, given a first order ODE, y' : ,~'(x, y ) ,
(1)
the key point of Lie's solving method is that the knowledge of a (Lie) group of transformations leaving Eq. ( 1) invariant reduces the problem of finding the equation's solution to solving a line integral or a quadrature [ 1,2]. Despite the subtleties which arise when considering different cases, we can summarize the computational task of finding a Lie symmetry of Eq. (1), as the finding of a pair of functions [ ( ( x , y), r/(x, y ) ] satisfying fix + (fly - (x) q~ - (y cI92 - (';Ox - r/g,y = O.
(2)
Once a solution to Eq. (2) is found, one can either look for the canonical coordinates, say {r, s ( r ) } , of the associated Lie group, to be used to reduce Eq. (1) to a quadrature; or, alternatively, one can work directly with the original variables and use the expressions found for [ ( ( y , ~:), r/(y, x)] to build an implicit form solution in terms of a line integral [ 1 ], d y - q5 d x
r/~-~-~
- constant.
(3)
Despite the generality and apparent simplicity of this scheme, the problem is that there are no general rules which might help in solving Eq. (2), and hence Lie methods are generally viewed as not useful for tackling first order ODEs. The same happens with high order linear ODEs, for which particular solutions are also symmetries, so that their determination is usually considered as difficult as solving the original problem.
3. Symmetries and first order ODE patterns
The starting point of this work is the observation that, in some cases, the knowledge of the form of the invariant ODE family associated to a symmetry pattern allows one to determine symmetries for any member of the family by just performing algebraic operations [7]. For example, the general Bernoulli ODE, y' = f ( x ) y
+ h ( x ) y '~ ,
(4)
where f and h are arbitrary functions of x, is the invariant ODE family associated to the symmetry pattern, [~ = O, rl = y ~ e ~l-~) f f(x)dx] ,
and in this case, f ( x ) inspection.
(5)
and a - and thus the symmetry - can be obtained from a given Bernoulli ODE just by
E.S. Cheb-Terrab. A.D. Roche~Computer Physics Communications 113 (1998) 239-260
242
The idea then was to consider the possible determination of symmetries by just performing algebraic operations, but for more general invariant ODE families 2 . For example, Eq. (5) is a particular case of the symmetry pattern [¢ = O, ~7 = F ( x ) G ( Y ) ] ,
(6)
to which corresponds the invariant ODE family Y
y = 7-((x) G(Y) + .~,G(Y) F(x-----Y-I d aG(a) '
(7)
where .Y', G and H are arbitrary functions of their arguments. The ODE family (7), for instance, includes as particular cases ODEs of type separable, linear, Bernoulli, some Riccati and Abel subfamilies, etc., but mainly many other ODEs for which there is no classification nor specific solving methods available. As we show below, determining if a given ODE is of the form of Eq. (7), including in that calculating .Y" and G, is as systematic (though not so straightforward) as in the Bernoulli ODE example above. We then started considering whether it would be possible to set up a computational scheme for first order ODEs, based on Lie's theory, but organized, as in the simplest cases, just around some pattern matching routines. At this point, two questions arose: the knowledge that the ODE matches the required pattern may or may not allow one to get the symmetries by performing only algebraic operations (see Section 3.2); from a practical point of view, the efficacy of a first implementation of the ideas being presented would depend on a convenient selection of a set of symmetry patterns and related invariant ODE families. After analyzing the symmetries of Kamke's 576 first order ODE examples and taking into account practical issues (see discussions in Section 4), our selection tbr the set of symmetry patterns to consider at first was -
-
[ ( = F ( x ) G ( y ) , r / = 01,
[ ( = O, ~1 = 7 ( x ) G ( y ) ] ,
[(=F(x)
[(=0,
[(
+G(y),
= Y'(x),
[(= F(x), [(=ax
r/=0],
7l = F ( x ) + G ( y ) ] ,
7(:~,),
~ = ~(x)],
[( =
r / = G(Y)] ,
[(= F(y),
~7 = G ( y ) ] ,
(8)
r/= G(x)],
+ by + c , r]= f x + gy + h] ,
where .T" and G are arbitrary functions and (a, b, c, f, g, h} are arbitrary constants. For the first eight symmetry patterns, it was possible to set up a pattern matching routine, mainly determining whether or not a given ODE matches one of the related invariant ODE families, and if so directly return the symmetry by performing only algebraic operations. For the pattern [ ( = ax + by + c, rl = f x + gy + hi, we took advantage of the natural splitting of the determining PDE into an overdetermined linear system of algebraic equations. Concerning the patterns [ ( = .Y'(x) + G ( y ) , r / = 0] and [ ( = 0, r / = F ( x ) -I-G(y)], they do not contribute to solving Kamke's examples, but we added them for generality; we noted that the related invariant ODE families have practically no intersection with those of the other patterns. 3.1. Invariant ODE families One of the key concepts of the solving strategy being presented is that of an invariant ODE family, that is, the most general ODE - say H ( x , y, y') - having a given symmetry. Given a pair of infinitesimals [~, r/], a related invariant family H ( x , y, y'), by its own definition [1,2], must satisfy 2 This idea of looking for symmetries by performingjust algebraic operations is in fact already present in 171. However, in 17], algorithms themselves are not explicitly shown, and the symmetry patterns considered are fewer and do not have the generality of those discussed in this work.
E.S. Cheb- Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
X ( H ) = 0,
243
(9)
where X is the infinitesimal generator so that X ( H ) =- £Hx + oTH). + rljHy,, and r/i is the first extension of r/. The solution to Eq. (9) can always be writtenas H=G(lo(x,y),
ll(X,y,y')),
(1o)
where G is an arbitrary function and I0 and 11 are the so-called differential invariants (the constants of integration of the characteristic strip associated to Eq. (9)) of order zero and one, respectively. An explicit invariant ODE family can then be obtained by solving for y' the equation I1 (x, y, y') = K ( l o ( x , y ) ) , where K is an arbitrary function. Alternatively, one can determine these invariant families directly in explicit form, by just solving Eq. (2) for q~ (Eq. (2) is actually Eq. (9) modulo y ' = g'). 3.2. ODE symmetries front the knowledge of the invariant family
For each symmetry pattern in Eq. (8) we have formulated the finding of the related invariant ODE family, and then studied how to obtain the infinitesimals in terms of ~, departing from these explicit expressions for the invariant families (see Section 4). Each symmetry pattern, and hence each invariant ODE family, defines a symmetry class. We have found that for most of the symmetry classes in Eq. (8) one can formulate a differential operator which, when applied to an ODE member of the class, yields an expression separable by product in x and y. In turn, this separability leads to the function parameters entering the infinitesimals ( and r]. Concerning the necessary and sufficient conditions for an ODE to be in one of these classes, the aforementioned separability provides a necessary condition by construction. In some cases, the only solution ~P to this separability condition is just the right-hand side of the invariant ODE family, so that this separability is also sufficient. When this condition implies an ODE family more general than the invariant family, we use Eq. (2) to provide the sufficiency (see the discussions concerning each symmetry pattern in Section 4). An interesting question at this point is for what symmetry classes do such operators leading to expressions separable by product exist; or more generally: when is it possible to determine the symmetries by just performing algebraic operations. Unfortunately, this appears to be a nontrivial question. One thing is clear, however: if the class is too general, it may be impossible to construct such a useful operator, and then the knowledge of the form of the invariant ODE family will be of no help in determining the symmetries. For example, the general Riccati ODE Y' = f z ( x ) Y 2 + f l ( x ) Y + f o ( x )
(11)
is the invariant ODE family associated to the symmetry pattern [~ = O, ~ = F ( x ) ( y - H ( x ) ) 2] ,
(12)
but to determine F and H in terms of given f2, fl and f0 one needs to solve the given Riccati ODE itself. Actually, the invariant ODE family associated to Eq. (12), expressed in terms of F(x), H(x) and an arbitrary function G ( x ) is given by y, = G y2
( F' + 2GHF) FH' + FIH + GFH 2 F Y+ F
(13)
Equating coefficients with Eq. (11) and solving for F' and H ~, one arrives at H' = f2 H2 + H f l + f o ,
F' = - 2 f z H F - f l F.
(14)
E.S. Cheb-Terrab, A,D. Roche~Computer Physws Communications 113 (1998) 239-260
244
The first of the equations above is just the original Riccati for H. Alternatively, solving the second of the equations above for H and substituting into the first one we obtain a second order nonlinear ODE for F; integrating factors for this ODE in F can be found by solving an auxiliary second order linear ODE. In turn, that linear ODE is just the adjoint of the linear ODE one would obtain directly from the Riccati one by using standard transformations explained in textbooks. In summary, unless extra information is provided - the class is too general - determining symmetries for the Riccati ODE requires solving the ODE itself. On the other extreme, for ODEs of types separable, linear and inverse-linear (see Section 3.3) the patterns and corresponding symmetries are really easy to determine; a little subroutine for them was prepared separately, and the computer routines for the patterns of Eq. (8) work assuming that the given ODE is not of one of these types. 3.3. Inverse ODEs and inverse symmetries
In the following sections, we will make use of the concepts of inverse ODE and inverse symmetry to simplify the task of identifying an ODE as a member of the classes implied in Eq. (8). For convenience, we introduce these concepts and notation here. Definition 1. We define the inverse of an ODE as the result o f applying to it the change o f variables x -+ y * ( x * ) ,
y ( x ) ~ x*,
(15)
and then renaming y* as y and x* as x. For example, the inverse of the first order ODE y~ = q~(x, y) is the ODE y ' = 1 / @ ( y , x ) .
Definition 2. For a given ODE class - say A - we will denote ODEs which are inverse to ODEs in A as ODEs o f class inverse-A. For example, we denote the following ODE family as first order inverse-linear: y' -
1 a(y)x+b(y)
(16)
Definition 3. We define the inverse o f a point symmetry [sO(x, y), r/(x, y) ] as [r/(y, x), ( ( y , x) ] ; that is, as the result o f applying to it the change o f variables (15), followed by renaming the variables as in Definition 1. We note that, to obtain this inverse symmetry, the change of variables is actually applied to the whole differential operator ( ~ + ~7~. Consequence, The inverse o f a symmetry of a first order ODE is a symmetry o f the inverse o f the ODE.
Definition 4, We define an arbitrary or "unknown" computational function as a function whose differentiation rule is unknown to the computer algebra system.
4. The algebraic determination of the symmetries 4./. The symmetry patterns [se = . T ' ( x ) G ( y ) , rl = 0] and [~ = O, r1 = .T'(x)~(y) ]
Starting with the symmetry pattern [ ( = . T ( x ) G ( y ) , ~/= 0], the purpose is to determine whether a given ODE has a symmetry of this form, and if so, to determine b~'(x) and G(y). In order to avoid integrals in the pattern for the invariant ODE family, we rewrite the symmetry in terms of new arbitrary functions f and g, without loss of generality, using .T'(x) = f~-~ and G(y) = e x p ( f g ( y ) dy), [ ( = e f g(r) " dr~ H xr",
r/=0].
(17)
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Co.,nmunications 113 (1998) 239-260
245
The related invariant ODE family is then given by
fx y' = @ ( x , y ) ~ g ( y ) f ( x )
4-J(y)
'
(18)
where J is an arbitrary function of y. Proposition 1. A necessary condition for an ODE to have a symmetry of the form [ ( = 9 r ( x ) G ( y ) , ~7 = 0] is that applying the following formula 3 to qb yields an expression separable by product 4 in x and y: 1 02 (ln(@)) _ g(y)ffy - g y J ( y ) 42 Ox cTy fx
(19)
For such an ODE, the factors in Eq. (19) containing x give 5t-, and g can be expressed in terms of q' and 5r by taking the appropriate derivative, .T~x
(20)
=g(y).
Proposition 2. A first order ODE y' = ~ ( x , y) has a symmetry of the form [~ = . ~ ( x ) G ( y ) , r/ = 0] if and only if Eq. (19) is an expression separable by product in x and v, and Eq. (20) is an expression only depending on y. Proof. By construction, the whole class Eq. (18) satisfies Eqs. (19) and (20). Conversely, by solving Eq. (20) for @(x, y), with 5r given by 1 / f x as determined in Eq. (19), one arrives at the invariant ODE family (18). Once the problem of classifying an ODE as member of this family and finding a symmetry for it is solved, the ODE's solution, in terms of.Y" and 9, is given by
C~ -
! f~dx ~(y----~
Y
+ j[J(a) ~(-~da=O,
(21)
where 27 can be expressed in terms of 5t-, G and ~/' from Eq. (18).
Example: (y+b) 2 y'=q~(x,y) =
(x+a)
(l+(y+b)2(x+a)sin(y))
'
(22)
For this ODE, Eq. (19) gives an expression in which the variables separate by product 1 02 ( I n ( q 0 ) q~2 OxOy
((y+b) cos(y)+2sin(y))(x+a) (Y + b) 3
2 (23)
So fl" = (x 4 - a ) 2, and from Eqs. (20) and (17) ~ = e (-l/(;'+b)~, that is, an expression only depending on y. Hence, this ODE has the symmetry [ ( = .,V(x)G(y), r / = 0], and from Eq. (21) its solution is given by
/ Ci --
Y
e - -
(l/l~'~bl)
s i n ( z ) e ~'/~:+~''dz +
x4-a
= O.
3 For convenience of exposition we are using ~o2 (In(@)) as a shortcut for ~I ( @x,y@- @x@y) . 4 When Eq. (19) is zero, the ODE as a whole is already separable.
(24)
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
246
The symmetry pattern [~ = 0, rt = .T'(x)G(y)] is in fact the inverse symmetry of [ ( = ~(x)Sr(y), r/= 0], and its related invariant ODE family, 3" - Jr(x)
Jrx
da + 7-((x)jr(x)
,
(25)
where 7-[ is an arbitrary function of x, is the inverse of Eq. (18). Hence, by transforming Eq. (25) using Eq. (15), the resulting ODE wilt have a symmetry of the form [( = G(x*)jr(y*), 7"/= 0], which can thus be determined using the scheme just outlined. Returning to the original variables, we obtain the symmetries for Eq. (25).
4.2. The symmetry patterns [~ = Jr(x) + G(Y), r/= 01 and [~ = O, rl = ~ ( x ) + G(y) ] The ODE family invariant under [ ( = Jr(x) + G(y), r/= 0] is given by
V, =q~(x,y)== [(G~. / (G(Y) +dxf i ( x ) ) 2 - J ( Y )
•
) (9(Y) + S t ( x ) ) ] - ' '
(26)
where Jr, G and ,.7 are arbitrary functions of their arguments. To determine if a given ODE matches the pattern above, we first note that Eq. (26) satisfies 5 02 q) ~ (45-') -
.T'xx ~(y) + U(x)
(27)
Hence, by differentiating the reciprocal of Eq. (27) w.r.t, y, we arrive at a necessary condition: Proposition 3. If an ODE has a symmetry of the form [( :-- Jr(x) + G(Y), r/= 0] then the following formula in terms of qb yields an expression separable by product in x and y:
a ay
4,
0-~
(4,-')
(28)
= £,'
Now in Eq. (28), the factors depending on x give the reciprocal of Jrxx, from where we obtain Jr(x) + G(y) by just dividing the expression found for .~'x~ by the right-hand side of Eq. (27). Proposition 4. k sufficient condition for the ODE y' = ~ ( x , y ) to have a symmetry of the form [( = Jr(x) + G ( Y ) , r/= 0] is that the expression obtained above for Jr(x) + G ( y ) satisfies the determining PDE equation (2), which we rewrite here in terms of Jr(x) + G(y) as (jr(x)+G(y))~
q'-~i~2~yy J r ( X ) + G ( y )
=0.
(29)
Proof. By construction, the whole class Eq. (26) satisfies Eq. (28); by definition, any solution to Eq. (29) the determining PDE of the problem - is a symmetry of Eq. (26). The solution for any member of the family (26), in terms of Jr + G, is then given by x
Cj +
y
.T'(a) + G(Y) +
J ( a ) da = 0,
5 When Eq. (27) is zero, the ODE is already of type "invert-linear".
(30)
E.S. Cheb-Terrab, A.D. Roche/Computer Physics Communications 113 (1998) 239-260
247
where J can be expressed in terms of f" + G, ~y and q5 from Eq. (26). As in the previous section, the symmetry pattern [sc = 0, r/ = U(x) + G(y)] is the inverse of [sc = ~7(x) + 5r(y), "q = 0], and its related invariant ODE family, y)=
(/ .T'x
(G(Y) +.T'(x)) 2 +7-((x)
)
(G(Y) +.Y'(x)
,
(31)
where 7-/ is an arbitrary function, is the inverse of Eq. (26) By transforming Eq. (31) using Eq. (15), the resulting ODE will have a symmetry of the form [~ = G(x*) + :~'(y*), 7/= 0], which can thus be determined using the scheme just outlined.
Example: f =3
(x_~) 1+
arctan
(y)I-2y + - -
X
+
(l-3y)x v2
(32)
We apply the algorithm to the inverse ODE, yx 2
y r = q ~ ( x , y ) - = 3 y ( x 2 + y 2 ) arctan(x/y) + y 2 ( l - 3 x ) + x
2(1-2x)
(33)
Eq. (28) gives an expression in which the variables separate by product, a 0y
~b
3-~
(q5-1)
-
(34)
3y 3"
Hence, from Eqs. (27) and (28),
U ( x ) + G(y) -
x 2 + y2 2y2x 2 ,
1 ~y = ~-~.
(35)
Using these values, Eq. (29) is identically satisfied, so that Eq. (33) has the symmetry [ ( = l / y 2 + l / x 2, rl =0]
(36)
and hence Eq. (32) has the inverse symmetry [( = 0, r/= y-2 __ x-2]. Finally, using Eq. (30) and changing variables back, the solution to the original ODE equation (32) is. given by C 1
+x2 ( - 2 y +
2xarctan (xY-) + 1 ) = 0 .
(37)
4.3. The symmetry patterns [~: = 5C(x), r/= 7-/(x) ] and [sc = G(y), r/= ,.7(y) ] The invariant ODE family associated to [( = 5V(x), r/= 7-[(x)] is given by l ( y ' = @ ( x , y ) =- U ( x ) ~ ( x ) + K
(fT-~(x))) y-ju(x)
dx
,
(38)
where 5t', 7-[ and K are arbitrary functions of their arguments. To determine 5t-(x) and ~ ( x ) we first build an expression depending on x and y only through K,
dx
~
- K)~s .
(39)
248
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
At this point, the cases Qy 4= 0 and Qy = 0 must be considered separately. When Qy ~ 0, we can obtain the ratio ~ ( x ) / U ( x ) just by taking T~
Qx_ Q~.
~(x) .T(x)
(40)
Proposition 5. If an ODE belongs to the class Eq. (38) and Qy va O, the knowledge of T is sufficient to obtain explicit expressions for the symmetry parameters ~ and 7~. Proof. In the determining PDE equation (2) for the problem 7-gx - 5~q ~ - 5r(x)rbx - 7-((x)q~y = 0,
(4l
we remove 7-[ and introduce T using Eq. (40), (Tx + q°x - T ( x ) qOy) 7 ( x ) + ( T ( x ) + qs) 9vx = 0,
(42)
from where .Y" is given by
Setting the integration constant Cj = 1 without loss of generality and using this result in conjunction with Eq. (40), we obtain 7-/(x). Consequence. From Eqs. (40) and (43), necessary and sufficient conditions for an ODE to have a symmetry of the form [ ( = . Y ' ( x ) , r / = 7-((x)] when Qy v~ O are (Ox~= ey \ Q y J
0
'
a (r(x)~,,-~.-<) ~y \ -~_~-~)
=0.
(44)
Proposition 6. The condition Qy = 0 • sufficient to ensure that the ODE has a symmetry of the form [ ( = Y'(x), rt = 7-t(x)].
Proof. We note that Q satisfies QY-
F(x) 7if(x) Qx,
(45)
which implies that, when Qy = 0, Qx = 0 too, so Q is a constant C1. The right-hand side of the invariant ODE family (38) is then restricted to the solution q5 of (see Eq. (39)) qsy = C1 , q~y:.
(46)
hence Eq. (38) - the invariant ODE family - becomes y' = ~P = A ( x ) + B ( x ) e y/c~ ,
(47)
where A and B are arbitrary functions. For a given ODE of this type, A and B can be determined by inspection, and the determining PDE for the infinitesimals [.Y'(x), 7-g(x)] naturally splits up into a system of two equations for U and 7-/, CIU(x)B~. 7~(x) = 0 , B 7-[x - .~xA - ~ ( x ) A x = 0. -Cn 5"x
(48) (49)
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
249
This system is easily solved for .Y'(x) as
e-f(A/Cl'dx( / ef(A/Cl)dadx + C3) , B C2 B
F(x) -
(50)
where (?2 and C3 are arbitrary constants. Substituting this result for F into Eq. (48) we obtain 7-/. We note here that the family of infinitesimals above parameterized by C2 and C3 is wider than what is necessary to integrate Eq. (47). So, without loss of generality, we choose Cz = 0 and C3 = 1, to finally obtain
e- f (A/G)dx
F(x) -
B
,
~(x) =AF(x).
(51)
Once the problems of classifying an ODE as member of this. family and determining a symmetry for it are solved, the ODE solution in terms of .Y" and 7-/ (A and B) is given by
Case Q3 = 0 Y=f
a(x) d x - C ~ ln ( ( C 2 - Jef~A~x)/c')dX B(x) dx) C~-~) .
(52)
Case Qy ~ 0
3'
C,+/(K(a_
{7-[(X) d x ) ) - l d a _
dx
5r(x )
_
0,
(53)
where from Eq. (38), K = @St(x) - ~ ( x ) . As with the symmetry patterns already discussed, the symmetry [ ( = G ( y ) , r/ = ,7"(y)] is the inverse of the symmetry [ ( = ,.7(x), [~= 9(y), ~ = J(y)],
y' =
r/ = ~ ( x ) ] .
Hence, symmetries for an ODE of the family invariant under
J(Y)
(54)
G(y) + K x ~ dy ( f G ( y ) ) ' can be obtained by applying the procedure just explained to the inverse ODE.
Example: A symmetry of the form [ ( = .Y'(x), r / = 7-/(x) ] for Kamke's first order ODE 84, y' = f ( a x + by).
(55)
For this ODE, Eq. (40) leads to a constant expression Qx
~(x)
a
Qy
F(x)
b
(56)
Since the conditions Eq. (44) are satisfied, Eq. (43) gives the first infinitesimal ~ = F ( x ) = 7-[(x) = - a / b , and using Eq. (53) the solution to the ODE follows as
= 1; hence
3'
b
CI+ f a+bf(ax+bz)
dz - x = O.
Example: An ODE with symmetry of the form [ ( = G(y), r / = J ( y ) ], y2 yt = sin(y - x) - x 2 + 2xy "
(57)
(58)
E.S. Cheb-Terrab, A.D. Roche~Computer Phy,6cs Communications 113 (1998) 239-260
250
Applying the procedure presented to the inverse ODE,
y' = 4o( x, y) =_
_y2 + 2 x y - s i n ( y - x) x2 ,
(59)
Eq. (40) gives Qx Q,
7-/(x) -
-
-1.
(60)
Y(x)
So, from Eq. (43), .U = x 2 and ~ = x 2. Since Eels. (44) are satisfied, Eq. (59) has the symmetry [sc = x 2, r/ = x z] and hence Eq. (58) has the symmelry [ ( = y2, r/ = y2]. Finally, using Eq. (53) and returning to the original variables, the solution to Eq. (58) is given by ?,'--X
a2_sin(a) da+Cl=O.
-+ Y
(61)
4.4. The symmetry patterns [( = F ( x ) , r / = G ( y ) ] and [ ( = ~ ( y ) , r / = .T(x) ] Differently from the cases treated in the previous subsections, these two patterns [sx = F ( x ) , r/ = {7(y)] and [ ( = • ( y ) , r / = 5t-(x) ] are not inverses with respect to each other. In fact, the inverse of [~: = ~ ( y ) , r / = f ' ( x ) ] is [ ( = F ( y ) , r / = ~ ( x ) ] . So, the change of variables (15) will not translbrm the problem of finding [~" = ~ ( y ) , r/ = b r ( x ) ] into that of finding [ ( = .T(x), r/ = G ( y ) ] since sc remains depending on the dependent variable and r/ on the independent one. To handle both problems in general, two different schemes are required. There is however one situation in which a single scheme can determine a symmetry of either of these two types. Since this scheme is simple and suitable fi)r extensions, we concentrate the discussion on it at first and only discuss the general cases in the next subsection.
4.4. I. A scheme for ODEs with functions or non-integer powers involving both x and y To start with, by rewriting the symmetry [ ( = F ( x ) , -r/:= G(y) ] in terms of new functions f ( x ) and g(y) as [ ( = l / f x , rl = - I / g y ] , we obtain the invariant ODE family as y=--
K(f(x)+g(y))-I
,
(62)
gY where f , g and K are arbitrary functions of their arguments. A departure point for matching a given ODE to the pattern above is based on the following observation: Proposition 7. l f a given ODE contains unknown functions 6 involving both x and y, then a necessary condition for the existence of a symmetry of the form [~ = P ( x ) , 71 = G(y) ] is that at least one of these functions - say M - is a function of f ( x ) + g(y), and then the ratio
Mx M,.
-
f., gy
(63)
is an expression where the variables x and y separate by product. Proof. As mentioned in Section 3, the invariant ODE family associated to a given pair of infinitesimals can be written as
I~ (x, y, y') = K ( l o ( x , y) ) 6 See Definition 4 in Section 3.3.
(64)
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
251
where I0 and It are the differential invariants of orders zero and one, and K is an arbitrary function of I0. In the case under consideration, ( = 1/fx, rl = - 1 / g y and
1o = f ( x ) + g ( y ) ,
ll -
fx
(65)
gyyl + fx
Since there are no functions in 11 simultaneously containing x and y, if a given ODE contains such functions, at least one of them must come from Io and thus be a function of the sum ( f + g). Hence, the ratio of the partial derivatives in Eq. (63) will result in an expression separable by product. Note that, in many cases, Proposition 7 will hold even with known functions and non-integer powers involving both x and y. However, from Eq. (62), for particular choices of K, f and g as knowrt functions, there may be factors of K ( f + g) which cancel with factors of fx/gy, making the determination of K ambiguous. An example of this situation can be seen by choosing f : x ~ e x p ( F ( x ) ) , g : y ~ e x p ( - G ( y ) ) and K : u ~ (u e x p ( - u ) - 1), where F and G are arbitrary functions. This separability is thus a necessary condition for the existence of the symmetry. Now, recalling that [sc = l / f x , ~7 = - l / g y ] , the factors in Eq. (63) containing x give ( - 1 , and the factors containing y give -r/. Finally, a sufficient condition for [(, 7/] to be a symmetry is that it satisfies Eq. (2).
Example: Kamke's first order ODE 85, y'-x"-'
yl--b 7-/ ( - ~ + ~ )
=0.
(66)
This ODE contains the unknown (arbitrary) function 7-/(xa/a + ya/b) and the ratio of its partial derivatives separates by product as in Eq. (63),
(7-[(xa/a + Yb/b))x = xa-~y t-b , (7"[(xa/a + yb/b))y
(67)
from where a pair of infinitesimals satisfying Eq. (2) is given by [sc = x I-a, r / = _ y l - l , ] .
(68)
Equivalent situations happen with other symmetry patterns too. For instance, when looking for symmetries of the form [ ( = G(Y), ~7 = )V(x)], rewriting the symmetry pattern as [ ( = gy, r/ = - f x ] , where g(y) and f ( x ) are arbitrary functions, I0 is given by
lo = f ( x ) + g ( y ) .
(69)
Hence, if a given ODE has this type of symmetry and contains unknown functions involving both x and y, one of them - say M - will satisfy Mx/M;. = fx/g:, and lead to the symmetry by separating the factors depending on x and on y.
Example: y'=-tan(arctan(y)
+~(x2+y2))
.
(70)
Here ~ depends on both x and y and the ratio of its partial derivatives separates by product
(7-((x2 + y2) )x (7--/(x 2 ÷ y2))y
-
fx gy
-
x y '
(7l)
E.S. Cheb-Terrab, A.D. Roche~ComputerPhysics Communications113 (1998)239-260
252
from where we get a pair of infinitesimals of the form [ ( = G ( y ) , r / = 5r'(x) ] satisfying Eq. (2), [(=
y,
r/=
-x].
(72)
Now, the two invariant ODE families, respectively associated to Isc = F ( x ) , r / = G ( y ) ] and [ ( = •(y), r / = .T'(x)], can be written in terms of an I0 of the form f ( x ) + g(y). Therefore, when there are functions o1" non-integer powers present in the given ODE, a scheme for finding symmetries of both types can be summarized as follows: (i) Select, in the given ODE, all functions and non-integer powers containing x and y. (ii) Loop over each of these mappings (M) by performing the following operations: (a) calculate the ratio R = M y / M z (b) when R separates by product, select the factors - say X - depending on x; - if IX, - X / R ] satisfies Eq. (2), return a symmetry of type [ ( = F ( x ) , 7/= G ( y ) ] ; - if I - R / X , 1/X] satisfies Eq. (2), return a symmetry of type Isc = G ( y ) , r/= .T'(x) ].
More symmetries from the differential invariant of order zero In the specific case in which Io is of the form A(x) + B l y ) , steps (iia) and (iib) of the scheme just outlined lead to symmetries of the form [ F ( x ) , G ( y ) ] and [G(y), F ( x ) ] . Now, (1) there are other symmetry patterns for which I0 has the form A(x) + B(y) and the knowledge of R and X (steps (iia) and (iib)) leads to the appropriate symmetry; (2) there are various ODE families for which I0 depends on x and y but not in the form of a sum of functions. In these cases R will not separate by product but its determination may lead to symmetries as well. As an example of (1), consider the symmetry pattern [( = Y(x)G(y),
~7 = l ] .
(73)
If we rewrite this symmetry in terms of new functions f ( x ) and g(y) as [-gy/f~, 1], lo and the invariant ODE family are given by
Io = f ( x ) + g ( y ) , v' "
fx K(lo)
gy
+
,
(74)
where K is an arbitrary function. Here R of step (iib) gives
R= (K(lo)),. (K(lo))x
-
gy fx
-
-s c ,
(75)
from where the symmetry is [ - R , l]. As an example of (2), consider the symmetry pattern and its equivalent format [so= 1, r/=.Y'(x) + yT-/(x)] =- [so= 1, r/= f ( x ) + y h x / h ( x ) ] .
(76)
Io and the related invariant ODE family are given by
y
lo - h ( x ~
f
f(x) (h(x))------~ ax,
y' = h(x)K(Io) +
f ( x ) + yhx h(x) '
(77)
where K is an arbitrary function. Here, step (iib) of the scheme summarized in the previous subsection gives a ratio which is not separable by product
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
R- (K(lo))y_ (K(lo))x
h(x) f(x)+yhx-
1 ~7'
253 (78)
but its determination leads to a symmetry of .the form [1, -l/R]. Moreover, in this case the factors - say X - d e p e n d i n g on x give the ratio itself, so that this s y m m e t r y is also o f the form [-R/X, l/X]. Hence, by removing the test for separability in step (iib), the scheme will automatically find symmetries for the invariant family (77) too.
Example: Kamke's first order ODE 433, (xy' + y +
2x)
2 -
4xy - 4x 2 - 4a = 0.
(79)
After isolating f , the routine detects the mapping (x, y) ~ X/'-fY + x2 + a involving both x and y, whose partial derivatives give the ratio R (not separable by product),
R = ( x/xy + x2 + a)y _ x ( X/xy + x2 + a)x y + 2x '
(80)
so that, after checking the cancellation of Eq. (2), according to step (iib) the scheme returns
(81)
[ ~ = 1, B = - x / ( 2 x + y ) ] .
4.4.2. The symmetry pattern [~ = .Y'(x), r / = ~ ( y ) ] (general case) We now turn to the formal problem of determining symmetries of the form [ ( --= .T(x), r/ = G ( y ) ] , that is, symmetries for ODEs belonging to the invariant family (62) in the general case. One of the first things we noticed is that our trials to exploit the knowledge of the form of the invariant ODE were unsuccessful. We then used the diffalg [8] and standard form [9] packages - two Maple packages for reducing PDE systems to a canonical form by basically adding integrability conditions and removing redundancies. After preprocessing the problem using these packages, it was possible to solve by hand the resulting system of PDEs in closed form, but the resulting intermediate and final expressions were huge in size. So, we worked on formulating the problem and a computational sequence of calculations so as to haw: almost reasonable-sized expressions in all steps. To start with, we considered a general first order ODE written as y' = e '~(~''') ,
(82)
where ~b(x, y) is an arbitrary function. The system of PDEs representing the problem of finding the infinitesimals consists of Eq. (2), together with two equations indicating the restrictions to the functional dependence of the infinitesimals ( and r/, ~.,.--(x--(q~x--~d/)y =0,
~3.----0, ~x---0.
(83)
We also set up a set of inequations entering our problem, given by
A(x,y)=-qbx.y 4 : 0 , sex va 0 ,
r/y 4: 0 ,
B(x,y)=qby,s+qbf
4:0,
C(x,y)=-dpx.x-qbx2 4 : 0 , (84)
respectively meaning that we assume Eq. (62) is not separable, nor linear, nor inverse-linear, and that we are only interested in the cases in which ~ effectively depends on x and ~? on y. The calculations are rather long and the intermediate steps present no particular interest. The results we obtained and the computational sequence of calculations we worked on can be summarized as follows.
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
254
Case I This case happens when D =-- [2Ax~ + &xAy - Ax(by + (&xdpy + 2 A ) A ] A - 3AxAy = 0.
(85)
Here, the necessary and sufficient conditions for the existence of a symmetry of the form [~: = 5 r ( x ) , r / = ~ ( y ) ] are
E, ==-3aZ + [ ( 4 ~ + 2 c ) a - Z A x x ] A
~ O,
& -- [2Ay~, + (2B - fb~)A]A - 3A~ = O, E3 =- [ (28Ax + 4&xA) A 3 - (fbyA + Ay) E1 ] Ej - 8A4EI ,x = 0.
(86)
When these conditions are satisfied, the symmetry is given by 72 = exp ( = -
(f
4(Ax-c~xA)A3+(~b~.A-A~,)E, " " 2AEt
dy) ,
4A3r/
(87)
Ez
Case I1 This case happens when D, defined in Eq. (85), is different from zero, and 2 (6AxAyyD + [ 6 A x D B - 3(b~AxD - 2AyyDx + (d~yD:~ - 2DxB) A] A) a
+[ ( 3 A D x - 9 A x D ) A y - 3D2]Ay + A D y D = 0.
(88)
Here, the necessary and sufficient conditions for the existence of a symmetry are E4 ------[2Ayy + (2B - ( b z ) a ] a - 3A 2 4: O,
E5 ==-4A3D - D e + ([2Axx - (q~2x + 2 C ) A ] A -
3AxZ)E4 = 0,
E6 ~ - A E a , y D + [ ( E4.x - dpyD)A + 3AyD + ( Aqbx -- 3Ax)Ea]E4 = 0.
(89)
When these conditions are satisfied, the symmetry is given by
(f(ACx-Ax)~X-D(-A;'+A¢')Dd y ) E4V O
r / = exp
~: -
,
(90)
Once the classifying rule for members of the invariant family (62) and for their symmetries are obtained, the corresponding ODE's solution in terms of ( and r / i s given by Eq, (3).
4.5. The symmetry pattern [ ( = ax + by + c, ~7 = f x + gy _L hi We finally consider the symmetry pattern [ ( = ax + by + c, ~7 = f x + gy + hi. First of all, to obtain the related invariant ODE family yP = ¢'(x, y), we need to solve for ,ib the related determining PDE,
f + (g-a)~-bq
~2-(ax
+by+c)
q~x-(fx
+gy ~h) qby=0.
(91)
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
255
The characteristic strip associated to this PDE is given by dy -fx
dx
-
- gy - h
-ax
dq~
-
- by - c
-f
(92)
- @g + qOa + bvb 2 "
The system above, which should be tackled by first solving d y / d x = F ( x , y ) , to obtain y as a function of x, and then solving d c P / d x = G ( x , y ( x ) , @), does not yield a solution since we were not able to obtain an e x p l i c i t solution y ( x ) for the first ODE. As an alternative, it is possible to solve Eq. (91) for the unknown c o n s t a n t s (a, b, c, f, g and h), arriving at a set of existence conditions :for a solution plus expressions for a, b, c, f, g and h in terms of @. We note however that this formal solving of the problem involves fifth order derivatives of @ and expressions of huge size, turning the approach very inefficient, if not just impracticable. We then followed the approach used in [5], which mainly consists of considering the natural splitting of Eq. (91) into a linear system of algebraic equations 7 for a, b, e, f, g and h. Example:
Kamke's first order ODE number 189,
x,, ~,,, ~1) - ,,, y t _ a y " - b x ''~ '' + j )
= 0.
(93)
For this ODE, Eq. (91) splits into an overdetermined algebraic system of twelve equations O=anf, O=b2m,
O=cbm, O=ba 2,
O=anh, O=2b2a,
0 = b3 ,
0 = b(g-
O= f,
O=ab(n-m+mn),
am - a) ,
0 = a(cmn
- cm + cn),
(94)
O=a(g-a-ng-am+amn+an),
which has as solution b = 0,
c = 0,
f = O,
tt
= 0,
a = a,
g = am + a,
(95)
from where a symmetry for Eq. (93) is given by [(=x,
~=y(m+l)].
(96)
5. T e s t s a n d p e r f o r m a n c e
The set of schemes here presented was implemented in Maple R5, in the framework of the ODEtools package [ 5]. The implementation consists of two separate routines for each of the symmetry patterns discussed in Section 4, respectively accomplishing the following tasks: (i) determine whether a given ODE has such a symmetry, and if so calculate it; (ii) use the symmetry to integrate the given ODE, taking advantage of the form of the invariant ODE family. We have tested this Maple implementation extensively, to confirm the correctness of the returned results and to produce statistics concerning the classification of Kamke':~ first order ODE examples according to their symmetries. Such statistics can be used as a guideline for adding more symmetry patterns to the solving scheme, as well as for extending Kamke's test suite with ODEs belonging to more varied invariant ODE families. For the purpose of the test, instead of working with the whole set of Kamke's 576 examples, we previously discarded ODEs of type separable, linear, inverse-linear and Bernoulli: their recognition and solution are straightforward and they are not the main target of this work. Also, all the examples which are u n s o l v a b l e in the sense that the class is too general and Kamke provides only a discussion, e.g. the general Abel ODE 7 This splitting of Eq. (91) is obtained by taking the coefficients of x and y.
256
E.S. Cheb- Terrab, A.D. Roche/Computer Physics Communications 113 (1998) 239-260
Table l Kamke's ODEs excluded from the tests: 178 of 576 Class
Totals
Degree in y~ 1
separable linear inverse linear Bernoulli unsolvable Total of excluded ODEs
2
3
higher
44 29 7 29 12
32 1 0 0 3
11 0 0 0 0
8 0 0 1 1
95 30 7 30 16
121
36
11
10
178
Table 2 Classification of Kamke's 398 ODEs used in the test Class
Degree in },~ 1
Totals 2
3
higher
Abel Clairaut Riccati dAlembert exact homogeneous rational None
61 0 61 36 28 99 139 27
0 10 0 48 0 53 56 11
0 3 0 4 0 3 0 0
0 3 0 7 0 4 2 6
61 16 61 95 28 159 197 44
Total of ODEs
246
114
16
22
398
number 50, were excluded as well 8. To perform the tests, we used the six files containing the Maple input for Kamke's examples available in the web at h t t p : / / d f t . i f . u e r j . b r / o d e t o o l s , h t m l (see [ 5 ] ). 5.1. Classification o f K a m k e ' s first order O D E examples
The classification we obtained for Kamke's 576 first order ODEs is shown below divided into three tables. In each table, we followed the division by Kamke into ODEs of: first, second, third, and higher degree on y~; respectively organized as the examples: 1 to 367, 368 to 517, 518 to 544 and 545 to 576. Table 1 contains the total number of ODEs of easy and of unsolvable types aforementioned and excluded from the test: In Table 1, all ODEs missing x or y are classified as separable. Also, the high degree ODEs 442 and 557, respectively classified above as "linear" and "Bernoulli", appear as such after isolating yP. The second table shows the standard classification for the remaining 398 Kamke examples which conformed our test suite. ODEs matching more than one classification (we called rational ODEs all those for which the right-hand side can be written as a rational function of x and y, no matter what other type they are) are shown in Table 2. Table 3 is concerned with these 398 ODEs and shows the total number of them having linear symmetries or matching any of the invariant ODE patterns discussed in Section 4. From the results above, it can be seen that the set of schemes here presented finds symmetries for 248 ODEs, thus providing solutions for 62% of these 398 Kamke examples. These 248 solved examples include 30 ODEs 8The ODEs we classified as unsolvable are those numberedin Kamke's book as 50, 55, 56, 74, 79, 82, 202, 219, 250, 269, 331. 370, 461,503 and 576.
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
257
Table 3 Classification of the 398 ODEs according to the schemes of Section 4 Class
Degree in yt
Totals
1
2
3
higher
[F(x)•(y). Ol or 10, 5t"(x)G(y) I IF(x), ~(x) l or IG(y), J ( y ) l IF(x), ~(Y)I or IG(y), .Y'(x)] linear symmetries
26 30 54 102
0 16 48 78
0 1 3 12
0 3 9 II
26 50 114 203
Total of ODEs
133
88
13
14
248
of Abel type, 18 of Riccati type and 10 of "no" type. If we add the ODEs of easy type of Table 1, we arrive at a symmetry-based scheme for classifying, finding symmetries and returning answers for 73% of the whole set of Kamke's examples. 5.2. The testing arena
We note that more than one half of these 398 Kamke examples have linear symmetries, and most of them are of the form [sc = a x , r/ = y] (o~ is a nonzero constant). In Table 3, these examples also appear classified as having symmetries of the form I F ( x ) , • ( y ) ] . Concerning the symmetry patterns I F ( x ) + G ( y ) , 01 and [0, F ( x ) + G ( y ) ] , it is curious that there are no Kamke examples having these types of symmetries. Also, we detected only one example (Kamke's ODE 488) with a nonlinear symmetry of the form [ G ( y ) , J ( y ) ]. A similar situation happens with the symmetry pattern [ ~ ' ( y ) , .Y'(x)]: in the 560 solvable ODEs of Kamke's saite, we detected only ten (numbers: 86, 339, 365,446, 451, 511,512, 515, 555 and 561 ) having symmetries of this type, and all these symmetries are also linear of the form [ ( = cey, r/ = x]. In the same line, disregarding ODEs already having linear symmetries and those of Table 1, in Kamke's suite we detected only seven ODEs (numbers: 16, 33, 201, 212, 366, 394 and 574) having symmetries involving arbitrary functions, 37 ODEs (9% of 398) with symmetries involving radicals and 61 ODEs ( 15% of 398) - most of them of Riccati type - with symmetries involving exponentials. logarithms, trigonometric or special functions. All this makes us think that, as a testing arena for compuler algebra implementations of ODE-solvers, Kamke's set of examples is good but in some sense incomplete. Actually, if on one hand we have a test suite with symmetries associated to invariance under scaling, rotations, etc., which are usual in nature, on the other hand it would be interesting to have more examples with polynomial nonlinear symmetries, symmetries involving functions (standard and arbitrary) and more varied symmetry patterns in general. The origin of these limitations may perhaps be found in that Kamke's examples are from a time when computers were not available. Then, disregarding the ODEs of Table 1, apart from some examples involving tricky changes of variables, most of the remaining 398 examples are not so difficult to solve for nowadays computer algebra ODE-solvers. 5.3. Test o f the ODE-solver o f ODEtools with the Ist order KamJce examples
Although the main purpose of this paper is to present a computational scheme for determining symmetries for some first order ODE families, it is interesting to see how odsoh,e - the ODE-solver of ODEtools - performs when the new routines are merged with the old ones. The resulting solving strategy is basically as follows 9: (i) if the ODE is of type separable, linear, inverse-linear or Bernoulli, return an answer in terms of integrals; '~For ODEs of high degree this strategy is slightly different.
258
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
Table 4 Kamke's first order ODEs, solved by odsolve: 94% Degree in y
ODEs
Solved
Average time solved
.fail
1 2 3 higher
355 147 27 31
331 140 26 30
2.2 sec. 8.8 sec. 7.2 sec. 13.4 sec.
9.9 sec. 61.1 sec. 17 ~c. 25.2 sec.
Total:
560
527
~ 5 sec.
~ 20 sec.
Table 5 Kamke's 1st order solvable ODEs for which odsolve fails: 6% Class
Kamke's numbering
rational Riccati Abel NONE
452, 480, 485 25 45, 47, 48, 49, 145, 151, 185, 205, 206, 234, 237, 253, 257, 265 80, 81, 83, 87, 121,128, 340, 367, 395, 460, 506, 510, 543, 572
(ii) if the ODE is in exact form, or belongs to a solvable subfamily of type Abel or Riccati, then return an answer in terms o f integrals; (iii) if the ODE has linear symmetries or matches any of the invariant ODE family patterns discussed in Section 4, then return an answer built using these symmetries; (iv) otherwise, try looking for a pair of infinitesimals as a particular solution for the determining PDE equation (2) as explained in [5]. The new routines enter in step (iii), and the performance of the strategy above with all o f K a m k e ' s 560 solvable examples j u m p s from the aforementioned 73%, using only the routines presented in this paper, to 94% of examples solved. This performance is summarized as shown in Table 4. It is interesting to mention that, at least with Kamke's examples, the symmetry approach is complementary with the standard methods for classifiable ODEs, thus resulting in such a high performance. Actually, the total number of ODEs solved using symmetry methods but before inserting the new routines in the ODE-solver was also high: 90%. The number and classification of Kamke's I st order ODEs still not solved by odsoive is shown in Table 5. One of the relevant differences between the new and the old symmetry schemes o f odsolve is that the new schemes are systematic. Another difference is in the timings. For ODEs of the types discussed in Section 4, the new routines are working more than 10 times faster (average over Kamke's examples) than the Maple R5 routines for finding symmetries as particular solutions to Eq. (2). This fact resulted in the replacement, in the Maple version under development, of the corresponding R5 routines by the new ones presented in Section 4.
6. Conclusions In this paper, a set of schemes is shown for finding symmetries for various first order ODE families, as well as its computer algebra implementation in Maple R5, in the framework of the ODEtools package. This implementation proved to be a valuable tool for tackling first order ODEs, as shown in Section 5, resulting in a concrete step towards classifying and correspondingly solving first order ODEs according to their symmetries. Moreover, the implementation of this symmetry scheme enlarges the ODE solving power of computer algebra
E.S. Cheb-Terrab, A.D. Roche~Computer Physics Communications 113 (1998) 239-260
259
systems. Actually, none of the examples presented in this paper - half of them from Kamke's book - can be solved by any of Macsyma 2.3, Mathematica 3.0, MuPAD 1.4, or the Reduce package CONVODE. Also of relevance, in the computational implementation presented, solutions to rather general ODE families are obtained by just using pattern matching schemes. It is not difficult to imagine the addition of new routines related to other symmetry patterns, in order to further extend the ODE-solving power. All this leads us to believe that symmetry approaches based on pattern matching routines will play a relevant role in future computer algebra ODE-solvers. It is curious that, apparently, none of the ODE-solvers of Mathematica, Macsyma, Reduce or MuPAD are tackling first order ODEs by systematically looking for their symmetriesl°. Perhaps that is due to the usual belief that symmetry methods are of no help in solving first order ODEs. In contrast, we recall that the symmetry classification scheme here discussed leads to the solution to 73% of the first order Kamke's examples, and when combined with standard classification schemes this performance jumps to 94%. Also, the fact that the symmetries are found using pattern matching routines resulted in a very fast ODE-solver, taking on the average ~ 5 sec. in each solved example, and ~ 20 sec. in each unsolved one. We are actually not aware of such a high performance by any ODE-solver not using symmetry methods with first order ODEs. Concerning Maple R5, the situation is a bit different: this system is already looking for symmetries for first order ODEs as particular solutions to the determining PDE equation (2). We note however that the routines presented here work remarkably faster, and the search for the symmetries is systematic. These features motivated the replacement, in the Maple version under development, of corresponding routines for first order ODEs by the ones presented in this work. We also note that the ideas here discussed cannot be used to solve all types of ODEs one can imagine. For example, they cannot be used to systematically find symmetries for Riccati or Abel ODEs except for some subfamilies, so that a combination of symmetry schemes with standard schemes seems to be the way to achieve the best performance. Concerning what would be the best combination of methods, a testing arena should be chosen first and the result will depend on this choice. A collection of testing examples related to real problems, as found in Kamke's book, appears to be an appropriate choice. On the other hand, as commented in Section 5, this book appears to us an incomplete testing arena, and to have the required testing suite, extensions of the examples of Kamke's book are necessary. Finally, some of the ideas discussed here for first order ODEs can be considered in the framework of high order ODEs and first order PDEs as well. We are presently working in some prototypes in these directions 11 and expect to succeed in obtaining reportable results in the near future.
Acknowledgements This work was supported by the State University of Rio de Janeiro (UERJ), Brazil; The Conselho Nacional de Desenvolvimento Cientifico e Tecnol6gico, CNPq, Brazil; and by the Symbolic Computation Group, Faculty of Mathematics, University of Waterloo, Ontario, Canada. The authors would like to thank K. von Billow 12 for a careful reading of this paper.
m In 17] (1981), it is mentioned the implementation in Macsyma of symmetry schemes for some first order ODE families. However, it is not clear to the authors whether these routines are distributed with Macsyma since its ODE-solver failed in solving related first order examples. Il See http://dft, if. uerj. br/odetools, html.
12 Symbolic Computation Group of the Theoretical Physics Department at UERJ, Brazil.
26O
E.S. Cheb-Terrab. A.D. Roche~Computer Physics Communications 113 (1998) 239-260
References [1 I H. Stephani, Differential Equations: Their Solution using Symmetries, M.A.H. MacCallum, ed. (Cambridge Univ. Press, New York, London, 1989). [21 G.W. Bluman, S. Kumei, Symmetries and Differential Equations, Applied Mathematical Sciences, Vol. 81 (Springer, Berlin, 1989). 131 M.A.H. MacCallum, Using computer algebra to solve ordinary differential equations, in: Computer Algebra in Industry 2: Problem Solving in Practice, AM. Cohen, L.J. van Gastel, S.M. Verduyn Lunel, eds. (Wiley, Chichester, 1995) pp. 19-41. [4 ] W. Hereman, Review of Symbolic Software for Lie Symmetry Analy,,:is, Mathematical and Computer Modeling, Vol. 20, Special Issue on Algorithms for Nonlinear Systems (1995). 151 E.S. Cheb-Terrab, L.G.S. Duarte, L.A.C.P. da Mota, Computer Algebra Solving of First Order ODEs using Symmetry Methods, Comput. Phys. Commun. 101 (1997) 254; see also E.S. Cheb-Terrab, L.G.S. Duarte, L.A.C.P. da Mota, Comput. Phys. Commun. 108 (1998). 161 E. Kamke, Differentialgleichungen: L6sungsmethoden und L6sungen (Chelsea, New York, 1959). 171 B. Char, Using Lie transformations to find closed form solutions to first order ordinary differential equations, in: SYMSAC 81 (ACM, New York, 1981 ) pp. 44-50. 181 E Boulier, Lazard, Ollivier and Petitot, Representation for the radical of a finitely generated differential ideal, Proc. ISSAC95, pp. 158-166. 19] G.J. Reid, A.D. Wittkopf, Long Guide to the Standard Form Package, preprint (Department of Mathematics, University of British Columbia, Vancouver. Canada, 1993).