A Maple procedure based on λ -symmetries for second-order ordinary differential equations

A Maple procedure based on λ -symmetries for second-order ordinary differential equations

Applied Mathematics and Computation 249 (2014) 147–163 Contents lists available at ScienceDirect Applied Mathematics and Computation journal homepag...

438KB Sizes 0 Downloads 35 Views

Applied Mathematics and Computation 249 (2014) 147–163

Contents lists available at ScienceDirect

Applied Mathematics and Computation journal homepage: www.elsevier.com/locate/amc

A Maple procedure based on k-symmetries for second-order ordinary differential equations J. Vidal a, C. Muriel b,⇑, J.L. Romero b, J.J. Alonso c a

Departamento de Construcciones Navales, Universidad de Cádiz, 11510 Puerto Real, Spain Departamento de Matemáticas, Universidad de Cádiz, 11510 Puerto Real, Spain c Departamento de Física Aplicada, Universidad de Cádiz, 11510 Puerto Real, Spain b

a r t i c l e

i n f o

Keywords: First integrals k-Symmetries Linearization Generalized Sundman transformations

a b s t r a c t We present a Maple procedure to classify and solve the equations in the class A of the 2ndorder ordinary differential equations that admit first integrals that are polynomials of the first degree in the first order derivative. Computational methods based on the theory of ksymmetries permit to obtain the integrating factors, the first integrals, the related k-symmetries and, if possible, the general solution. The procedure also provides the local and the generalized Sundman transformations that linearize the equations in the class A. Ó 2014 Elsevier Inc. All rights reserved.

1. Introduction In this work we describe our procedure classA, written for the Maple system, that contains commands for handling a class of ordinary differential equations (ODEs) in the framework of the first integrals and k-symmetry and linearization approaches. The procedure identifies the class A of the 2nd-order ODEs

u2 ¼ /ðx; u; u1 Þ;

ð1Þ

that admit first integrals of the form

I ¼ Aðx; uÞu1 þ Bðx; uÞ;

ð2Þ 2

i

i

where ðx; uÞ are in some on some open set M # R ; ui ¼ d u=dx , for i ¼ 1; 2. According to the results in [1], such equations are of the form

u2 þ a2 ðx; uÞu21 þ a1 ðx; uÞu1 þ a0 ðx; uÞ ¼ 0

ð3Þ

and their coefficients satisfy either

S1  a1u  2a2x ¼ 0; S2  ða0 a2 þ a0u Þu þ ða2x  a1u Þx þ ða2x  a1u Þa1 ¼ 0

ð4Þ

or, if S1 – 0,

⇑ Corresponding author. E-mail addresses: [email protected] (J. Vidal), [email protected] (C. Muriel), [email protected] (J.L. Romero), [email protected] (J.J. Alonso). http://dx.doi.org/10.1016/j.amc.2014.10.014 0096-3003/Ó 2014 Elsevier Inc. All rights reserved.

148

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

  S2  ða2x  a1u Þ ¼ 0; S1 u    2   S2 S2 S2 þ a0 a2 þ a0u ¼ 0: S4  þ þ a1 S1 x S1 S1

S3 

ð5Þ

If the first (resp. second) alternative holds we will say that the equation belongs to the subclass A1 (resp. A2 ). These are some properties of the equations in class A: 1. The equations in subclass A1 admits two functionally independent first integrals of the form (2), whereas the equations in subclass A2 do only admit a unique first integral of this type. 2. Such first integrals are associated to k-symmetries of the equation [2]. The canonical representative [3,4] of these k-symmetries is of the form ð@ u ; kc Þ where

kc ¼ a2 ðx; uÞu1 þ bðx; uÞ

ð6Þ

for some functions aðx; uÞ and bðx; uÞ. 3. The conditions 4,5 are equivalent to the conditions given by Duarte et al. in [5] to characterize the 2nd-order equations that can be transformed into the free particle equation

U XX ¼ 0

ð7Þ

by means of a generalized Sundman transformation [6]:

U ¼ Fðx; uÞ;

dX ¼ Gðx; uÞdx:

ð8Þ

Moreover, the equations in subclass A1 can also be transformed into (7) by local transformations of the form

U ¼ Rðx; uÞ;

X ¼ TðxÞ:

ð9Þ

These and further results related to the linearization of equations in A can be seen in [1,7,8]. The routines of the classA procedure identify the equations in the class A and classify them into the subclasses A1 or A2 , compute their k-symmetries, the associated first integrals, give analytical solutions or order reductions and provide local and generalized Sundman transformations that linearize the equations. In some cases, some results can also be obtained with other commands of the Maple system. For instance, the DEtools[Lie] subpackage contains a collection of commands and routines for the analytical solving of ODEs using integrating factors and Lie group symmetry methods, based on the algorithms that appear in [9,10]. Some of these routines can be used to compute symmetry generators, integrating factors and first integrals of the given ODEs. Nevertheless, the classA procedure succeeds in providing k-symmetries of some equations that lack Lie point symmetries or that the Maple system does not compute, usually due to the presence of undetermined parameters in the equation. Sometimes the firint command of the DEtools package does not provide the first integrals of equations of the class A in the form (2) or provides first integrals that are functionally dependent. As far as we know, no Maple procedure handles ODEs in the framework of linearization problems, whereas the classA procedure includes some routines that construct explicitly linearizing transformations of the form (8) and (9) for the equations in class A. 2. The Maple procedure classA The classA procedure is a collection of commands and routines for the analytical study of the ODEs in class A, using algorithms based on the k-symmetry method [1,7,8]. The set of commands includes routines for: 1. Identifying the equations of the form (3) that are in the class A and classifying them into the subclasses A1 or A2 . If the equation involves arbitrary parameters, the procedure can provide values for which the ODE belongs to A1 or A2 . 2. Explicitly determining two independent first integrals of the form (2) for the equations in subclass A1 and the (essentially unique) first integral of the form (2) that admit the equations in subclass A2 . 3. Building the general solution if the given ODE is in subclass A1 , using these first integrals. If the given ODE is in subclass A2 and Maple succeeds in solving the 1st-order equation I ¼ C; C 2 R, where I is the first integral, the ODE can be completely integrated; otherwise, its order can be reduced by one. 4. Explicitly determining two functions of the form (6) that define two nonequivalent k-symmetries of the equations in A1 and one function (6) that defines one k-symmetry if the equation is in subclass A2 . 5. Constructing two local transformations of the form (9) that transform the equations in A1 into the linear equation (7) and generalized Sundman transformations of the form (8) to linearize the given ODE if it belongs to the subclass A2 . 2.1. Calling sequence There are two possible calling sequences:

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

149

1. classA(ode, var, const, method). 2. classA(coeff-list, var, const, method), where     

ode – a differential equation in diff or D standard forms used by the Maple system. coeff-list– list of coefficients of an ODE of the form (3). var – dependent and independent variables of the ODE. const – (optional) set with undetermined parameters that may appear in the ODE. method = sequence (optional) forces the use of the routine intsys instead of the default routine subcreate and where sequence is one of the arrays [1, 2] or [2, 1] (see Section 4 for details).

