1 Introduction

In this paper, we consider the fractional nonlinear Klein-Gordon equation

where u is a function of x and t, a and b are real, g is a nonlinear function, and f is a known analytic function. The Klein-Gordon equation plays an important role in mathematical physics.

The homotopy perturbation method (HPM) has been successively applied for finding approximate analytical solutions of the fractional nonlinear Klein-Gordon equation which can be used as a numerical algorithm [1]. Analytical approach that can be applied to solve nonlinear differential equations is to employ the homotopy analysis method (HAM) [25]. Chowdhury and Hashim have employed HPM for solving Klein-Gordon equations [6]. The main aim of this work is to apply the HPM to solve the nonlinear Klein-Gordon equations of fractional order. An account of the recent developments of HAM was given by Liao [7]. HAM has been successfully applied in engineering fields. The method has been applied to give an explicit solution for the Riemann problem of the nonlinear shallow-water equations [8]. The homotopy analysis method is applied to solve linear and nonlinear fractional partial differential equations (fPDEs) [9]. The obtained Riemann solver has been implemented into a numerical model to simulate long waves, such as storm surge or tsunami, propagation and run-up. Differential equations and nonlinear mechanics very recently, Song and Zhang [10] solved the fractional KdV-Burgers-Kuramoto equation using HAM. Cang et al. [11] solved nonlinear Riccati differential equations of fractional order using HAM. Hashim et al. [12] employed HAM to solve fractional initial value problems (fIVPs) for ordinary differential equations. In [13] the applicability of HAM was extended to construct a numerical solution for the fractional BBM-Burgers equation. The homotopy analysis method is implemented to give approximate and analytical solutions for the Klein-Gordon equation [14]. The HAM solutions for systems of nonlinear fractional differential equations were presented by Bataineh et al. [15]. A specific linear, nonhomogeneous time fractional partial differential equation (fPDE) with variable coefficients was first transformed into two fractional ordinary differential equations, which were then solved by HAM in [16]. Recently, Xu et al. [17] applied HAM to linear, homogeneous one- and two-dimensional fractional heat-like PDEs subject to the Neumann boundary conditions. They implemented relatively new, exact series method of solution known as the differential transform method for solving linear and nonlinear Klein-Gordon equations [18]. Jafari and Seifi [19] applied HAM to linear and nonlinear homogeneous fractional diffusion-wave equations. Very recently, HAM was shown to be capable of solving linear and nonlinear systems of fPDEs [20].

2 Definitions

2.1 The Mittag-Leffler function

The Mittag-Leffler function is an important function that finds widespread use in the world of fractional calculus. Just as the exponential naturally arises out of the solution to integer order differential equations, the Mittag-Leffler function plays an analogous role in the solution of non-integer order differential equations. In fact, the exponential function itself is a very special form, one of an infinite set, of this seemingly ubiquitous function. Here, m th derivatives of Mittag-Leffler functions [21] are given

E α ( m ) (z)= k = 0 ( k + m ) ! z k k ! Γ ( α k + α m + 1 ) ,z,αC,mN,R(α)>0.

A two-parameter function of the M-L (Mittag-Leffler) type is defined by the series expansion [22],

E α ( m ) (z)= k = 0 ( k + m ) ! z k k ! Γ ( α k + α m + β ) ,α,βC,R(α)>0,R(β)>0,zC,mN.

2.2 Laplace’s transform of fractional order

The Laplace transform of a function f(t), denoted by F(s), is defined by the equation

If nN, then by the theory of the Laplace transform, we know that

L { d d x n ; f ; s } = s n F(s) k = 0 n 1 s n k 1 f ( k ) (0+)

or

L { D α ; f ; s } = s α F(s) k = 0 n 1 s α k 1 f ( k ) (0+)(n1α<n).

In this section several integrals associated with Mittag-Leffler functions are presented, which can be easily established by the application of beta and gamma function formulas and other techniques [23],

0 e t t k e z t dt= ( k + 1 ) ! ( 1 z ) k and 0 e p t t k e a t dt= k ! ( p a ) k + 1 ( Re ( p ) > a ) .

We obtain, from the equation, a pair of Laplace transforms of the function

2.3 Fractional calculus

We have well-known definitions of a fractional derivative of order α>0 such as Riemann-Liouville, Grunwald-Letnikow, Caputo, and generalized functions approach [23, 24]. The most commonly used definitions are those of Riemann-Liouville and Caputo. We give some basic definitions and properties of the fractional calculus theory, which are used throughout the paper.

Definition 2.1 A real function f(x), x>0, is said to be in the space C μ , μR, if there exists a real number (p>μ) such that f(x)= x p f 1 (x), where f 1 (x)C[0,), and it is said to be in the space C μ m iff f m C μ , mN.

