AMApplied Mathematics2152-7385Scientific Research Publishing10.4236/am.2019.106030AM-93048ArticlesPhysics&Mathematics Homotopy Analysis Method for Solving Initial Value Problems of Second Order with Discontinuities WaleedAl-Hayani1*RashaFahad1Department of Mathematics, College of Computer Science and Mathematics, Mosul University, Mosul, Iraq14062019100641943430, March 201914, June 2019 17, June 2019© Copyright 2014 by authors and Scientific Research Publishing Inc. 2014This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/

In this paper, the standard homotopy analysis method was applied to initial value problems of the second order with some types of discontinuities, for both linear and nonlinear cases. To show the high accuracy of the solution results compared with the exact solution, a comparison of the numerical results was made applying the standard homotopy analysis method with the iteration of the integral equation and the numerical solution with the Simpson rule. Also, the maximum absolute error, , the maximum relative error, the maximum residual error and the estimated order of convergence were given. The research is meaningful and I recommend it to be published in the journal.

Homotopy Analysis Method Initial Value Problems Heaviside Step Function Dirac Delta Function Simpson Rule
1. Introduction

Liao Shijun    proposed in 1992 in his Ph.D. dissertation a new and fruitful method (Homotopy Analysis Method (HAM)) for solving linear and nonlinear (ordinary differential, partial differential, integral, etc.) equations. It has been shown that this method yields a rapid convergence of the solutions series to linear and nonlinear deterministic.

In recent literature, Al-Hayani and Casasùs   applied the Adomian decomposition method (ADM) to the initial value problems (IVPs) with discontinuities. Ji-Huan  used the homotopy perturbation method (HPM) solving for nonlinear oscillators with discontinuities.

In the consulted bibliography we have not found any results of the application of the HAM to differential problems with discontinuities. For this reason, this paper systematically analyzes its application to IVPs of ODEs of second order with independent non-continuous term. We have treated functions with a discontinuous derivative, with some of Heaviside step function and with Dirac delta function.

In what follows, we give a brief review of the HAM.

2. Basic Idea of HAM

In this article, we apply the HAM to the discussed problem. To show the basic idea, we consider the following differential equation

N [ u ( x ) ] = k ( x ) , (2.1)

where N is a nonlinear operator, x denotes independent variable, u ( x ) is an unknown function, and k ( x ) is a known analytic function. For simplicity, we ignore all boundary or initial conditions, which can be treated in the similar way. By means of generalizing the traditional homotopy method, Liao    constructs the so-called zero-order deformation equation

( 1 − q ) L [ ϕ ( x ; q ) − u 0 ( x ) ] = q h H ( x ) { N [ ϕ ( x ; q ) ] − k ( x ) } , (2.2)

where q ∈ [ 0 , 1 ] is an embedding parameter, h ≠ 0 , is a non-zero auxiliary parameter H ( x ) ≠ 0 is an auxiliary function, L is an auxiliary linear operator, u 0 ( x ) is an initial guess of u ( x ) and ϕ ( x ; q ) is an unknown function. It is important to note that one has great freedom to choose auxiliary objects such as h and L in the HAM. Obviously when q = 0 and q = 1 , both

ϕ ( x ; 0 ) = u 0 ( x )     and     ϕ ( x ; 1 ) = u ( x ) (2.3)

hold. Thus as q increases from 0 to 1, the solution ϕ ( x ; q ) varies from the initial guess u 0 ( x ) to the solution u ( x ) . Expanding ϕ ( x ; q ) in Taylor series with respect to q, one has

ϕ ( x ; q ) = u 0 ( x ) + ∑ m = 1 + ∞ u m ( x ) q m , (2.4)

where

u m = 1 m ! ∂ m ϕ ( x ; q ) ∂ q m | q = 0 , (2.5)

If the auxiliary linear operator, the initial guess, the auxiliary parameter h, and the auxiliary function are so properly chosen, then the series (2.4) converges at q = 1 and one has

ϕ ( x ; 1 ) = u 0 ( x ) + ∑ m = 1 + ∞ u m ( x ) , (2.6)

which must be one of the original non-linear equation, as proved by Liao    . If h = − 1 , Equation (2.2) becomes