2.2. Parameters and description  The first calling sequence accepts a differential equation in diff or D form, between square brackets, as the first argument. The second form of the calling sequence accepts the list of coefficients of the ODE as the first argument. In the second calling sequence, the list of coefficients ½a2 ; a1 ; a0  must be given, in the order that appears in (3).  The second argument var is an array [dvar,ivar], with the dependent variable dvar and the independent variable ivar of the ODE and in this order.  In the optional argument const the parameters must be given between curly braces. The procedure returns a warning message and tries to find possible values of the parameters for which the equation is in the class A.  The optional arguments const and method can be given in the calling sequence in any order, but always after the first and second arguments.  Calling classA without the arguments coef and/or var, or without the three coefficients of the equation in coef or the dependent and independent variable in var, will result in an error message. Any of the two forms of the calling sequence of the procedure classA returns the result of the command test, which checks if the given equation is in the class A and classifies it into one of the subclasses A1 or A2 , with three possible outputs: 1. ‘‘Subclass A1’’. 2. ‘‘Subclass A2’’. 3. ‘‘The ODE is not in class A’’. Apart from the cited command test, the following is a list of all available commands and a brief description of each one:  suggestA1 and suggestA2: if the optional argument const has been provided, these commands show the possible values of the parameters for which the equation is in the subclass A1 and A2 , respectively.  ode constructs the ODE in form (3) from the list of coefficients given in coeff-list (second form of the calling sequence) or from the first argument ode (first form of the calling sequence).  s[i], for 1 6 i 6 4, returns the quantities S1 ; S2 ; S3 and S4 , defined in (4) and (5). If S1 ¼ 0, then S3 and S4 cannot be defined and the output of s½3 (resp. s½4) is literally s3 (resp. s4).  func builds, only for the equations in subclass A1 , the auxiliary function (20) to construct the solutions of Eqs. (21) or (22), which are used in a number of internal algorithms.  firstIntegral returns in an array the first integrals of the form (2), in the diff form. The output is a two-dimensional array if the equations are in subclass A1 and a one-dimensional array for the equations in A2 .  intFactorA returns in an array the integrating factors associated to the first integrals of the form (2). The output is a twodimensional array for the equations in subclass A1 and a one-dimensional array for the equations in A2 .  lambdasym returns in an array the functions (6), in the diff form, that define canonical representatives of the k-symmetries of the given ODE. The output is a two-dimensional array if the equations are in subclass A1 and a one-dimensional array for the equations in A2 .  generalsol builds the general solution of the given ODE from the first integrals and tries to give it in explicit form. Some equations in A2 could not be fully solved, but an order reduction is provided.  linearizationL builds, only for the equations in subclass A1 , a two-dimensional array with two arrays with the functions R and S, in this order, that linearize the given ODE through local transformations of the form (9).  linearizationS builds, only for the equations in subclass A2 , a two-dimensional array with two functions R and S, in this order, that linearize the given ODE through the Sundman generalized transformation of the form (8). When the output of test is that the given ODE is not in class A, the commands firstIntegral, intFactorA, lambdasym, generalsol, linearizationL and linearizationS return literally their respective names. In what follows we describe the procedures and inner routines included in the package classA and illustrate the usage of the commands and the obtained results with several examples. The complete code is included in Appendix A.

150

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

3. Characterization of the equations in A in terms of their coefficients The routine coefGenerator is an inner procedure that extracts, in the local variable coef, the coefficients a2 ; a1 and a0 of an ODE that can be written in the form (3), when the first form of calling sequence is used. The procedure sets coef as the first argument of the calling sequence when its second form is used. The command test computes the values S1 and S2 , given in (4), from the elements of the list coef. If S1 is not identically null, then the quantities S3 and S4 are computed. For 1 6 i 6 4, the output of s½i is the function Si . When S1 is identically null, the output of s½3 and s½4 is, literally, s3 and s4. If (4) (resp. (5)) holds, the output of test is ‘‘Subclass A1’’ (resp. ‘‘Subclass A2’’). Otherwise test returns ‘‘The ODE is not in class A’’. If the coefficients of Eq. (3) depend on arbitrary parameters, the quantities S1 ; S2 ; S3 and S4 may also depend on these undetermined parameters and the output of test is ‘‘The ODE is not in class A’’. However, (4) and/or (5) could hold for some values of the parameters. For these cases, if the optional argument const contains the parameters, the procedure returns a warning message and tries to find possible values of the parameters for which the equation is in the class A. These values are stored in the global variables suggestA1 for the equations in subclass A1 and suggestA2 for the equations in subclass A2 . The following examples illustrate the classification procedure and the usage of the described commands: Example 3.1. For the 2nd-order equation

xu2 þ nxu21 þ ku þ mx ¼ 0;

ð10Þ

where n; k; m are constants, we define > var:¼[u, x]: > eq:¼x⁄(diff(u(x),x$ 2))+n⁄(diff(u(x),x))^2⁄x + k⁄(diff(u(x),x)) + m⁄x:

and use the first form of the calling sequence: >classA([eq],var); Procedure completed "Subclass A1"

The output indicates that Eq. (10) is in the subclass A1 , whatever the values of the parameters m; n; k. The corresponding values S1 and S2 defined in (4) can be obtained by using >[seq(s[i], i = 1 .. 4)]; [0,0,s3,s4] Example 3.2. The Painlevé VI equation

!     1 1 1 1 1 1 1 xðx  1Þðx  tÞ bt cðt  1Þ d tðt  1Þ 2 ¼0 x þ x1  x2  þ þ þ þ aþ 2þ þ 2 x x1 xt 1 t t1 xt x t 2 ðt  1Þ2 ðx  1Þ2 ðx  tÞ2

ð11Þ

is an equation of the form (3), where a; b; c; d are constants. We set eq the left-hand side of (11) and use the first form of the calling sequence: >classA([eq],[x,t]); Procedure completed "The ODE is not in class A"

The output corresponds to the case of arbitrary parameters. We can use in classA the optional argument const in the form: >classA([eq],[x,t],{a,b,c,d}); Warning, use the command suggestA1 to find possible values of {a, b, c, d} for which the ODE is in subclass A1 Procedure completed "The ODE may be in subclass A1 for some values of {a, b, c, d}"

This indicates that there are possible values of the parameters for which Eq. (11) is in the subclass A1 . Such values can be obtained with the command. >suggestA1;

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

  1 : a ¼ 0; b ¼ 0; c ¼ 0; d ¼ 2

151

ð12Þ

In this example the command suggestA2 returns literally suggestA2, because the value of S1 is always zero, whatever the values of the parameters: >eval([seq(s[i], i = 1 .. 4)], suggestA1); [0,0,s3,s4]

Therefore, Eq. (11) is in subclass A1 for the values of a; b; c; d given in (12). Example 3.3. For the equation

u2 þ

k1 2 u þ ðk2 þ k3 uÞu1 þ k4 u3 þ k5 u2 þ k6 u ¼ 0; u 1

ð13Þ

where ki 2 R; for 1 6 i 6 6, the procedure classA provides the following values: 2

S1 ¼ k 3 ;

S2 ¼ ð2k4 ðk1 þ 3Þ  k3 Þx þ ðk1 þ 2Þk5  k2 k3 ;

S3 ¼ 2 kk43 ðk1 þ 3Þ; S4 ¼

q2 x2 þq1 xþq0 k23

;

ð14Þ

where





q2 ¼ ðk1 þ 3Þk4 4ðk1 þ 3Þk4  k23 ; q1 ¼ 2ðk1 þ 3Þk4 ð2ðk1 þ 2Þk5  k2 k3 Þ; q0 ¼ ðk1 þ 1Þk6 k23 þ ðk1 þ 2Þk5 ððk1 þ 2Þk5  k2 k3 Þ: Since the functions (14) depend on the parameters of the equation, we use the optional argument fk1 ; k2 ; k3 ; k4 ; k5 ; k6 g in the calling sequence to obtain possible values of the parameters for which Eq. (14) is in class A. With the command suggestA1 we obtain the following values

fk1 ¼ k1 ; k2 ¼ k2 ; k3 ¼ 0; k4 ¼ 0; k5 ¼ 0; k6 ¼ k6 g; fk1 ¼ 2; k2 ¼ k2 ; k3 ¼ 0; k4 ¼ 0; k5 ¼ k5 ; k6 ¼ k6 g;

ð15Þ

fk1 ¼ 3; k2 ¼ k2 ; k3 ¼ 0; k4 ¼ k4 ; k5 ¼ 0; k6 ¼ k6 g for which Eq. (14) is in the subclass A1 . Similarly, we use the command suggestA2 to obtain the values of the parameters for which Eq. (14) is in the subclass A2 :

