Hindawi Publishing Corporation Boundary Value Problems Volume 2010, Article ID 317369, 14 pages doi:10.1155/2010/317369 Research Article Comparison between the Variational Iteration Method and the Homotopy Perturbation Method for the Sturm-Liouville Differential Equation A. Neamaty1 and R. Darzi2 1 2 Department of Mathematics, University of Mazandaran, Babolsar 47416-95447, Iran Department of Mathematics, Islamic Azad University Neka Branch, Neka 48411-86114, Iran Correspondence should be addressed to R. Darzi, r.darzi@umz.ac.ir Received 28 October 2009; Accepted 10 April 2010 Academic Editor: Claudianor Alves Copyright q 2010 A. Neamaty and R. Darzi. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. We applied the variational iteration method and the homotopy perturbation method to solve Sturm-Liouville eigenvalue and boundary value problems. The main advantage of these methods is the flexibility to give approximate and exact solutions to both linear and nonlinear problems without linearization or discretization. The results show that both methods are simple and effective. 1. Introduction The variational iteration method VIM 1–4 and homotopy perturbation method HPM 5– 8, proposed by He, are powerful analytical methods for various kinds of linear and nonlinear problems. For example, the variational iteration method has been applied to autonomous ordinary differential equation 9 and delay differential equation 10. Abdou and Soliman applied this method to Schrodinger-KDV, generalized KDV, and Shallow water equations 11, Burger’s equations, and coupled Burger’s equations 12. Furthermore, Momani and Abuasad 13 used VIM for Helmoltz partial equation. Also homotopy perturbation method was successfully applied to Voltra’s integrodifferential equation 14, boundary value problem 8, nonlinear wave equations 15, and so forth; see 16–20. In this paper, we exert these methods for linear Sturm-Liouville eigenvalue and boundary value problems BVPs. A linear Sturm-Liouville operator has the form yt : Kyt λrtyt gt, 1.1 2 Boundary Value Problems where K− d d pt qt, dt dt t ∈ I a, b, 1.2 and gt is known analytic function representing the nonhomogeneous term. Associated with the differential equation 1.1 are the following separated homogeneous boundary conditions: α1 ya β1 y a 0, α2 yb β2 y b 0, 1.3 where α1 , α2 , β1 , and β2 are arbitrary constants. For simplicity, we will assume that pt, p t, qt, and rt are continuous. The values of λ for which BVP has a nontrivial solution are called eigenvalues of L, and a nontrivial solution corresponding to an eigenvalue is called an eigenfunction. The paper is organized as follows: in Sections 2 and 3, an analysis of the variational iteration and homotopy perturbation methods will be given. In Section 4, we apply HPM to solve Sturm-Liouville problems. We present 3 examples to show the efficiency and simplicity of the proposed methods in Section 5. Finally, we give our conclusions in Section 6. 2. He’s Variational Iteration Method To illustrate the basic concept of He’s variational iteration method 1–4, we consider the following nonlinear differential equation: Lu Nu gt, 2.1 where L is a linear operator, N is a nonlinear operator, and gt is a nonhomogeneous term. He has modified the general Lagrange multiplier method into an iteration method which is called correction functional as follows 1–4, 9: un1 t un t t μ Lun r N u n r − gr dr, 2.2 0 where μ is a general Lagrange multiplier, which can be identified optimally via the variational theory 21. The subscript n denotes the nth approximation, and u n is considered as a restricted variation 1–4, that is, δu n 0. Employing the restricted variation in 2.2 makes it easy to compute the Lagrange multiplier; see 22, 23. It is shown that this method is very effective and easy and can solve a large class of nonlinear problems. For linear problems, its exact solution can be obtained only one iteration because μ can be exactly identified. Boundary Value Problems 3 3. Homotopy Perturbation Method In this section, we will present a review of the homotopy perturbation method. To clarify the basic idea of the HPM 5–8, we consider the following nonlinear differential equation: Au − gr 0, r ∈ Ω, 3.1 ∂u 0, B u, ∂n r ∈ Γ, 3.2 with boundary conditions where A is a general differential operator, B is a boundary operator, gr is a known analytic function, and Γ is the boundary of the domain Ω. The operator A can, generally speaking, be divided into parts L and N while N is nonlinear. Equation 3.1, therefore, can be rewritten as follows: Lu Nu − gr 0. 3.3 By the homotopy technique, we construct a homotopy as follows: ν r, p : Ω × 0, 1 −→ R, 3.4 which satisfies H ν, p 1 − p Lν − Lu0 p Aν − gr 0, p ∈ 0, 1, r ∈ Ω, 3.5 H ν, p Lν − Lu0 pLu0 p Nν − gr 0, p ∈ 0, 1, r ∈ Ω, 3.6 or where p ∈ 0, 1 is an embedding parameter, and u0 is an initial approximation of 3.1 which satisfies the boundary conditions. Obviously, from 3.5, we have Hν, 0 Lν − Lu0 0, Hν, 1 Aν − gr 0. 3.7 The changing process of p from zero to unity is just that of νr, p from u0 r to ur. In topology, this is called deformation and Lν − Lu0 , and Aν − gr are called homotopic. According to HPM, we can assume that the solution of 3.5 can be written as a power series in p: ν ν0 pν1 p2 ν2 · · · . 3.8 4 Boundary Value Problems Setting p 1 results in the approximate solution 3.2: u lim ν ν0 ν1 ν2 · · · . p→1 3.9 The coupling of the perturbation method and the homotopy method is called the homotopy perturbation method which has eliminated limitations of the traditional perturbation method. On the other hand, the proposed technique can take full advantage of the traditional perturbations techniques. 4. Applying HPM to Solve Sturm-Liouville Problem To solve 1.1, by means of homotopy perturbation method, we choose linear operator d d L yt − pt yt , dt dt 4.1 with the property Lc1 0, where c1 is constant of integration and suggests that we define a nonlinear operator as Ny qt − λrtyt. Also gt is known analytic function representing the nonhomogeneous term. Therefore, 1.1 can be rewritten as follows: L y N y − g 0. 4.2 By the homotopy perturbation technique proposed by He 5–8, we can construct a homotopy Y t, p : −l, l × 0, 1 −→ R, d d d H Y, p 1 − p pt Y t − pty0 t dt dt dt d d p pt Y t − qt − λrt Y t gt 0, dt dt 4.3 d d d d d d H Y, p pt Y t − pt y0 t p pt y0 t dt dt dt dt dt dt − p qt − λrt Y t − gt 0. 4.4 or One may now try to obtain a solution of 4.2 in the form Y t Y0 t pY1 t p2 Y2 t · · · , 4.5 Boundary Value Problems 5 where the Yi t for i 0, 1, 2, . . . are functions yet to be determined. Substituting 4.5 into 4.4 yields d d d d d d d d Y0 t p Y1 t p2 Y2 t · · · − pt pt y0 t p pt y0 t dt dt dt dt dt dt dt dt − p qt − λrt Y0 t pY1 t p2 Y2 t · · · pgt 0. 4.6 Collecting terms of the same powers of p yields d d d d pt Y0 t − pt y0 t 0, dt dt dt dt d d d d pt Y1 t pt y0 t − qt − λrt Y0 t gt 0, p1 : dt dt dt dt d d pt Y2 t − qt − λrt Y1 t 0, p2 : dt dt p0 : 4.7 .. . pn : d dt d pt Yn t − qt − λrt Yn−1 t 0. dt The initial approximation Y0 t or y0 t can be freely chosen. 5. The Applications To incorporate our discussion above, three special cases of the Sturm-Liouville equation 1.1 will be studied. Example 5.1. Consider the Sturm-Liouville equation −y t λyt t, 5.1 y0 t, λ A Bt, 5.2 with initial approximation where A and B are constants. To solve 5.1 using the VIM, we have correction functional yn1 t, λ yn t, λ t 0 μ −yn r, λ λyn r, λ − r dr, 5.3 6 Boundary Value Problems where μ μr, t; λ is Lagrange multiplier. Making the above correction functional stationary, we can obtain the following stationary conditions: μ r, t; λ − λμr, t; λ 0, 1 − μ r, t; λ|rt 0, 5.4 μr, t; λ|rt 0. The Lagrange multiplier can, therefore, be identified as 1 μr, t; λ √ λ e √ λr−t − e− 2 √ λr−t 1 λr − t . √ sinh λ 5.5 Substituting 5.5 for correction functional 5.3, we have the following iteration formula: yn1 t, λ yn t, λ t sinh 0 λr − t −yn r, λ λyn r, λ − r dr. 5.6 Using the iteration formula 5.6 and initial approximation 5.2, we get t 1 1 y1 t, λ A cosh sinh λt √ B λt − . λ λ λ 5.7 In the same way, we obtain yn t, λ A cosh t 1 1 sinh λt √ B λt − , λ λ λ n ≥ 2, 5.8 which means that t 1 1 yt, λ A cosh sinh λt √ B λt − λ λ λ 5.9 is the exact solution of 5.1. In order to solve 5.1 using the HPM according to 4.4, we can readily construct a homotopy which satisfies d2 d2 d2 H Y, p 1 − p Y t − 2 y0 t p Y t − λY t t 0, dt2 dt dt2 p ∈ 0, 1, 5.10 or d2 d2 H Y, p 2 Y t − y0 t p y0 t − λY t t 0. dt dt2 5.11 Boundary Value Problems 7 We consider Y t as Y t Y t, λ Y0 t, λ pY1 t, λ p2 Y2 t, λ · · · . 5.12 Substituting 5.12 into 5.11, collecting terms of the same power, and using initial approximation, we have the following set of linear equations: d2 Y0 t, λ 0, dt2 d2 d2 p1 : 2 Y1 t, λ − 2 y0 t, λ − λY0 t, λ t 0, dt dt d2 p2 : 2 Y2 t, λ − λY1 t, λ 0, dt .. . p0 : pn : 5.13 d2 Yn t, λ − λYn−1 t, λ 0. dt2 Solving the above equations, we have Y0 t, λ A Bt, ⎛ ⎛ √ 3 ⎞ √ 2 ⎞ λt λt 3 B ⎜ ⎟ ⎟ t ⎜ Y1 t, λ A⎝1 ⎠ √ ⎝ λt ⎠− , 2! 3! 6 λ ⎛ ⎜ Y2 t, λ A⎝1 √ 2 λt 2! ⎛ √ 4 ⎞ √ 3 √ 5 ⎞ λt λt λt 5 B ⎜ ⎟ ⎟ λt , ⎠ √ ⎝ λt ⎠− 4! 3! 5! 120 λ .. . ⎛ ⎜ Yn t, λ A⎝1 √ 2 λt 2! −1 n ⎛ √ 2n ⎞ √ 2n1 ⎞ √ 3 λt λt λt B ⎜ ⎟ ⎟ ··· ··· ⎠ √ ⎝ λt ⎠ 3! 2n! 2n 1! λ λn1 2n 1! . 5.14 Continuing in this manner, we can obtain Y t, λ A cosh t 1 1 sinh λt √ B λt − , λ λ λ which is exactly the same as that obtained by VIM. 5.15 8 Boundary Value Problems Example 5.2. As another example, we consider Sturm-Liouville problem −y t t − λyt 0, t ≥ 0, 5.16 with initial conditions y0 A, y 0 B, 5.17 where A and B are constants. To solve 5.16 by means of variational method, we construct a correction functional yn1 t, λ yn t, λ t 0 μ −yn r, λ r yn r, λ − λyn r, λ dr, 5.18 where μ μr, t; λ is the Lagrange multiplier and yn denotes restricted variation that is δyn 0. Then, we have δyn1 t, λ δyn t, λ δ t 0 μ −yn r, λ r yn r, λ − λyn r, λ dr. 5.19 Calculus of variations and integration by parts give the stationary conditions μ r, t; λ λμr, t; λ 0, 1 μ r, t; λ|rt 0, 5.20 μr, t; λ|rt 0, for which the Lagrange multiplier μ should satisfy. The Lagrange multiplier can, therefore, be identified as 1 λr − t . μr, t; λ − √ sin λ 5.21 Substituting 5.21 into correction functional 5.18 results in the following iteration formula: yn1 t, λ yn t, λ − t 0 1 λr − t −yn r, λ ryn r, λ − λyn r, λ dr. √ sin λ 5.22 Boundary Value Problems 9 According to initial conditions 5.17, it is natural to choose initial approximation y0 t, λ A Bt. Using the above variational formula 5.22, we can obtain the following result: ⎞ ⎛ √ 3 √ 5 λt λt A ⎜ ⎟ − ···⎠ λt 3/2 ⎝ y1 t, λ A cos 3! 5! λ ⎞ ⎛ √ 4 √ 6 λt λt 2B ⎜ B ⎟ − · · · ⎠, λt 2 ⎝ √ sin 4! 6! λ λ 5.23 .. .. In order to solve system 5.16-5.17 using HPM, after applying HPM and rearranging based on powers of p-terms, we have p0 : d2 d2 Y0 t, λ − 2 y0 t, λ 0, 2 dt dt p1 : d2 d2 λ − y0 t, λ −t λY0 t, λ 0, Y t, 1 2 2 dt dt d2 p2 : 2 Y2 t, λ −t λY1 t, λ 0, dt 5.24 .. .. Solving the above equations, we get ⎛ ⎛ √ 3 ⎞ ⎛ √ 3 ⎞⎞ √ 2 ⎞ λt λt λt A ⎜ B ⎜ ⎟ ⎟ ⎟⎟ ⎜ ⎜ Y1 t, λ A⎝1 − ⎠ 3/2 ⎝ ⎠ √ ⎝ λt − ⎝ ⎠⎠ 2! 3! 3! λ λ ⎛ ⎛ √ 4 ⎞ λt 2B ⎜ ⎟ 2⎝ ⎠, 4! λ ⎛ ⎜ Y2 t, λ A⎝1 − √ 2 λt ⎛ 2! B ⎜ √ ⎝ λt − λ ⎛ √ 3 √ 5 ⎞ √ 4 ⎞ λt λt λt A ⎟ ⎟ ⎜ − ⎠ 3/2 ⎝ ⎠ 4! 3! 5! λ √ 3 λt 3! ⎛ √ 4 √ 6 ⎞ √ 5 ⎞ λt λt λt ⎟ 2B ⎜ ⎟ − ⎠ 2⎝ ⎠, 5! 4! 6! λ .. .. 5.25 10 Boundary Value Problems Example 5.3. Finally, we consider eigenvalue Sturm-Liouville problem −y t − λyt 0, t ∈ −l, l, l > 0, 5.26 yl 0. 5.27 along with the Dirichlet boundary conditions y−l 0, To solve 5.26 by means of variational method, we construct a correction functional for 5.26 that reads as yn1 t, λ yn t, λ t 0 μ −yn r, λ − λyn r, λ dr, 5.28 where μ μr, t; λ is Lagrange multiplier. Following the discussion presented in the previous example, we obtain the following iteration formula: yn1 t, λ yn t, λ − t 0 1 λr − t −yn r, λ − λyn r, λ dr. √ sin λ 5.29 Let us begin with an initial approximation y0 t, λ A Bt, where A and B are constants to be determined. Substituting the proposed initial iterate y0 t, λ in 5.29 gives y1 t, λ A cos B λt √ sin λt . λ 5.30 In the same way, we obtain yn t, λ A cos B λt √ sin λt , λ n ≥ 2. 5.31 So, we can derive that yt, λ A cos is the exact solution of 5.26. B λt √ sin λt λ 5.32 Boundary Value Problems 11 In order to solve 5.26 using HPM, similar to previous examples, after applying HPM and rearranging based on powers of p-terms, we have p0 : d2 d2 λ − y0 t, λ 0, Y t, 0 dt2 dt2 p1 : d2 d2 Y1 t, λ − 2 y0 t, λ λY0 t, λ 0, 2 dt dt p2 : d2 Y2 t, λ λY1 t, λ 0, dt2 5.33 .. . pn : d Yn t, λ λYn−1 t, λ 0. dt Now, we choose y0 t, λ A Bt. Solving the above sets of equations yields Y0 t, λ A Bt, ⎛ ⎛ √ 3 ⎞ √ 2 ⎞ λt λt B ⎜ ⎟ ⎟ ⎜ Y1 t, λ A⎝1 − ⎠ √ ⎝ λt − ⎠, 2! 3! λ ⎛ ⎜ Y2 t, λ A⎝1 − √ 2 λt 2! ⎛ √ 4 ⎞ √ 3 √ 5 ⎞ λt λt λt B ⎜ ⎟ ⎟ ⎠ √ ⎝ λt − ⎠, 4! 3! 5! λ 5.34 .. . ⎛ ⎜ Yn t, λ A⎝1 − √ 2 λt ⎛ 2! B ⎜ √ ⎝ λt − λ √ 4 λt 4! √ 3 λt 3! √ 2n ⎞ λt ⎟ · · · −1n ⎠ 2n! √ 5 λt 5! √ 2n1 ⎞ λt ⎟ · · · −1n ⎠. 2n 1! Hence, from 4.4 we get Y t, λ A cos B λt √ sin λt , λ 5.35 12 Boundary Value Problems which is exactly the same as that obtained by VIM. Now, we use the boundary condition 5.27 to obtain eigenvalue and eigenfunctions of 5.26. Imposing the boundary conditions in 5.35 yields B λl − √ sin λl 0, λ B Y l, λ A cos λl √ sin λl 0. λ Y −l, λ A cos 5.36 So, there are two infinite sequences of eigenvalues λm : 2m − 1π λm 2l mπ 2 , λm l 2 m 1, 2, . . . , , 5.37 m 1, 2, . . . . Thus, corresponding linearly nontrivial solutions are 2m − 1π t , m 1, 2, . . . , 2l mπ l vm t B sin t , m 1, 2, . . . . mπ l um t A cos 5.38 Since um t and vm t are of class CI, R, that is, are continuous real-valued functions of t ∈ −l, l, using the definition of inner product on CI, R, that is, um , vm l −l um xvm xdx, um , vm ∈ CI, R, 5.39 and the norm induced by inner product um 2 2 um , um l −l um xvm xdx, 5.40 we get the normalization constants as 1 A √ , l mπ B √ . l3 5.41 Boundary Value Problems 13 Consequently, we obtain 1 2m − 1π t , m 1, 2, . . . , u m t √ cos 2l l mπ 1 vm t √ sin t , m 1, 2, . . . , l l 5.42 where u m t and vm t are normalized eigenfunctions, that is, u m t um t/ um 2 and vm t vm t/ vm 2 . 6. Conclusion In this work, we proposed variational method and compared with homotopy perturbation method to solve ordinary Sturm-Liouville differential equation. The variational iteration algorithm used in this paper is the variational iteration algorithm-I; there are also variational iteration algorithm-II and variational iteration algorithm-III 24, which can also be used for the present paper. It may be concluded that the two methods are powerful and efficient techniques to find exact as well as approximate solutions for wide classes of ordinary differential equations. References 1 J.-H. He, “A new approach to nonlinear partial differential equations,” Communications in Nonlinear Science and Numerical Simulation, vol. 2, no. 4, pp. 230–235, 1997. 2 J.-H. He, “Approximate analytical solution for seepage flow with fractional derivatives in porous media,” Computer Methods in Applied Mechanics and Engineering, vol. 167, no. 1-2, pp. 57–68, 1998. 3 J.-H. He, “Approximate solution of nonlinear differential equations with convolution product nonlinearities,” Computer Methods in Applied Mechanics and Engineering, vol. 167, no. 1-2, pp. 69–73, 1998. 4 J.-H. He, “Variational iteration method—a kind of non-linear analytical technique: some examples,” International Journal of Non-Linear Mechanics, vol. 34, no. 4, pp. 699–708, 1999. 5 J.-H. He, “Homotopy perturbation technique,” Computer Methods in Applied Mechanics and Engineering, vol. 178, no. 3-4, pp. 257–262, 1999. 6 J.-H. He, “Homotopy perturbation method: a new nonlinear analytical technique,” Applied Mathematics and Computation, vol. 135, no. 1, pp. 73–79, 2003. 7 J.-H. He, “A coupling method of a homotopy technique and a perturbation technique for non-linear problems,” International Journal of Non-Linear Mechanics, vol. 35, no. 1, pp. 37–43, 2000. 8 J.-H. He, “Homotopy perturbation method for solving boundary value problems,” Physics Letters A, vol. 350, no. 1-2, pp. 87–88, 2006. 9 J.-H. He, “Variational iteration method for autonomous ordinary differential systems,” Applied Mathematics and Computation, vol. 114, no. 2-3, pp. 115–123, 2000. 10 J.-H. He, “Variational iteration method for delay differential equations,” Communications in Nonlinear Science and Numerical Simulation, vol. 2, no. 4, pp. 235–236, 1997. 11 M. A. Abdou and A. A. Soliman, “New applications of variational iteration method,” Physica D, vol. 211, no. 1-2, pp. 1–8, 2005. 12 M. A. Abdou and A. A. Soliman, “Variational iteration method for solving Burger’s and coupled Burger’s equations,” Journal of Computational and Applied Mathematics, vol. 181, no. 2, pp. 245–251, 2005. 13 S. Momani and S. Abuasad, “Application of He’s variational iteration method to Helmholtz equation,” Chaos, Solitons & Fractals, vol. 27, no. 5, pp. 1119–1123, 2006. 14 Boundary Value Problems 14 M. El-Shahed, “Application of He’s homotopy perturbation method to Volterra’s integro-differential equation,” International Journal of Nonlinear Sciences and Numerical Simulation, vol. 6, no. 2, pp. 163–168, 2005. 15 J.-H. He, “Application of He’s homotopy perturbation method to nonlinear wave equations,” Chaos Solitons & Fractals, vol. 167, no. 1-2, pp. 69–73, 1998. 16 S. Abbasbandy, “Homotopy perturbation method for quadratic Riccati differential equation and comparison with Adomian’s decomposition method,” Applied Mathematics and Computation, vol. 172, no. 1, pp. 485–490, 2006. 17 D. D. Ganji and A. Sadighi, “Application of He’s homotopy-perturbation method to nonlinear coupled systems of reaction-diffusion equations,” International Journal of Nonlinear Sciences and Numerical Simulation, vol. 7, no. 4, pp. 411–418, 2006. 18 J.-H. He, “Homotopy perturbation method for bifurcation of nonlinear problems,” International Journal of Nonlinear Sciences and Numerical Simulation, vol. 6, no. 2, pp. 207–208, 2005. 19 J.-H. He, “The homotopy perturbation method nonlinear oscillators with discontinuities,” Applied Mathematics and Computation, vol. 151, no. 1, pp. 287–292, 2004. 20 M. Rafei and D. D. Ganji, “Explicit solutions of Helmholtz equation and fifth-order KdV equation using homotopy perturbation method,” International Journal of Nonlinear Sciences and Numerical Simulation, vol. 7, no. 3, pp. 321–328, 2006. 21 J.-H. He, “Variational principles for some nonlinear partial differential equations with variable coefficients,” Chaos, Solitons & Fractals, vol. 19, no. 4, pp. 847–851, 2004. 22 J.-H. He, “Semi-inverse method of establishing generalized variational principles for fluid mechanics with emphasis on turbomachinery aerodynamics,” International Journal of Turbo and Jet Engines, vol. 14, no. 1, pp. 23–28, 1997. 23 J.-H. He, Y.-Q. Wan, and Q. Guo, “An iteration formulation for normalized diode characteristics,” International Journal of Circuit Theory and Applications, vol. 32, no. 6, pp. 629–632, 2004. 24 J.-H. He, G.-C. Wu, and F. Austin, “The variational iteration method which should be followed,” Nonlinear Science Letters A, vol. 1, no. 1, pp. 1–30, 2010.