#### Abstract

The reliable treatment of homotopy perturbation method (HPM) is applied to solve the Klein-Gordon partial differential equation of arbitrary (fractional) orders. This algorithm overcomes the difficulty that arises in calculating complicated integrals when solving nonlinear equations. Some numerical examples are presented to illustrate the efficiency of this technique.

#### 1. Introduction

The Klein-Gordon equation plays a significant role in mathematical physics and many scientific applications such as solid-state physics, nonlinear optics, and quantum field theory [1, 2]. The equation has attracted much attention in studying solitons [3–6] and condensed matter physics, in investigating the interaction of solitons in a collisionless plasma, the recurrence of initial states, and in examining the nonlinear wave equations [7].

The HPM, proposed by He in 1998, has been the subject of extensive studies and was applied to different linear and nonlinear problems [8–13]. This method has the advantage of dealing directly with the problem without transformations, linearization, discretization, or any unrealistic assumption, and usually a few iterations lead to an accurate approximation of the exact solution [13]. The HPM has been used to solve nonlinear partial differential equations of fractional order (see, e.g., [14–16]). Some other methods for series solution that are used to solve nonlinear partial differential equations of fractional order include the Adomian decomposition method [17–19], the variational iteration method [20–22], and the homotopy analysis method [23–25].

Recently, Odibat and Momani [26] suggested a reliable algorithm for the HPM for dealing with nonlinear terms to overcome the difficulty arising in calculating complicated integrals. In [27], this algorithm is utilized to study the behavior of the nonlinear sine-Gordon equation with fractional time derivative. Our aim here is to apply the reliable treatment of HPM to obtain the solution of the initial value problem of the nonlinear fractional-order Klein-Gordon equation of the form subjected to the initial condition where denotes the Caputo fractional derivative with respect to of order , is unknown function, and , and are known constants with .

#### 2. Basic Definitions

*Definition 2.1. *A real function , , is said to be in the space , , if there exists a real number , such that , where , and it is said to be in the space if .

*Definition 2.2. *The Riemann-Liouville fractional integral operator of order of a function is defined as [28]
The operator satisfy the following properties, for , , ,, and :(1),
(2),
(3).

*Definition 2.3. *The fractional derivative in Caputo sense of , is defined as
The operator satisfy the following properties, for , , and :(1),
(2),
(3).

#### 3. The Homotopy Perturbation Method (HPM)

Consider the following equation: with boundary conditions where is a general differential operator, is the unknown function, and and denote spatial and temporal independent variables, respectively. is a boundary operator, is a known analytic function, and is the boundary of the domain . The operator can be generally divided into linear and nonlinear parts, say and . Therefore, (3.1) can be written as In [9], He constructed a homotopy which satisfies or where is an embedding parameter,and is an initial guess of which satisfies the boundary conditions. Obviously, from (3.4) and (3.5), one has Changing from zero to unity is just that change of from to . Expanding in Taylor series with respect to , one has Setting results in the approximate solution of (3.1) The reliable treatment of the classical HPM suggested by Odibat and Momani [26] is presented for nonlinear function which is assumed to be an analytic function and has the following Taylor series expansion: According to [26], the following homotopy is constructed for (1.1): The basic assumption is that the solution of (3.10) can be written as a power series in , Substituting (3.11) into (3.10) and equating the terms with identical powers of , we obtain a series of linear equations in , which can be solved by symbolic computation software. Finally, we approximate the solution by the truncated series

#### 4. Numerical Implementation

In this section, some numerical examples are presented to validate the solution scheme. Symbolic computations are carried out using Mathematica.

*Example 4.1. *Consider the fractional-order cubically nonlinear Klein-Gordon problem
with the exact solution .

According to the homotopy (3.10), we obtain the following set of linear partial differential equations of fractional order:

*Case 1 ( and ). *Solving (4.2), we obtain
Figure 1 gives the comparison between the HPM 6th-order approximate solution of problem (4.1) in Case 1 with , and 1.85 and the solution of corresponding problem of integer order denoted by at .

*Case 2 ( and ). *Solving (4.2), we have
Figure 2 gives the comparison between the HPM 6th-order approximate solution of problem (4.1) in Case 2 with ,, , and 1.85 and the solution of corresponding problem of integer order denoted by at .

*Case 3 (both and ). *Solving (4.2), we have

Figure 3 gives the comparison between the HPM 6th-order approximate solution of problem (4.1) in Case 3 with and taking the values , and 1.85 and the solution of corresponding problem of integer order denoted by at .

*Example 4.2. *Consider the fractional-order cubically nonlinear Klein-Gordon problem
The corresponding integer-order problem has the exact solution [29].

According to the homotopy (3.10), we obtain the following set of linear partial differential equations of fractional order:

*Case 1 ( and ). *Solving (4.7), we have
and the solution is obtained as
Figure 4 gives the comparison between the HPM 4th-order approximate solution of problem (4.6) in Case 1 with , and 1.85 and the solution of corresponding problem of integer order denoted by at .

*Case 2 ( and ). *As the attempt to evaluate Caputo fractional derivative of the functions and yields hypergeometric function, we substitute and by some terms of its Taylor series. Substituting the initial conditions and solving (4.7) for , the components of the homotopy perturbation solution for (4.6) are derived as follows:
As the Caputo fractional derivative can not be evaluated for negative powers of the variable at hand, and noting that , we can only evaluate the first two components of the series as illustrated. Thus, we suggest to generalize not only the derivatives in the integer-order problem to its fractional form, but also to generalize the conditions as well. For example, a generalized expansion of in a fractional form can be written as
for which we have . Substituting the generalized form of the initial conditions and solving (4.7) for , the components of the homotopy perturbation solution for this case are derived as follows:
and the solution is obtained as
Figure 5 gives the comparison between the HPM 4th-order approximate solution of problem (4.6) in Case 2 with , and 1.85 and the solution of corresponding problem of integer order denoted by at .

*Case 3 (both and ). *Carrying out the same procedure as in Case 2, we get
and the solution is thus obtained as
Figure 6 gives the comparison between the HPM 4th-order approximate solution of problem (4.6) in Case 3 with , and 1.85 and the solution of corresponding problem of integer order denoted by at .

#### 5. Conclusion

The reliable treatment HPM is applied to obtain the solution of the Klien-Gordon partial differential equation of arbitrary (fractional) orders with spatial and temporal fractional derivatives. The main advantage of this algorithm is the capability to overcome the difficulty arising in calculating complicated integrals when dealing with nonlinear problems. The numerical examples carried out show good results, and their graphs illustrate the continuation of the solution of fractional-order Klien-Gordon equation to the solution of the corresponding second-order problem when the fractional-order parameters approach their integer limits.