n   o k1 ¼ 3; k2 ¼ k2 ; k3 ¼ k3 ; k4 ¼ k4 ; k5 ¼ RootOf Z 2 þ Z k2  2 k6 k3 ; k6 ¼ k6 ;   8 9 < = RootOf Z 2  Z k2 þ k1 k6 þ k6 k3 k1 ¼ k1 ; k2 ¼ k2 ; k3 ¼ k3 ; k4 ¼ 0; k5 ¼ ; k6 ¼ k6 : : ; k1 þ 2

ð16Þ

ð17Þ

4. First integrals, integrating factors and general solution of the equations in A In this section we describe the algorithms and inner procedures in classA that compute the first integrals of form (2) and the related integrating factors, lðx; uÞ ¼ Aðx; uÞ, for the equations in A. The Maple system has implemented several algorithms to look for integrating factors and the related first integrals of a given ODE, by using the intfactor and firint commands of the DEtools package. Sometimes these first integrals are not written in the form (2) or such commands provide integrating factors associated to first integrals that are functionally dependent. In this section we provide alternative methods to look for integrating factors and first integrals, expressed in the simple form (2), for the equations in class A. Some of the algorithms require to find particular solutions of compatible linear systems of the form

Y x ðx; uÞ ¼ u1 ðx; uÞ;

Y u ðx; uÞ ¼ u2 ðx; uÞ:

We have defined two internal routines in the classA procedure to get particular solutions of this type of systems:

ð18Þ

152

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

1. The routine subcreate uses the Maple command pdsolve to find a particular solution of a compatible linear system of the form (18). The calling sequence subcreate(x; u; u1 ; u2 ,valor) assigns to the variable ‘‘valor’’ a particular solution of the linear system (18). This is the default method, unless the optional argument method is specified in the calling sequence of the classA procedure. 2. The routine intsys solves a system (18) by integration. If, for any of the two forms of the calling sequence of the procedure classA, the optional argument method is [1,2] (resp. [2,1]), the procedure integrates the first (resp. second) equation in (18) with respect to the independent (resp. dependent) variable and determines the integration function with the second (resp. first) equation in (18). The calling sequence of this inner routine is intsys(½u1 ; u2 ; ½u; x, method, valor) and assigns to the variable ‘‘valor’’ a particular solution of the linear system (18). The intsys routine is specially useful when the right-hand side of one of the equations in (18) involves special functions. When the procedure is not completed in 10 s, the computations are interrupted and the next warning message suggests the use of the optional argument method: ‘‘Limit time exceeded. Please, try re-entering the command classA with the optional argument method=[1,2] or method=[2,1]’’. 4.1. First integrals of the equations in A1 The equations in subclass A1 admit two functionally independent first integrals of the form (Theorem 2 in [1]):

Ii ðx; u; u1 Þ ¼ Ai ðx; uÞu1 þ Bi ðx; uÞ;

for i ¼ 1; 2:

ð19Þ

To compute the functions A1 ; B1 and A2 ; B2 , the classA procedure follows the next steps: 1. It constructs, from the local variable coef that contains the coefficients of the given ODE, the function

1 1 f ðxÞ ¼ a0 a2 þ a0u  a1x  a21 : 2 4

ð20Þ

For arbitrary coefficients, the right-hand side of (20) is a function of the variables x and u, but if S1 ¼ S2 ¼ 0, i.e. if the equation is in subclass A1 , this function does not depend on u. After executing the calling sequence of the classA procedure, the function (20) can be called with the command func. 2. It tries to find two independent solutions, g ¼ g 1 and g ¼ g 2 , of the 2nd-order linear ODE

g 00 ðxÞ þ f ðxÞgðxÞ ¼ 0;

ð21Þ

where f is the function (20). The procedure classA uses first the command pdsolve to solve the linear equation (21) and sets the values of the arbitrary constants C 1 ¼ 1; C 2 ¼ 0 and C 1 ¼ 0; C 2 ¼ 1, to define the local variables solg1 ¼ g 1 and solg2 ¼ g 2 , respectively. If one of the returned solutions is identically null, the procedure determine two different solutions, h1 ; h2 of the Riccati type equation 0

h ðxÞ þ hðxÞ2 þ f ðxÞ ¼ 0

ð22Þ

by setting C 1 ¼ 0 and C 1 ¼ 1, where C 1 is the arbitrary constant of the solution. In this case the procedure uses the command riccatisol, that is part of the DEtools package. Through the transformation g 0 ðxÞ ¼ hðxÞgðxÞ, the functions h1 ; h2 provide two independent solutions g 1 ; g 2 of (21). 3. From the solutions g 1 ¼ solg1 and g 2 ¼ solg2 of (21), the functions A1 ¼ Asub1 and A2 ¼ Asub2 are obtained as two particular solutions of the systems

g0 Aix 1 ¼ a1 þ i ; 2 Ai gi

Aiu ¼ a2 ; Ai

ði ¼ 1; 2Þ:

ð23Þ

It can be checked that the solutions of the systems (23) are of the form Ai ¼ g i  expðPÞ, where Y ¼ P satisfies a system of the form (18), for

u1 ¼ 1=2a1 ; u2 ¼ a2 :

ð24Þ

In this way, the procedure can use the inner routines subcreate or intsys to find such solution P and to construct two solutions A1 ; A2 . Thus computed functions are the coefficients of u1 in (19) and are, obviously, integrating factors of the given ODE. They can be displayed with the command intFactorA. 4. From the particular solutions A1 ¼ Asub1 and A2 ¼ Asub2 of (23), the functions B1 ¼ Bsub1 and B2 ¼ Bsub2 are derived as two particular solutions of the systems

Bix ¼ a0  Ai ;

Biu ¼

  g0 1 a1  i  Ai ; 2 gi

ði ¼ 1; 2Þ;

which are of the form (18). This is done by using the inner routines subcreate or intsys, with arguments

ð25Þ

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

u1 ¼ a0  g i  expðPÞ; u2 ¼

153

  g0 1 a1  i  g i  expðPÞ ði ¼ 1; 2Þ; 2 gi

where P is the output of the routines subcreate or intsys with arguments (24). 5. If the Maple system succeeds in solving the 2nd-order linear equation (21) (or the Riccati type equation (22)), the global variable firstIntegral returns in an array the two independent first integrals of the form (19), with the functions A1 ¼ Asub1; B1 ¼ Bsub1 and A2 ¼ Asub2; B2 ¼ Bsub2, respectively. 6. By eliminating u1 from the system A1 u1 þ B1 ¼ k1 ; A2 u1 þ B2 ¼ k2 , where k1 and k2 are arbitrary constants, we obtain the general solution of the corresponding equation in implicit form:

k1  B1 k2  B2 ¼ : A1 A2

ð26Þ

The generalsol command tries to isolate u in (26) and returns the general solution in explicit form. When it fails, the implicit form (26) is given. 4.2. First integrals of the equations in A2 The equations in subclass A2 admit a (essentially unique) first integral of the form (2). In this case the computation of the coefficients A; B of this first integral can be obtained in a simpler way than for the equations in subclass A1 . Such functions arise just from the coefficients of the given equation as solutions of the following systems [7]:

Ax S2 ¼ a1 þ ; A S1

Au ¼ a2 A

ð27Þ

and

Bx ¼ a0  A;

Bu ¼ 

  S2  A: S1

ð28Þ

In this case, the classA procedure proceeds as follows:  The routines subcreate or intsys find a particular solution Y ¼ P of the system (18) for

u1 ¼ a1 þ

S2 ; S1

u2 ¼ a2 :

Then A ¼ expðPÞ is a particular solution of (27), stored in the local variable Asub1.  The local variable Asub1 is used in the inner routines subcreate or intsys with arguments