Definition 2.2 The Riemann-Liouville fractional integral operator of order α0 of a function f C μ , μ1, is defined as

It has the following properties. For f C μ , μ1, α,β0, and γ>1,

  1. 1.

    J α J β f(x)= J α + β f(x),

  2. 2.

    J α J β f(x)= J β J α f(x),

  3. 3.

    J α x γ = Γ ( γ + 1 ) Γ ( α + γ + 1 ) x α + γ .

The Riemann-Liouville fractional derivative is mostly used by mathematicians, but this approach is not suitable for physical problems of the real world since it requires the definition of fractional order initial conditions which have no physically meaningful explanation yet. Caputo introduced an alternative definition which has the advantage of defining integer order initial conditions for fractional order differential equations.

Definition 2.3 The fractional derivative of f(x) in the Caputo sense is defined as

D v f(x)= J a m v D m f(x)= 1 Γ ( m v ) 0 x ( x t ) m v 1 f ( m ) (t)dt

for m1<v<m, mN, x>0, f C 1 m .

Lemma 2.4 If m1<α<m, mN, and f C μ m , μ1, then

The Caputo fractional derivative is used here because it allows traditional initial and boundary conditions to be included in the formulation of the problem.

Definition 2.5 For m to be the smallest integer that exceeds α, the Caputo time-fractional derivative operator of order α>0 is defined as

D t α u(x,t)= α u ( x , t ) t α ={ 1 Γ ( m α ) 0 t ( t ξ ) m α 1 m u ( x , ξ ) ξ m d ξ , for  m 1 < α < m , m u ( x , t ) t m , for  α = m N .

3 Homotopy analysis method

We apply the homotopy analysis method to the discussed problem. Let us consider the fractional differential equation,

FD ( u ( x , t ) ) =0.

Based on the constructed zero-order deformation equation by Liao (2003), we give the following zero-order deformation equation in the similar way:

(1q)L ( U ( x , t ; q ) u 0 ( x , t ) ) =qħFD ( U ( x , t ; q ) ) ,q[0,1],ħ0,

L is an auxiliary linear integer order operator and it possesses the property L(C)=0, U is an unknown function.

Expanding U in Taylor series with respect to q, one has

U(x,t;q)= u 0 (x,t)+ m = 1 u m (x,t) q m ,

where

u m (x,t)= U ( x , t ; q ) q m | q = 0 .

Differentiating the equation m times with respect to the embedding parameter q, then setting q=0, and finally dividing them by m!, we have the m th-order deformation equation

L [ u m ( x , t ) χ m u m 1 ( x , t ) ] =ħ R m [ u m 1 ( x , t ) ] ,

where

R m [ u m 1 ( x , t ) ] = 1 ( m 1 ) ! m 1 F D ( U ( x , t ; q ) ) q m 1 | q = 0

and

χ m ={ 0 , m 1 , 1 , m > 1 .

These equations can be easily solved using software such as Maple, Mathlab and so on.

4 Application

We rewrite the equation in an operator form,

which gives, according to Caputo, that

We define, according to the equation, the linear and nonlinear operator,

According to the equation (Klein-Gordon equation), using the homotopy analysis method,

J t α D t α [ u m ( x , t ) x m 1 u m 1 ( x , t ) ] =ħ J t α { R m [ u m 1 ( x , t ) ] } ,

where

R m [ u m 1 ( x , t ) ] = D t α u m 1 [ 2 u x 2 j = 0 m 1 u j u m 1 j ] ,

we find

u 1 =ħ J t α [ 2 u 0 x 2 u 0 2 ] .

Now, the solution of the m th-order deformation equation for m1 becomes

u m =(ħ+1) u m 1 (x,t)ħ J t α [ 2 u x 2 j = 0 m 1 u j u m 1 j ] .

Consider the fractional nonlinear partial differential equation:

We now successively obtain

so

u(x,0) u 0 (x,0)+ u 1 (x,0)+ u 2 (x,0).

For the special case h=1, we obtain from

We have given the solution simulations in Figure 1 and Figure 2 according to different α values.

Figure 1
figure 1

The figures show the 3rd-order approximation solution u(x,t) to Eq. when (left) α=2 , (right) α=1.75 .

Figure 2
figure 2

The figures show the 3rd-order approximation solution u(x,t) to Eq. when (left) α=1.5 , (right) α=1 .

5 Conclusion

In this study, the homotopy analysis method with new strategies has been employed to obtain an approximate analytical solution of fractional nonlinear Klein-Gordon equations. It is quite important to notice that a higher number of iteration and higher order of p are needed to gain more accuracy.

This work illustrates the validity and great potential of the homotopy analysis method for nonlinear fractional partial differential equations. The basic ideas of this approach are expected to be further employed to solve other nonlinear problems in fractional calculus.