( 1 − q ) L [ ϕ ( x ; q ) − u 0 ( x ) ] + q { N [ ϕ ( x ; q ) − k ( x ) ] } = 0 , (2.7)

which is used mostly in the HPM   .

According to Equation (2.5), the governing equations can be deduced from the zeroth-order deformation Equations (2.2). We define the vectors

u i = { u 0 ( x ) , u 1 ( x ) , ⋯ , u i ( x ) } . (2.8)

Differentiating Equation (2.2) m times with respect to the embedding parameter q and then setting q = 0 and finally dividing them by m ! , we have the so-called mth-order deformation equation

L [ u m ( x ) − X m u m − 1 ( x ) ] = h R m ( u m − 1 ) , (2.9)

where

R m ( u m − 1 ) = 1 ( m − 1 ) ! ∂ m − 1 { N [ ϕ ( ; q ) ] − k ( x ) } ∂ q m − 1 | q = 0 , (2.10)

and

X m = { 0 ,         m ≤ 1 , 1 ,         m > 1. (2.11)

It should be emphasized that u m ( x ) ( m ≥ 1 ) are governed by the linear equation (2.9) with the linear boundary conditions that come from the original problem, which can be easily solved by symbolic computation softwares such as Maple and Mathematica.

3. HAM Applied to an IVP of the Second Order

Consider the general IVP of the second order  :

u ″ + g ( u , u ′ ) + k 2 u = λ f ( x , u , u ′ ) ,     0 ≤ x ≤ T , u ( 0 ) = α ,     u ′ ( 0 ) = β , (3.1)

where k , λ , α and β are real constants, g is a (possibly) nonlinear function of u , u ′ and f is a function with some discontinuity.

To sole Equation (3.1) by means of the standard HAM, we choose the initial approximations

u ( 0 ) = α ,     u ′ ( 0 ) = β , (3.2)

and the linear operator

L [ ϕ ( x ; q ) ] = ∂ 2 ϕ ( x ; q ) ∂ x 2 , (3.3)

with the property

L [ c 1 + c 2 x ] = 0 , (3.4)

where c 1 and c 2 are constants of integration. Furthermore, Equation (3.1) suggests that we define the nonlinear operator as

N [ ϕ ( x ; q ) ] = ∂ 2 ϕ ( x ; q ) ∂ x 2 + g ( ϕ ( x ; q ) , ∂ ϕ ( x ; q ) ∂ x ) + k 2 ϕ ( x ; q )     − λ f ( x , ϕ ( x ; q ) , ∂ ϕ ( x ; q ) ∂ x ) , (3.5)

Using the above definition, we construct the zeroth-order deformation equation as in (2.2) and (2.3) and the mth-order deformation equation for m ≥ 1 is

L [ u m ( x ) − X m u m − 1 ( x ) ] = h R m ( u m − 1 ) , (3.6)

with the initial conditions

u m ( 0 ) = 0 ,     u ′ m ( 0 ) = 0 , (3.7)

where

R m ( u m − 1 ) = u ″ m − 1 + g ( u m − 1 , u ′ m − 1 ) + k 2 u m − 1 − λ f ( x , u m − 1 , u ′ m − 1 ) (3.8)

Now, the solution of the mth-order deformation Equation (3.6) for m ≥ 1 is

u m ( x ) = X m y m − 1 ( x ) + h ∫ 0 x ∫ 0 x R m ( u m − 1 ) d x d x , (3.9)

Thus, the approximate solution in a series form is given by

u ( x ) = u 0 ( x ) + ∑ m = 1 + ∞ u m ( x )     . (3.10)

3.1. Linear Case

Let g ( u , u ′ ) = u ′ , α = 0 and β = 1 .

Case 3.1.1 If we take λ = 10 , k = 10 and the function f ( x , u ) is continuous, but not differentiable, for example

f ( x , u ) = { x − 1 2 ,         x ≥ 1 2 − x + 1 2 ,     x < 1 2 (3.11)

From Equation (3.9) the first iterations are then determined in the following recursive way:

u 0 ( x ) = x ,

u 1 ( x ) = { 1 3 h x 2 ( 55 x − 6 ) ,                                                 x < 1 2 1 12 h ( 180 x 3 + 36 x 2 − 30 x + 5 ) ,           x ≥ 1 2 ,

u 2 ( x ) = { 275 3 h 2 x 5 − 145 12 h 2 x 4 + 1 3 h x 3 ( 55 + 53 h ) − 2 h x 2 ( 1 + h ) ,           x < 1 2 75 h 2 x 5 + 115 4 h 2 x 4 + h x 3 ( 15 − 77 3 h ) + h x 2 ( 3 + 271 12 h )     − 5 2 h x ( 1 + 35 12 h ) + 5 12 h ( 1 + 17 8 h ) ,                                                       x ≥ 1 2

and so on, in this manner the rest of the iterations can be obtained. Thus, the approximate solution in a series form when h = − 1 is

u ( x ) = u 0 ( x ) + ∑ m = 1 15 u m ( x ) = { p 1 ( x ) ,     x < 1 2 p 2 ( x ) ,     x ≥ 1 2 (3.12)

where

p 1 ( x ) = x + 2 x 2 − 19 x 3 − 143 12 x 4 + 5843 60 x 5 + 2819 120 x 6 − 592757 2520 x 7 − 252943 20160 x 8     + 19842881 60480 x 9 − 34234343 1814400 x 10 − 5918629957 19958400 x 11 + 3114021419 79833600 x 12     + 52956448313 283046400 x 13 − 1516727357143 43589145600 x 14 − 18911788595719 217945728000 x 15     + 41681620300291 2092278988800 x 16 + 10930256954423 355687428096 x 17 − 18736423525 2280047616 x 18     − 32512931860625 3801409387776 x 19 + 1790227609375 691165343232 x 20 + 25453049921875 13304932857216 x 21

− 35542462890625 54882848036016 x 22 − 2509960937500 7172190368343 x 23 + 25589599609375 194200846896672 x 24 + 33294677734375 631152752414184 x 25 − 4241943359375 186476949576918 x 26 − 193786621093750 27691827012172323 x 27 + 1964569091796875 581528367255618783 x 28 + 1907348632812500 1533120240946631337 x 29

and

p 2 ( x ) = − 28489448970108521138596665947 226349107039736370036316569600     + 2178307263376990695691557083 1951285405514968707209625600 x     + 1186572886359572970648017 366782970961460283310080 x 2 − 33376213227737153324107 1852439247280102440960 x 3     − 78674566012860119002187 3503708621552410951680 x 4 + 7041702063821037891364399 74453808207988732723200 x 5     + 549895593575959030863563 9306726025998591590400 x 6 − 33087191796820586109271 141624091699978567680 x 7

− 392978766117540050705 5149966970908311552 x 8 + 2456170645710279487 7376767051530240 x 9 + 41780926473659473181 811444375668326400 x 10 − 306846492148853223323 998290120065638400 x 11 − 17826687959696195557 1331053493420851200 x 12 + 50400473203539207979 254466109036339200 x 13 − 549653451307296101 80966489238835200 x 14 − 104497168922928132917 1113289227033984000 x 15 + 4425289676013881327 508932218072678400 x 16 + 17404262491512559 511943651315712 x 17

− 23600088137477575 4991450600328192 x 18 − 20901216917575625 2155399122868992 x 19 + 682160726359375 391890749612544 x 20 + 5546125344453125 2514632310013824 x 21 − 96575453125000 216101214141813 x 22 − 644336083984375 1420093692931914 x 23

+ 3135924072265625 22721499086910624 x 24 + 212506103515625 5680374771727656 x 25 − 17364501953125 18461218008114882 x 26 − 209045410156250 11867925862359567 x 27 + 1125335693359375 193842789085206261 x 28 + 1907348632812500 1873813627823660523 x 29

This series has the closed form as m → ∞

u E x a c t ( x ) = { p 3 ( x ) ,     x < 1 2 p 4 ( x ) ,     x ≥ 1 2 (3.13)

where

p 3 ( x ) = 307 399 57000 e − 1 2 x sin ( 399 2 x ) − 51 1000 e − 1 2 x cos ( 399 2 x ) + 51 1000 − 1 10 x ,

p 4 ( x ) = 307 399 57000 e − 1 2 x sin ( 399 2 x ) − 51 1000 e − 1 2 x cos ( 399 2 x ) − 51 1000 + 1 10 x     + 1 500 e − 1 2 x + 1 4 cos ( 399 4 ( 2 x − 1 ) ) − 199 399 199500 e − 1 2 x + 1 4 sin ( 399 4 ( 2 x − 1 ) ) ,

which is exactly the exact solution for the case 3.1.1.

In Table 1 show a comparison of the numerical results applying the HAM ( m = 15 ), Iteration of the Integral Equation (IIE) (3.9), and the numerical solution of (3.9) with Simpson rule (SIMP) with the exact solution (3.13). Twenty points have been used in the Simpson rule. In Table 2 we list the Maximum Absolute Error (MAE), ‖   ⋅   ‖ 2 , the Maximum Relative Error (MRE), the Maximum Residual Error (MRR), obtained by the HAM with the exact solution (3.13) on the interval [ 0 , 1 ] . The Estimated Order of Convergence (EOC) for different values of the constant k are given in Table 3.

Figure 1 represents both the exact solution u E x a c t ( x ) and our approximation by HAM ( m = 14 ) within the interval 0 ≤ t ≤ 1 .

For k ≥ 13 , the application of the HAM requires approximants of order m > 15 if we want to arrive beyond the discontinuity (at x = 1 2 ).

Case 3.1.2 Taking β = 1 , k = 1 , λ = 1 and

f ( x , u , u ′ ) = H ( x − 1 ) = { 0 ,     if   x < 1 1 ,       if   x ≥ 1 , (3.14)

The Heaviside step function at x = 1 . We now successively obtain

Numerical results for the case 3.1.1
xu E x a c t ( x )HAMIIESIMP
0.00.0000000000.0000000000.0000000000.000000000
0.10.1007823340.1007823340.1007823340.100782334
0.20.1387167990.1387167990.1387167990.138716799
0.30.0778447150.0778447150.0778447150.077844715
0.4−0.027921565−0.027921565−0.027921565−0.027921565
0.5−0.090520718−0.090520718−0.090520718−0.090520718
0.6−0.064945725−0.064945725−0.064945723−0.064945723
0.70.0238446670.0238445660.0238446780.023844678
0.80.1008984020.1008961530.1008987140.100898714
0.90.1086648460.1086385170.1086702370.108670234
1.00.0556917690.0556590610.0557366830.055736417
MAE, ‖   ⋅   ‖ 2 , MRE and MRR for the case 3.1.1
mMAE‖   ⋅   ‖ 2MREMRR
121.104E−011.474E−021.983E−0089.418E−00
131.541E−021.889E−032.767E−0116.061E−00
141.360E−031.408E−042.443E−022.222E−00
156.803E−051.732E−059.487E−041.940E−01
EOC for the case 3.1.1
kx = 0.4x = 0.6
101.06601.0778
111.06281.0824
121.04591.0923

u 0 ( x ) = x ,

u 1 ( x ) = { 1 6 h x 3 + 1 2 h x 2 ,                 x < 1 1 6 h x 3 + h x − 1 2 h ,             x ≥ 1 ,

u 2 ( x ) = { 1 120 h 2 x 5 + 1 12 h 2 x 4 + 1 3 h x 3 ( 1 2 + h ) + 1 2 h x 2 ( 1 + h ) ,                                         x < 1 1 120 h 2 x 5 + 1 24 h 2 x 4 + 1 3 h x 3 ( 1 2 + h ) + h x ( 2 3 h + 1 ) − 1 2 h ( 1 + 3 4 h ) ,   x ≥ 1 ,

and so on, in this manner the rest of the iterations can be obtained. Thus, the approximate solution in a series form when h = − 1 is

u ( x ) = u 0 ( x ) + ∑ m = 1 9 u m ( x ) = { p 5 ( x ) ,       x < 1 p 6 ( x ) ,       x ≥ 1 (3.15)

where

p 5 ( x ) = x − 1 2 x 2 + 1 24 x 4 − 1 120 x 5 + 1 5040 x 7 − 1 40320 x 8 + 1 1814400 x 10     + 1 5702400 x 11 + 1 17740800 x 12 + 1 124540416 x 13 + 1 1779148800 x 14     + 1 48432384000 x 15 + 1 2615348736000 x 16 + 1 355687428096000 x 17

and

p 6 ( x ) = 4581894569957 6974263296000 − 294371651437 653837184000 x + 23051120003 58118860800 x 2     − 355931929 6227020800 x 3 − 215859517 11496038400 x 4 + 251909 38016000 x 5     − 422017 870912000 x 6 − 80707 914457600 x 7 + 11293 541900800 x 8

− 463 304819200 x 9 + 401 2612736000 x 10 + 211 798336000 x 11 + 19 348364800 x 12 + 113 18681062400 x 13 + 71 174356582400 x 14 + 1 62270208000 x 15 + 1 2988969984000 x 16 + 1 355687428096000 x 17

This series has the closed form as m → ∞

u E x a c t ( x ) = { 2 3 3 e − 1 2 x sin ( 1 2 3 x ) ,                                                                                 x < 1 2 3 3 e − 1 2 x sin ( 3 2 x ) − 3 3 e − 1 2 x + 1 2 sin ( 3 2 ( − 1 + x ) )     − e − 1 2 x + 1 2 cos ( 3 2 ( − 1 + x ) ) + 1 ,                                                         x ≥ 1 , (3.16)

which is exactly the exact solution for the case 3.1.2.

In Table 4 show a comparison of the numerical results applying the HAM ( m = 9 ), Iteration of the Integral Equation (IIE) (3.9), and the numerical solution of (3.9) with Simpson rule (SIMP) with the exact solution (3.16). In Table 5 we list the MAE, ‖   ⋅   ‖ 2 , the MRE, and the MRR, obtained by the HAM with the exact solution (3.16) on the interval [ 0 , 1 ] . The EOC for different values of the constant k are given in Table 6.

Figure 2 represents both the exact solution u E x a c t ( x ) and our approximation by HAM ( m = 9 ) within the interval 0 ≤ t ≤ 2 .

Case 3.1.3 Taking β = 1 , k = 1 , λ = 1 and

f ( x , u , u ′ ) = δ ( x − 1 ) , the Dirac delta function at x = 1 . We now successively obtain

u 0 ( x ) = x ,

Numerical results for the case 3.1.2
xu E x a c t ( x )HAMIIESIMP
0.00.0000000000.0000000000.0000000000.000000000
0.20.1800640020.1800640020.1800640020.180064002
0.40.3209816420.3209816420.3209816420.320981642
0.60.4247571390.4247571410.4247571390.424757139
0.80.4943734760.4943735270.4943734720.494373472
1.00.5335071950.5335077350.5335071440.533507144
1.20.5649390720.5649428620.5649386460.564938646
1.40.6063934800.6064134540.6063908440.606390844
1.60.6545557580.6546411610.6545428090.654542808
1.80.7064697190.7067807540.7064163570.706416354
2.00.7595794760.7605770570.75938819360.759388182
MAE, ‖   ⋅   ‖ 2 , MRE and MRR for the case 3.1.2
mMAE‖   ⋅   ‖ 2MREMRR
52.214E−018.262E−022.914E−013.091E−00
67.122E−022.471E−029.377E−021.313E−00
71.955E−026.370E−032.573E−024.573E−01
84.684E−031.446E−036.167E−031.351E−01
99.976E−042.933E−041.313E−033.471E−02
EOC for the case 3.1.2
kx = 0.9x = 1.1
11.08711.1001
21.10811.1300

u 1 ( x ) = − 1 6 h ( − x 3 − 3 x 2 + 6 H ( x − 1 ) x − 6 H ( x − 1 ) )

u 2 ( x ) = − 1 120 h ( − h x 5 − 10 h x 4 − 20 x 3 ( 2 h + 1 ) + 20 h H ( x − 1 ) x 3                       − 60 x 2 ( h + 1 ) + 60 H ( x − 1 ) x ( h + 2 ) − 40 H ( x − 1 ) ( 2 h + 3 ) )

and so on, in this manner the rest of the iterations can be obtained. Thus, the approximate solution in a series form when h = − 1 is

u ( x ) = u 0 ( x ) + ∑ m = 1 8 u m ( x ) = H ( x − 1 ) ( − 9030495007 6227020800 + 858929737 479001600 x − 2734477 15966720 x 2     − 5271359 21772800 x 3 + 653741 8709120 x 4 − 14383 4838400 x 5 − 7477 3628800 x 6     + 293 725760 x 7 − 71 4838400 x 8 − 71 8709120 x 9 + 23 21772800 x 10     + 17 79833600 x 11 + 1 95800320 x 12 + 1 6227020800 x 13 )

+ ( x − 1 2 x 2 + 1 24 x 4 − 1 120 x 5 + 1 5040 x 7 − 1 40320 x 8 − 1 362880 x 9 − 1 604800 x 10 − 1 1900800 x 11 − 29 479001600 x 12 − 1 311351040 x 13 − 1 12454041600 x 14 − 1 1307674368000 x 15 ) (3.17)

This series has the closed form as m → ∞

u E x a c t ( x ) = 2 3 3 [ H ( x − 1 ) e 1 2 − 1 2 x sin ( 3 2 ( x − 1 ) ) + e − 1 2 x sin ( 3 2 x ) ] (3.18)

which is exactly the exact solution for the case 3.1.3.

In Table 7 we list the MAE, ‖   ⋅   ‖ 2 , the MRE, and the MRR, obtained by the HAM with the exact solution (3.18) on the interval [ 0 , 2 ] . The EOC are 1.0984 at x = 0.9 and 1.1156 at x = 1.1 .

Figure 3 gives both the exact solution u E x a c t ( x ) and our approximation by HAM ( m = 8 ) within the interval 0 ≤ t ≤ 2 .

3.2. Non-Linear Case

Let α = 0 , β = 1 , λ = 10 and k = 1 .

Case 3.2.1 Taking g ( u , u ′ ) = u u ′ , and

f ( x , u , u ′ ) = { 0 ,       if   x < 1 2 1 ,         if   x ≥ 1 2 (3.19)

Using the Adomian polynomials   for calculation the nonlinear term u u ′ is given by

g ( u , u ′ ) = u u ′ = ∑ i = 0 n u i u ′ n − i ,     n ≥ i ,     n = 0 , 1 , 2 , ⋯ (3.20)

We now successively obtain

u 0 ( x ) = x ,

MAE, ‖   ⋅   ‖ 2 , MRE and MRR for the case 3.1.3
mMAE‖   ⋅   ‖ 2MREMRR
52.105E−017.952E−022.210E−012.786E−00
66.923E−022.418E−027.266E−021.231E−00
71.924E−026.295E−032.019E−024.402E−01
84.644E−031.436E−034.874E−031.322E−01
99.928E−042.922E−041.042E−033.428E−02

u 1 ( x ) = { 1 3 h x 3 ,                                                                     x < 1 2 1 12 h ( 4 x 3 − 60 x 2 + 60 x − 15 ) ,       x ≥ 1 2 ,

u 2 ( x ) = { 1 12 h 2 x 5 + 1 3 h x 3 ( h + 1 ) ,                                                                                     x < 1 2 1 12 h 2 x 5 − 5 3 h 2 x 4 + 1 3 h x 3 ( 1 + 17 2 h ) − 5 h x 2 ( 1 + 5 4 h )     + 5 h x ( 1 + 25 24 h ) − 5 4 h ( 1 + h ) ,                                                               x ≥ 1 2 ,

and so on, in this manner the rest of the iterations can be obtained. Thus, the approximate solution in a series form when h = − 1 is

u ( x ) = u 0 ( x ) + ∑ m = 1 7 u m ( x ) = { p 7 ( x ) ,     x < 1 2 p 8 ( x ) ,     x ≥ 1 2 , (3.21)

where

p 7 ( x ) = x − 1 3 x 3 + 1 12 x 5 − 11 504 x 7 + 211 36288 x 9 − 6221 3991680 x 11 + 260833 622702080 x 13

and

p 8 ( x ) = 131015952083 98099527680 − 846993899 181665792 x + 1362271259 185794560 x 2 − 202153183 37158912 x 3     + 44111605 6193152 x 4 − 37786871 7741440 x 5 − 156205 165888 x 6 + 4167853 645120 x 7     − 18511 2016 x 8 + 431939 64512 x 9 − 3502817 1451520 x 10 + 267623 725760 x 11     − 520067 23950080 x 12 + 260833 622702080 x 13

In Table 8 show a comparison of the numerical results applying the HAM ( m = 7 ), Iteration of the Integral Equation (IIE) (3.9), and the numerical solution of (3.9) with Simpson rule (SIMP) with the numeric solution (rkf45) u N ( x ) . In Table 9 we list the MAE, the MRE, and the MRR, obtained by the HAM with the numeric solution (rkf45) u N ( x ) on the interval [ 0 , 1 ] .

Figure 4 represents both the numeric solution (rkf45) u N ( x ) with a very small error and our approximation by HAM ( m = 7 ) within the interval 0 ≤ t ≤ 1 .

Case 3.2.2 Taking g ( u , u ′ ) = u 2 , and

f ( x , u , u ′ ) = { 0 ,         if   x < 1 1 ,       if   x ≥ 1 (3.22)

Using the Adomian polynomials   for calculation the nonlinear term u 2 is given by

Numerical results for the case 3.2.1
xrkf45HAMIIESIMP
0.00.0000000000.0000000000.0000000000.000000000
0.10.0996674990.0996674970.0996674970.099667497
0.20.1973597270.1973597230.1973597230.197359723
0.30.2911978400.2911978380.2911978380.291197838
0.40.3794857000.3794857020.3794857020.379485702
0.50.4607776330.4607776350.4607776320.460777632
0.60.5830081280.5830080170.5830079780.583007978
0.70.7893668370.7893667010.7893665610.789366561
0.81.0680916741.0680915721.0680912821.068091282
0.91.4027359131.4027340831.4027353831.402735385
1.01.7732973131.7732381591.7732997711.773299790
MAE, MRE and MRR for the case 3.2.1
mMAEMREMRR
49.966E−035.620E−031.969E−00
59.854E−056.217E−051.329E−01
65.806E−043.274E−042.288E−01
75.915E−053.336E−054.510E−02

g ( u , u ′ ) = u 2 = ∑ i = 0 n u i u n − i ,     n ≥ i ,     n = 0 , 1 , 2 , ⋯ (3.23)

we now successively obtain

u 0 ( x ) = x ,

u 1 ( x ) = 1 12 h ( x 4 + 2 x 3 ) − 5 h H ( x − 1 ) ( x 2 − 2 x + 1 ) ,

u 2 ( x ) = − 1 2520 h H ( x − 1 ) ( 1260 h x 5 − 3150 h x 4 + 18900 h x 2 − 31500 h x     + 12600 x 2 + 14490 h − 25200 x + 12600 ) + 1 2520 h ( 10 h x 7 + 35 h x 6     + 21 h x 5 + 210 h x 4 + 420 h x 3 + 210 x 4 + 420 x 3 ) ,

and so on, in this manner the rest of the iterations can be obtained. Thus, the approximate solution in a series form when h = − 1 is

u ( x ) = u 0 ( x ) + ∑ m = 1 8 u m ( x ) = H ( x − 1 ) ( 41629462050061 11263435223040 − 2498253046769 563171761152 x − 18764031409 4704860160 x 2     + 1761739129 274450176 x 3 − 502232959 181621440 x 4 + 1677121153 242161920 x 5 − 10243801115 581188608 x 6     + 341190523 13453440 x 7 − 150931763 6209280 x 8 + 11334138401 670602240 x 9 − 2673838147 304819200 x 10     + 2650717003 79833600 x 11 − 1572737 1905120 x 12 + 88586453 1089728640 x 13 + 213052381 8717829120 x 14

− 6247867 605404800 x 15 + 71250341 58118860800 x 16 + 48109 823350528 x 17 − 1322521 59281238016 x 18 + 74645 140792940288 x 19 + 157891 1126343522304 x 20 ) + ( x − 1 6 x 3 − 1 12 x 4 + 1 120 x 5 + 1 72 x 6 + 19 5040 x 7 − 1 960 x 8 − 299 362880 x 9 − 43 362880 x 10 + 3239 39916800 x 11 + 869 21772800 x 12

+ 8201 6227020800 x 13 − 53 10644480 x 14 − 2150341 1307674368000 x 15 + 1660739 10461394944000 x 16 + 20675 79041650688 x 17 + 11819 209227898880 x 18 − 12799 750895681536 x 19 − 743 56458321920 x 20 − 803 252975550464 x 21 − 73 252975550464 x 22 ) (3.24)

In Table 10 we list the MAE, the MRE, and the MRR, obtained by the HAM with the numeric solution (rkf45) u N ( x ) on the interval [ 0 , 2 ] .

Figure 5 represents both the numeric solution (rkf45) u N ( x ) with a very small error and our approximation by HAM ( m = 8 ) within the interval 0 ≤ t ≤ 2 .

MAE, MRE and MRR for the case 3.2.2
mMAEMREMRR
46.298E−021.606E−023.926E−00
51.036E−022.642E−031.123E−00
62.845E−037.921E−044.894E−01
72.916E−037.436E−041.788E−01
86.366E−041.623E−045.743E−02
4. Conclusions

In this work, the HAM has been successfully applied to solve IVPs of second order with discontinuities. The size of the jump (given by λ ) does not affect the convergence of the method, which behaves equally well on both sides of the discontinuity. In this IVPs, the application by the HAM with k, does not converge even for small values of the parameter like λ .

The proposed scheme of the HAM has been applied directly without any need for transformation formulae or restrictive assumptions. The solution process by the HAM is compatible with the method in the literature providing analytical approximation such as ADM. The approach of the HAM has been tested by employing the method to obtain approximate-exact solutions of the linear case. The results obtained in all cases demonstrate the reliability and the efficiency of this method.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

Cite this paper

Al-Hayani, W. and Fahad, R. (2019) Homotopy Analysis Method for Solving Initial Value Problems of Second Order with Discontinuities. Applied Mathematics, 10, 419-434. https://doi.org/10.4236/am.2019.106030

ReferencesLiao, S.J. (1992) The Proposed Homotopy Analysis Technique for the Solution of Nonlinear Problems. Doctoral Dissertation, Ph.D. Thesis, Shanghai Jiao Tong University, Shanghai.Liao, S.J. (1999) An Explicit, Totally Analytic Approximation of Blasius' Viscous Flow Problems. International Journal of Non-Linear Mechanics, 34, 759-778. https://doi.org/10.1016/s0020-7462(98)00056-0Liao, S.J. (2003) Beyond Perturbation: Introduction to the Homotopy Analysis Method. CRC Press, Boca Raton.Casasús, L. and Al-Hayani, W. (2002) The Decomposition Method for Ordinary Differential Equations with Discontinuities. Applied Mathematics and Computation, 131, 245-251. https://doi.org/10.1016/s0096-3003(01)00142-4Al-Hayani, W. and Casasús, L. (2006) On the Applicability of the Adomian Method to Initial Value Problems with Discontinuities. Applied Mathematics Letters, 19, 22-31. https://doi.org/10.1016/j.aml.2005.03.004He, J.-H. (2004) The Homotopy Perturbation Method for Nonlinear Oscillators with Discontinuities. Applied Mathematics and Computation, 151, 287-292. https://doi.org/10.1016/s0096-3003(03)00341-2He, J.-H. (2003) Homotopy Perturbation Method: A New Nonlinear Analytical Technique. Applied Mathematics and Computation, 135, 73-79. https://doi.org/10.1016/s0096-3003(01)00312-5Adomian, G. (1986) Nonlinear Stochastic Operator Equations. Academic Press, New York.Wazwaz, A.M. (2000) A New Algorithm for Calculating Adomian Polynomials for Nonlinear Operators. Applied Mathematics and Computation, 111, 53-69. https://doi.org/10.1016/s0096-3003(99)00063-6