u1 ¼ a1 þ

S2 ; S1

u2 ¼ a2

to compute a particular solution B ¼ Bsub1 of system (28).  For equations in the subclass A2 , firstIntegral and intFactorA are arrays with only one entry: the first integral Au1 þ B and the integrating factor A, respectively.  The generalsol command tries to solve the 1st-order equation Au1 þ B ¼ k1 where k1 2 R, with the dsolve command. If the Maple system succeeds, generalsol gives the general solution of the equation in subclass A2 . Otherwise it uses the DESol structure with the reduced equation Au1 þ B ¼ k1 , satisfied by an arbitrary solution of the original equation. In this way, the odetest command of the DEtools package can be used to test the obtained result. 5. k-Symmetries of the equations in class A In this section we recall the characterizations of the subclasses A1 and A2 , in terms of their k-symmetries whose canonical representatives are ð@ u ; kc Þ, where kc are of the form (6). Such k-symmetries are associated to the first integrals studied in Section 4. We also describe the procedures that let us compute them. They are applied in Section 7 to calculate k-symmetries of some equations that lack Lie point symmetries or that the Maple system is not able to provide. 5.1. k-Symmetries of the equations in subclass A1 The equations in subclass A1 are the only equations of the form (3) that admit infinitely many k-symmetries defined in canonical form by a function k of the form (6). If h1 and h2 are two different solutions of the Riccati equation (22), then the functions

1 kic ðx; u; u1 Þ ¼ a2 ðx; uÞu1  a1 ðx; uÞ þ hi ðxÞ; 2

ði ¼ 1; 2Þ

ð29Þ

154

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

define two k-symmetries, if the equation in subclass A1 , that are not equivalent [3,4]. The functions (29) can also be expressed in terms of two independent solutions g 1 ; g 2 of the homogeneous linear 2ndorder ODE (21) as follows:

g 0 ðxÞ 1 kic ðx; u; u1 Þ ¼ a2 ðx; uÞu1  a1 ðx; uÞ þ i ; 2 g i ðxÞ

ði ¼ 1; 2Þ:

ð30Þ

By using Eqs. (23)–(25), it can be checked that

kic ðx; u; u1 Þ ¼ 

Aiu Biu u1  ; Ai Bi

ði ¼ 1; 2Þ:

ð31Þ

We use the expressions (31) in the inner procedure lambdacreate to compute the functions kic , for i ¼ 1; 2. If the Maple system succeeds in solving Eq. (21) (or (22)), the command lambdasym returns in an array the explicit expressions of the functions (31) (or 29 and 30). 5.2. k-Symmetries of the equations in subclass A2 The equations in subclass A2 are the only equations of the form (3) that admit a unique k-symmetry defined in canonical form by using a function k of the form (6). In this case the function kc can be calculated directly in terms of the coefficients of the equation:

kc ðx; u; u1 Þ ¼ a2 ðx; uÞu1 þ

S2 ðx; uÞ : S1 ðx; uÞ

ð32Þ

Alternatively, we can use the solutions A and B of the systems of Eqs. (27) and (28) to obtain a expression similar to (31):

kc ðx; u; u1 Þ ¼ 

Au Bu u1  : A B

ð33Þ

In this way, the inner procedure lambdacreate can be used to derive the function (33), also for the equations in the subclass A2 . In this case the command lambdasym gives a one-dimensional array with the function (33) given in the diff form. 6. Local and nonlocal linearizing procedures for the equations in A 6.1. Linearization by using generalized Sundman transformations A quite surprisingly fact for the equations in the class A is that the conditions (4) and (5) are equivalent to the conditions given by Duarte et al. in [5] to characterize the 2nd-order equations that can be transformed into the free particle equation U XX ¼ 0 by means of a generalized Sundman transformation [6]:

U ¼ Fðx; uÞ;

dX ¼ Gðx; uÞdx:

ð34Þ

Constructive methods to derive the functions F and G that define the generalized Sundman transformation (34) were given in [7]. One of these methods uses the coefficients of the equation (see Theorem 3 in [7]). In the procedure classA we have included the alternative method that uses the functions A and B that define the first integral (2). According to Theorem 1 in [7], such a function F ¼ Fðx; uÞ arises as any particular solution of the 1st-order partial differential equation

BF x  AF u ¼ 0

ð35Þ

and the function G ¼ Gðx; uÞ is given by G ¼ F u =A (or G ¼ F x =B if B – 0). In the procedure classA we try to solve Eq. (35) with the pdsolve command. When succeeds, the command linearizationS provides an array of the form ½Fðx; uÞ; Gðx; uÞ with the functions F and G needed to construct the generalized Sundman transformation (34). This procedure is valid for all the equations in class A. Nevertheless, the equations in subclass A1 can be transformed into the linear equation (7) by a local transformation. In the following subsection we explain how the procedure classA computes such local linearizing transformations. 6.2. Linearization of equations in the subclass A1 by local transformations The only equations in class A that pass the Lie’s linearization test are the equations in subclass A1 . This result has been proven in the Theorem 7 of [7] by using a constructive proof. A local transformation

U ¼ Rðx; uÞ;

X ¼ TðxÞ;

ð36Þ

that transforms any equation of the subclass A1 into the linear equation (7) can be constructed in terms of any solution g ¼ gðxÞ of the 2nd-order linear equation (21), where f is defined by (20): the function R ¼ Rðx; uÞ in (36) can be any solution of the linear system

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

Rx ðx; uÞ ¼

Bðx; uÞ gðxÞ

2

Ru ðx; uÞ ¼

;

Aðx; uÞ

155

ð37Þ

gðxÞ2

and the function S ¼ TðxÞ in (36) is any primitive of the function 1=gðxÞ2 , i.e., the function T satisfies

1

T 0 ðxÞ ¼

gðxÞ2

ð38Þ

:

In the classA procedure we use the inner routine subcreate (or intsys if the optional argument method has been provided) described in Section 4, with arguments

u1 ¼

Bi ; g 2i

u2 ¼

Ai g 2i

for i ¼ 1; 2. The output provides two solutions R1 and R2 , satisfying the system (37) for g 1 ¼ solg1 and g 2 ¼ solg2, respectively. The procedure computes two primitives of the functions g 1 ; g 2 and provides two functions T 1 ; T 2 . The command linearizationL displays an array with the arrays ½R1 ; T 1  and ½R2 ; T 2 . These two pairs of functions define two local transformations (36) that linearize the corresponding equation. 7. Examples 7.1. Example 1 In this example we use the classA procedure to compute two independent first integrals, the associated integrating factors, the general solution, the k-symmetries and the local linearizing transformations of the Eq. (10), which is in the class A1 . After executing any of the two forms of the calling sequence, any of the available commands can be requested. We can use the command func to obtain the function (20) that determines the 2nd-order linear equation (21): 2

f ðxÞ ¼

4 mnx2  k þ 2 k : 4x2

ð39Þ

pffiffiffi The local variables solg1; solg2 are two independent solutions of the corresponding equation (21): g 1 ðxÞ ¼ xf 1 ðxÞ and pffiffiffi g 2 ðxÞ ¼ xf 2 ðxÞ, where f 1 ; f 2 can be expressed in terms of the Bessel functions, BesselJ and BesselY, of the first and second kinds, respectively [11,12]:

f 1 ðxÞ ¼ BesselJ

  pffiffiffiffiffiffiffi 1 ðk  1Þ; mnx ; 2

f 2 ðxÞ ¼ BesselY

  pffiffiffiffiffiffiffi 1 ðk  1Þ; mnx : 2

ð40Þ

The command firstIntegral returns an array with two independent first integrals of the form (19):

pffiffiffiffiffiffiffi   mn 1 f 3 ðxÞ ; I1 ðx; u; u1 Þ ¼ x2ðkþ1Þ en u f 1 ðxÞu1 þ n pffiffiffiffiffiffiffi   mn 1ðkþ1Þ n u f 4 ðxÞ ; I2 ðx; u; u1 Þ ¼ x2 e f 2 ðxÞu1 þ n

ð41Þ

where

f 3 ðxÞ ¼ BesselJ

  pffiffiffiffiffiffiffi 1 ðk þ 1Þ; mnx ; 2

f 4 ðxÞ ¼ BesselY

  pffiffiffiffiffiffiffi 1 ðk þ 1Þ; mnx : 2

ð42Þ

The related integrating factors of Eq. (10), written in the form (3), are given by intFactorA: 1

1

l1 ¼ x2ðkþ1Þ enuðxÞ f 1 ðxÞ; l2 ¼ x2ðkþ1Þ enuðxÞ f 2 ðxÞ:

ð43Þ

The generalsol command provides the general solution, in terms of the Bessel functions given in (40) and (42):

uðxÞ ¼

1 2n

!

2

ln

nðK 1 f 2 ðxÞ  K 2 f 1 ðxÞÞ

mðf 2 ðxÞf 3 ðxÞ  f 4 ðxÞf 1 ðxÞÞ

2

!  ð1 þ kÞ ln ðxÞ ;

K 1 ; K 2 2 R:

ð44Þ

The Maple commands firtest, mutest and odetest can be used to check the first integrals (41), the integrating factors (43) and the explicit solution (44), respectively:

156

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

>map(DEtools[firtest], firstIntegral, ode); [0,0] >map(DEtools[mutest], intFactorA, ode); [0,0] >odetest(u(x)=generalsol,ode); 0 The equations in the family (10) are in the subclass A1 and therefore, they admit two different classes of equivalence of k-symmetries, defined by the pairs ð@ u ; k1 c Þ and ð@ u ; k2 c Þ. The corresponding functions k1c ; k2c are given in an array with the command lambdasym:



f ðxÞ pffiffiffiffiffiffiffi f ðxÞ pffiffiffiffiffiffiffi mn; nu1  4 mn ; nu1  3 f 1 ðxÞ f 2 ðxÞ

ð45Þ

where the functions f i , for 1 6 i 6 4, are the Bessel functions given in (40)–(42). It should be observed that, although Eq. (10) admits eight-dimensional algebra of Lie point symmetries [1,7], the Maple system fails in providing them with the symgen(ode, way = all) command. Nevertheless, the classA procedure provides the two nonequivalent k-symmetries (45), which permit Eq. (10) to be completely integrated. Since Eq. (10) is in subclass A1 , we use the linearizationL command to obtain the following two pairs of functions R ¼ Rðx; uÞ and T ¼ TðxÞ that define the local linearizing transformation (9): 1

R1 ðx; uÞ ¼

x2ðk1Þ enu ; nf1 ðxÞ

T 1 ðxÞ ¼

p f 4 ð xÞ 2f 1 ðxÞ

1

x2ðk1Þ enu ; R2 ðx; uÞ ¼ nf4 ðxÞ

T 2 ðxÞ ¼ 

;

p f 1 ðxÞ 2f 4 ðxÞ

ð46Þ :

In (46) the functions f 1 and f 4 are defined in (40) and (42), respectively. 7.2. Example 2 In this example we apply the procedure classA to compute the first integrals of the Painlevé VI equation (11) for the parameters given in (12), which is in class A1 :

x2 

    1 1 1 1 1 1 1 xðx  1Þ x21 þ x1  ¼ 0: þ þ þ þ 2 x x1 xt t t1 xt 2tðt  1Þðx  tÞ

ð47Þ

In this case we use the first form of the calling sequence, with the optional argument method = [1, 2] to force the use of the inner routine intsys: > classAð½1=ð2  xÞ  1=ð2  ðx  1ÞÞ  1=ð2  ðx  tÞÞ; 1=t þ 1=ðt  1Þ þ 1=ðx  tÞ; ð1=2Þ  x  ðx  1Þ=ððx  tÞ  t  ðt  1ÞÞ; ½x; t; ½1; 2Þ; pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 Two independent solutions to the corresponding Eq. (21), where f ðtÞ ¼ 4tt 2 tþ1 , are given by g 1 ðtÞ ¼ t ðt  1Þf 1 ðtÞ and ðt1Þ2 pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi g 2 ðtÞ ¼ tðt  1Þf 2 ðtÞ, where the functions f 1 ; f 2 can be expressed in terms of the complete elliptic integral of the first kind (EllipticK) [11,12]:

pffiffi f 1 ðtÞ ¼ EllipticK t ;

pffiffiffiffiffiffiffiffiffiffiffi f 2 ðtÞ ¼ EllipticK 1  t :

After some simplifications, the command firstIntegral provides two independent first integrals of Eq. (47):

I1 ¼ q1 ðt; xÞf 1 ðtÞx1  f 4 ðtÞq2 ðt; xÞ  q3 ðt; xÞf 1 ðtÞ; I2 ¼ q1 ðt; xÞf 2 ðtÞx1  ðf 2 ðtÞ  f 3 ðtÞÞq2 ðt; xÞ  q3 ðt; xÞf 2 ðtÞ; where

t ðt  1Þ

k ðt; xÞ

q1 ðt; xÞ ¼ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ; q2 ðt; xÞ ¼ p2ffiffiffiffiffiffiffiffiffiffiffi ; xðx  1Þðx  tÞ

q3 ðt; xÞ ¼

pffiffiffiffiffiffiffiffiffiffiffi 1  t k1 ðt; xÞ þ

pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi! xðx  1Þ pffiffiffiffiffiffiffiffiffiffiffi xt

1t

ð48Þ

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

157

and the functions f 3 ; f 4 ; k1 ; k2 can be expressed in terms of the incomplete elliptic integrals of the first and second kind (EllipticF and EllipticE, respectively):

pffiffiffiffiffiffiffiffiffiffiffi pffiffi f 3 ðtÞ ¼ EllipticE 1  t ; f 4 ðtÞ ¼ EllipticE t rffiffiffiffiffiffiffiffiffiffiffi rffiffiffiffiffiffiffiffiffiffiffi! rffiffiffiffiffiffiffiffiffiffiffi rffiffiffiffiffiffiffiffiffiffiffi! xt t xt t ; ; k2 ðt; xÞ ¼ EllipticF ; : k1 ðt; xÞ ¼ EllipticE t t1 t t1

ð49Þ

The coefficients of x1 in I1 ; I2 are the related integrating factors, that can be obtained with the intFactorA command. The generalsol command provides, after some simplifications and conversions, the general solution of Eq. (47) in terms of the Jacobi elliptic function sn (JacobiSN) ([11,12]):

0

1 rffiffiffiffiffiffiffiffiffiffiffi!!2 pffiffiffiffiffiffiffiffiffiffiffi ð f ð t Þ  K f ð t Þ Þ t 1  t K 2 1 1 2 xðtÞ ¼ t @ JacobiSN ;  1A; f 3 ðtÞf 1 ðt Þ þ f 2 ðtÞf 4 ðt Þ  f 2 ðt Þf 1 ðt Þ t1 where K 1 ; K 2 2 R. This is a quite compact form for the general solution, compared with the general solution provided by the Maple command dsolve. The k-symmetries of the Painlevé VI equation (47), which is in the subclass A1 , can be calculated with the lambdasym command:

  1 1 1 1 x 1 f 4 ðtÞ x1  þ þ  ; 2 x x1 xt 2ðx  t Þt 2t ðt  1Þ f 1 ðtÞ   1 1 1 1 x1 1 f 3 ðtÞ x1  ¼ þ þ ; þ 2 x x1 xt 2ðt  1Þðx  tÞ 2t ðt  1Þ f 2 ðtÞ

k1c ¼  k2c

ð50Þ

where the functions f i , for 1 6 i 6 4, are given in (48) and (49). The symmetry generators of Eq. (47) are not provided by the Maple system, although the equation admits eight-dimensional algebra of Lie point symmetries. For the Painlevé VI equation (47) we need to use the optional argument method = [1,2] to compute two pairs of functions R ¼ Rðx; uÞ and T ¼ TðxÞ that define two local linearizing transformations of the form (9):

2 k2 ðt; xÞ R1 ðt; xÞ ¼  pffiffiffiffiffiffiffiffiffiffiffi ; 1  t f 1 ðt Þ 2 k2 ðt; xÞ R2 ðt; xÞ ¼  pffiffiffiffiffiffiffiffiffiffiffi ; 1  t f 2 ðxÞ

T 1 ðtÞ ¼

Z

T 2 ðtxÞ ¼

1

dt;

tðt  1Þf 1 ðtÞ2 Z 1

ð51Þ 2

tðt  1Þf 2 ðtÞ

dt;

where the functions f 1 ; f 2 are defined in (48) and k2 is given in (49). 7.3. Example 3 In this example we consider equations of the form (13) that are in the subclass A2 . We choose the sets of values (17) to illustrate the procedure that compute a first integral of the form (2) of the equation

u2  3

! 2 2 u21 2 k k6  k5 u1 þ k4 u3 þ k5 u2 þ k6 u ¼ 0: þ k3 u þ 3 u k5 k3

ð52Þ

Let us remark that for the equations in the subclass A2 , the coefficients A and B of such first integral can be found by integration of the systems (27) and (28), which only depend on the coefficients of the given equation. The first integral derived with the command firstIntegral provides k x

I¼e

 k5

3

  u1 k3 k4 u2 þ k5 u þ k6  k5 u2 u3

ð53Þ

and intFactorA gives the associated integrating factor l ¼ ek5 x=k3 u3 . The generalsol command does not provide the general solution of Eq. (52) because the Maple system is not able to solve the Abel-type equation I ¼ C 1 ; C 1 2 R: >generalsol;

 1 9 08 0 1 2 < k5 x = k k uðxÞ þ k uðxÞ þ k 3 4 5 6 1 d k @ @ A  C1 ; fuðxÞgA: uðxÞ  DESol e 3 : ; uðxÞ3 dx k5 uðxÞ2

158

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

Nevertheless, we can obtain a one-parameter family of solutions by setting C 1 ¼ 0, because the equation I ¼ 0 can be integrated by quadrature:



Z

k5 du þ C 2 : k3 uðu2 k4 þ uk5 þ k6 Þ

ð54Þ

In this way we get a one-parameter family of solutions of Eq. (52), given in implicit form:

0 1   u2 2 k 5 ln u2 k þuk þk k5 2 uk þ k B 4 5 C 5 4 6 qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi arctan @qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiA þ x ¼ C2: 2 k3 k6 2 2 k3 k6 4 k4 k6  k5 4 k4 k6  k5 For Eq. (52) the lambdasym command provides a unique function of the form (6) that defines the k-symmetry ð@ u ; kc Þ:

kc ¼ 3

u1 k3 ðk5 u þ 2 k6 Þ  : k5 u

ð55Þ

The command symgen in the Maple system provides a unique Lie point symmetry v ¼ @ x . The canonical representative of this Lie point symmetry is defined by the function 2

2

AQ u1 2 k3 k6 þ k5 k1 ¼ ¼3  k3 u þ Q u k5 k3

! 

k4 u3 þ k5 u2 þ k6 u ; u1

ð56Þ

where A denotes the vector field associated to Eq. (52) and Q ¼ u1 is the characteristic of the Lie symmetry v ¼ @ x . Since the functions (55) and (56) are not equal, the k-symmetries ð@ u ; kc Þ and ð@ u ; k1 Þ are not A-equivalent. The first integral (53), associated to the k-symmetry ð@ u ; kc Þ, and any first integral, I2 , associated to the Lie point symmetry v ¼ @ x are functionally independent (see Section 5 in [4] for details). By the classical Lie method of reduction, such first integral I2 ¼ I2 ðx; u; u1 Þ can be expressed in terms of the implicit solution Gðu; wÞ ¼ C; C 2 R, of the Abel type equation

  2 2 2 k3 k5 u þ 2 k3 k6  k5 w2 w w1 ¼ k4 u2 þ k5 u þ k6 uw3 þ 3 u k5 k3

ð57Þ

k5 is a particular solution of (57). ðu2 k4 þuk5 þk6 Þ Since Eq. (52) is in subclass A2 , we use the command linearizationS to compute the functions F and G that defines the generalized Sundman transformation (8). We obtain:

in the form I2 ðx; u; u1 Þ ¼ Gðu; 1=u1 Þ. By (54), wðuÞ ¼ k

3u

k5 x

Fðx; uÞ ¼ uðHðx; uÞÞ;

Gðx; uÞ ¼ 

u0 ðHðx; uÞÞk5 u2 e k3

ðk4 u2 þ k5 u þ k6 Þk3

ð58Þ

;

where u is an arbitrary smooth function of one variable and

  k5 u2  Hðx; uÞ ¼ x  ln 2 2 k3 k6 u k4 þ uk5 þ k6

2

0

1

k5 B 2 uk4 þ k5 C qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi arctan @qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiA: 2 2 k3 k6 4 k4 k6  k5 4 k4 k6  k5

7.4. Example 4 The equation

x2 

2 t þ t x1 2 t x  x x21   ¼0 x x x

ð59Þ

does not admit Lie point symmetries. The procedure classA reveals that it is in the subclass A2 , so it admits a k-symmetry of the form (6), defined by the function

kc ¼

x1 t ð t þ 1 Þ þ x x

displayed with the lambdasym command. The associated first integral is given by firstIntegral:



x1 t ð t þ 1 Þ þ ; x x

ð60Þ

whereas intFactorA provides the related integrating factor l ¼ 1=x. In this example, and in spite of the lack of Lie point symmetries, the procedure classA succeeds in giving the general solution of the equation by solving the auxiliary equation I ¼ k1 ; k1 2 R:

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

xðt Þ ¼

t2 þ t 2 t þ 1 2 þ þ 3 þ ek1 t k2 ; 2 k1 k1 k1

159

k1 ; k2 2 R:

We also observe that Maple commands intfactor and firint provides two integrating factors and two related first integrals of Eq. (59), but these first integrals are functionally dependent. The output of the linearizationS command. >linearizationS; [_F1((1/3)*t^3+(1/2)⁄t^2 + x), D(_F1)((1/3)⁄t^3+(1/2)⁄t^2 + x) x]

provides a generalized Sundman transformation (8)

  1 3 1 2 Fðx; uÞ ¼ u t þ t þx ; 3 2

Gðx; uÞ ¼ u0

  1 3 1 2 t þ t þ x x; 3 2

where u is an arbitrary smooth function. 8. Concluding remarks This is the first Maple procedure based on the theory of k-symmetries for the analytical study of a class of 2nd-order ODEs. The procedure identifies the equations that belongs to the class A and classifies them into the subclasses A1 and A2 , even if the equations depend on arbitrary parameters. The studied equations have significant properties in the framework of first integrals and linearization approaches. The procedure determines two independent first integrals of the form (2) for the equations in subclass A1 and the related integrating factors. In this case, the general solution arises from the two first integrals. All the equations in subclass A1 passes the Lie’s test of linearization and the procedure provides local transformations to linearize them. For the equations in subclass A2 the procedure determines one first integral of the form (2) and the corresponding integrating factor. In some cases the general solution arises from the reduction derived from this first integral, even for equations lacking Lie point symmetries, as for Eq. (59). The procedure also determines generalized Sundman transformations to linearize the equations in subclass A2 . All the algorithms are based on the existence of a specific type of k-symmetries, which is determined by the procedure. Although the equations in subclass A1 admit eight-dimensional algebra of Lie point symmetries, in some cases, as for Eqs. (10) and (47), such symmetries may be difficult to compute. Many of the equations in subclass A2 do not admit enough symmetries to be integrated. In this context, the k-symmetries provided by the classA procedure are very important for obtaining information on exact solutions, first integrals, integrating factors and linearizing transformations (local or nonlocal). Acknowledgments C. Muriel and J.L. Romero acknowledge the financial support from the University of Cádiz and Junta de Andalucía to the research group FQM 377. The authors also wish to thank Dr. José Ramírez for his useful and constructive comments on this study. Appendix A. Maple code of the classA procedure classA :¼ proc (cof, var, method :¼ [], constants :¼ {}) description "Study of ODEs of the class A"; local dvar, ivar, n, term, eopt, optn, opt, ecte, cte, cten, ti, solg, gg, solg1, solg2, solh, hh, solp, sol, A, Asub1, Asub2, Bsub1, Bsub2, tt, sistemaf, solR, lambda1, lambda2, coefGenerator, subcreate, intsys, lambacreate, coeficientes, rxa, rxa2, rxb, rxb2, Sa, Sb, coef; global ode, test, s, firstIntegral, generalsol, lambdasym, linearizationL, linearizationS, intFactorA, suggestA1, suggestA2, func; coefGenerator :¼ proc (ecu, var, coefG) local ec, tem, a2, a1, a0; ec :¼ eval(convert(ecu, diff), [var[1] = vu, var[2] =vx]); tem :¼ -(eval(solve(ec, diff(vu(vx), ‘$‘(vx, 2))), [diff(vu(vx), vx) = u1, vu(vx) = vu])); (continued on next page)

160

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

a2 :¼ coeff(tem, u1, 2); a1 :¼ coeff(tem, u1, 1); a0 :¼ eval(tem, u1 = 0); coefG :¼ simplify(eval ([a2, a1, a0], [vu = var[1], vx = var[2]])) end proc; subcreate :¼ proc (ivar, var, xx1, xx2, valor) local pfunc, sistemap, solsist; sistemap :¼ {diff(pfunc(ivar, var[1]), var[1]) = xx2, diff(pfunc(ivar, var[1]), ivar) = xx1}; try solsist :¼ timelimit(10, value(subs(_C1 = 0, op(pdsolve(sistemap, pfunc(ivar,var[1])))))) catch: print("Limit time exceeded. Please, try re-entering the command classA with the optional argument method=[1,2] or method=[2,1]") end try; valor :¼ simplify(expand(op(2, solsist))) end proc; intsys :¼ proc (ec, var, seq, valor) local phi, dphi, ctphi, v; phi :¼ simplify(value( int(ec[seq[1]], var[seq[1]])))+v(var[seq[2]]); phi :¼ simplify(expand( diff(phi, var[seq[2]])-ec[seq[2]])); ctphi :¼ simplify(subs(_C1 = 0, dsolve( simplify(expand(dphi)), v(var[seq[2]])))); valor :¼ simplify(expand( subs(v(var[seq[2]]) = op(2, ctphi), phi))) end proc; lambacreate :¼ proc (var, dvar, Asubn, Bsubn, valor) valor :¼ subs(var[1] = dvar, simplify([-(diff(Asubn, var[1]))/Asubn, -(diff(Bsubn, var[1]))/Asubn])) end proc; coeficientes :¼ proc (var, expresion) coeffs(collect(numer(expresion), {var[1], var[2]}, ’distributed’), {var[1], var[2]}) end proc; if_params[’var’] = NULL then error "the calling sequence classA(coef,var) requires the dependent variable (vardep) and the independent variable (varind) of the ODE in the form var=[vardep,varind] " else dvar :¼ var[1](var[2]); assign(ivar = var[2]) end if; n :¼ nops(_params[’cof’]); if n = 1 then coefGenerator(op(cof), var, coef); n :¼ nops(coef) else coef :¼ cof end if; if n <> 3 then error "the calling sequence classA(coef,var) requires the three coefficients of the ODE in the form coef=[a2,a1,a0] " end if; term :¼ subs(var[1] = dvar, coef); eopt :¼ ‘if‘(type(_params[’method’], list), 1, 0); if_params[’method’] = [] or eopt = 0 then optn :¼ 0; opt :¼ 0 else optn :¼ 1; opt :¼ method end if; ecte :¼ ‘if‘(type(_params[’constants’], set), 1, 0); if ecte = 1 then cte :¼ constants; if cte <> {} then cten :¼ 1 else cten :¼ 0 end if end if; if eopt = 0 then cte :¼ method end if; if cte <> {} then cten :¼ 1 end if; unassign(’ode’, ’firstIntegral’, ’lambdasym’, ’Integral1’,

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

161

’Integral2’, ’generalsol’, ’intFactorA’, ’test’, ’linearizationL’, ’func’, ’linearizationS’, ’suggestA1’, ’suggestA2’); ti :¼ time(); s[1] :¼ simplify(diff(coef[2], var[1])-2⁄(diff(coef[1], ivar))); s[2] :¼ simplify(diff(coef[3]⁄coef[1] +diff(coef[3], var[1]),var[1]) +diff(diff(coef[1], ivar) -(diff(coef[2], var[1])), ivar) +coef[2]⁄(diff(coef[1], ivar) -(diff(coef[2], var[1])))); ode :¼ diff(dvar, ‘$‘(ivar, 2))+term[1]⁄(diff(dvar, ivar))^2 +term[2]⁄(diff(dvar, ivar))+term[3] = 0; if s[1] = 0 and s[2] = 0 then func :¼ simplify(coef[3]⁄coef[1]+diff(coef[3], var[1])-(1/2)⁄(diff(coef[2], ivar))-(1/4)⁄coef[2]^2); test :¼ "Subclass A1"; try solg :¼ dsolve( diff(gg(ivar), ‘$‘(ivar, 2)) = -func⁄gg(ivar), gg(ivar)); assign(solg) catch: print("g1 and g2 are functionally independent solutions of", diff(g(ivar), ‘$‘(ivar, 2)) =-simplify(func)⁄g(ivar)); WARNING("The procedure was unable to provide two functionally independent solutions of", diff(g(ivar), ‘$‘(ivar, 2)) =-simplify(func)⁄g(ivar)); return end try; solg1 :¼ subs(_C1 = 1, _C2 = 0, gg(ivar)); solg2 :¼ subs(_C1 = 0, _C2 = 1, gg(ivar)); if solg1 = 0 or solg2 = 0 then solh :¼ simplify(riccatisol(diff(hh(ivar), ivar) + hh(ivar)^2 + func, hh(ivar))); assign(solh); solg1 :¼ simplify(exp(int(subs(_C1 = 0, hh(ivar)), ivar))); solg2 :¼ simplify(exp(int(subs(_C1 = 1, hh(ivar)), ivar))) end if; if optn = 0 then subcreate(ivar, var, (1/2)⁄coef[2], coef[1], solp) else intsys([coef[1], (1/2)⁄coef[2]], var, opt, solp) end if; Asub1 :¼ simplify(solg1⁄exp(solp)); Asub2 :¼ simplify(solg2⁄exp(solp)); if Asub1 = Asub2 then print(test); print("Aborted. The procedure was unable to provide two functionally independent solutions of ", diff(g(ivar), ‘$‘(ivar, 2)) = -simplify(func)⁄g(ivar)); return end if; if optn = 0 then subcreate(ivar, var, coef[3]⁄Asub1, ((1/2)⁄coef[2]-(diff(solg1, ivar))/solg1)⁄Asub1, rxa); subcreate(ivar, var, coef[3]⁄Asub2, ((1/2)⁄coef[2]-(diff(solg2, ivar))/solg2)⁄Asub2, rxb) else intsys([((1/2)⁄coef[2]-(diff(solg1, ivar))/solg1)⁄Asub1, coef[3]⁄Asub1], var, opt, rxa); intsys([((1/2)⁄coef[2]-(diff(solg2, ivar))/solg2)⁄Asub2, coef[3]⁄Asub2], var, opt, rxb) (continued on next page)

162

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

end if; Bsub1 :¼ simplify(expand(rxa)); Bsub2 :¼ simplify(expand(rxb)); A :¼ subs(var[1] = dvar, [Asub1, Asub2, Bsub1, Bsub2]); firstIntegral :¼ [A[1]⁄(diff(dvar, ivar))+A[3], A[2]⁄(diff(dvar, ivar))+A[4]]; intFactorA :¼ [A[1], A[2]]; lambacreate(var, dvar, Asub1, Bsub1, lambda1); lambacreate(var, dvar, Asub2, Bsub2, lambda2); lambdasym :¼ [lambda1[1]⁄(diff(dvar, ivar))+lambda1[2], lambda2[1]⁄(diff(dvar, ivar))+lambda2[2]]; try sol :¼ simplify((_K1-A[3])/A[1]-(_K2-A[4])/A[2]) catch: sol :¼ (_K1-A[3])/A[1]-(_K2-A[4])/A[2] end try; try generalsol :¼ solve(sol = 0, {dvar}) catch: print(’’The⁄general⁄solution⁄is’’, sol = 0) end try; if optn = 0 then subcreate(ivar, var, Bsub1/solg1^2, Asub1/solg1^2, rxa2); subcreate(ivar, var, Bsub2/solg2^2, Asub2/solg2^2, rxb2) else intsys([Asub1/solg1^2, Bsub1/solg1^2], var, opt, rxa2); intsys([Asub2/solg2^2, Bsub2/solg2^2], var, opt, rxb2) end if; Sa :¼ int(1/solg1^2, ivar); Sb :¼ int(1/solg2^2, ivar); linearizationL :¼ [[rxa2, Sa], [rxb2, Sb]]; s[3] :¼ s3; s[4] :¼ s4 elif s[1] <> 0 then s[3] :¼ simplify(diff(s[2]/s[1], var[1])-(diff(coef[1], ivar)) +diff(coef[2], var[1])); s[4] :¼ simplify(diff(s[2]/s[1], ivar)+s[2]^2/s[1]^2 + coef[2] ⁄s[2]/s[1]+coef[3]⁄coef[1]+diff(coef[3], var[1])); if s[3] = 0 and s[4] = 0 then test :¼ "Subclass A2"; if optn = 0 then subcreate(ivar, var, coef[2]+s[2]/s[1], coef[1], solp) else intsys([coef[1], coef[2]+s[2]/s[1]], var, opt, solp) end if; Asub1 :¼ simplify(exp(solp)); if optn = 0 then subcreate(ivar, var, coef[3]⁄Asub1, -s[2]⁄Asub1/s[1], rxa) else intsys([-s[2]⁄Asub1/s[1], coef[3]⁄Asub1], var, opt, rxa) end if; Bsub1 :¼ simplify(expand(rxa)); A :¼ subs(var[1] = dvar, [Asub1, Bsub1]); firstIntegral :¼ [A[1]⁄(diff(dvar, ivar))+A[2]]; intFactorA :¼ [A[1]]; lambacreate(var, dvar, Asub1, Bsub1, lambda1); lambdasym :¼ lambda1[1]⁄(diff(dvar, ivar))+lambda1[2]; generalsol :¼ dsolve(firstIntegral[1] = _C1, {dvar}); if generalsol = NULL then generalsol :¼ DESol(firstIntegral[1]-_C1, {dvar}) end if;

J. Vidal et al. / Applied Mathematics and Computation 249 (2014) 147–163

163

sistemaf :¼ {Asub1⁄(diff(ffunc(ivar, var[1]), ivar)) = Bsub1⁄(diff(ffunc(ivar, var[1]), var[1]))}; solR :¼ simplify(op(pdsolve(sistemaf, ffunc(ivar, var[1])))); linearizationS :¼ [op(2, solR), simplify((diff(op(2, solR), var[1]))/Asub1)] else if cten = 1 then suggestA1 :¼ solve(map2(coeficientes, var, {s[1], s[2]}), cte); suggestA2 :¼ solve(map2(coeficientes, var, {s[3], s[4]}), cte); WARNING("Use the commands suggestA1 (for subclass A1) and suggestA2 (for subclass A2) to find possible values of %1 for which the ODE is in subclass A1 (subclass A2)", cte); test :¼ "The ODE may be in class A for some values of %1", cte" else test :¼ "The ODE is not in class A" end if end if else if cten = 1 then suggestA1 :¼ solve({coeficientes(var, s[2])}, cte); WARNING("Use the command suggestA1 to find possible values of %1 for which the ODE is in subclass A1", cte); test :¼ "The ODE may be in subclass A1 for some values of %1", cte" else test :¼ "The ODE is not in class A" end if end if; print(Procedure⁄completed); tt :¼ time()-ti; print(Time, tt⁄seconds); test end proc

References [1] C. Muriel, J.L. Romero, Second-order ordinary differential equations and first integrals of the form Aðt; xÞx_ þ Bðt; xÞ, J. Nonlinear Math. Phys. 16 (2009) 209–222, http://dx.doi.org/10.1142/S1402925109000418. [2] C. Muriel, J.L. Romero, New methods of reduction for ordinary differential equations, IMA J. Appl. Math. 66 (2001) 111–125, http://dx.doi.org/10.1093/ imamat/66.2.111. [3] C. Muriel, J.L. Romero, k-Symmetries on the derivation of first integrals of ordinary differential equations, in: Proceedings WASCOM 2009 15th Conference on Waves and Stability in Continuous Media, World Sci. Publ., Hackensack, NJ, 2010, pp. 303–308, http://dx.doi.org/10.1142/ 9789814317429-0041. [4] C. Muriel, J.L. Romero, First integrals, integrating factors and k-symmetries of second-order differential equations, J. Phys. A 42 (2009) 365207, http:// dx.doi.org/10.1088/1751-8113/42/36/365207. 17p. [5] L.G.S. Duarte, I.C. Moreira, F.C. Santos, Linearization under nonpoint transformations, J. Phys. A: Math. Gen. 27 (1994) L739, http://dx.doi.org/10.1088/ 0305-4470/27/19/004. URL . [6] N. Euler, T. Wolf, P. Leach, M. Euler, Linearisable third-order ordinary differential equations and generalised Sundman transformations: the case X 000 ¼ 0, Acta Appl. Math. 76 (2003) 89–115, http://dx.doi.org/10.1023/A:1022838932176. [7] C. Muriel, J.L. Romero, Nonlocal transformations and linearization of second-order ordinary differential equations, J. Phys. A 43 (2010) 434025, http:// dx.doi.org/10.1088/1751-8113/43/43/434025. 13p. [8] C. Muriel, J. Romero, Symmetries and linearization of ordinary differential equations through nonlocal transformations, in: Proceedings of the Third Conference on Nonlinear Science and Complexity, 2010, pp. 88–92. [9] E.S. Cheb-Terrab, L.G.S. Duarte, L.A.C.P. da Mota, Computer algebra solving of second order ODEs using symmetry methods, Comput. Phys. Commun. 108 (1998) 90–114, http://dx.doi.org/10.1016/S0010-4655(97)00132-X. [10] E. Cheb-Terrab, A. Roche, Integrating factors for second-order ODEs, J. Symb. Comput. 27 (1999) 501–519, http://dx.doi.org/10.1006/jsco.1999.0264. [11] F. Olver, NIST Handbook of Mathematical Functions, Cambridge University Press, 2010. [12] M. Abramowitz, I. Stegun, Handbook of Mathematical Functions: with Formulas, Graphs, and Mathematical Tables, Applied Mathematics Series, Dover Publications, 1964.