+
where . N , < 1 m m m
Similar to integer-order differentiation, Caputo fractional derivative operator is a linear operation
), ( ) ( = )) ( ) ( ( x g D x f D x g x f D
+ + where and are constants.
For the Caputo's derivative we have (Podlubny (1999))
, constant a is 0, = C C D
(1)
(
+
+
(
. and for ,
) 1 (
1) (
; < and for 0,
=
0
0
n n x
n
n
n n
x D
n
n
(2)
We use the ceiling function ( to denote the smallest integer greater than or equal to and
} {0,1,2,... =
0
. Recall that for , the Caputo differential operator coincides with the usual differential operator
of integer order.
For more details on fractional derivatives definitions and its properties see (Das (2008), Podlubny (1999)).
Our main goal in this paper is concerned with the application of Legendre pseudospectral method to obtain the
numerical solution of the linear fractional Klien-Gordon equation (LFKGE) of the form
1, < < 0 ), , ( ) , ( ) ( ) , ( x t x f t x u D x d t x u
tt
=
(3)
the parameter refers to the Caputo fractional order of spatial derivatives with 2. < 1 The function ) , ( t x f is the
source term. We also assume the following initial conditions
(0,1), ), ( = ,0) ( ), ( = ,0) (
2 1
x x g x u x g x u
t
(4)
and the Dirichlet boundary conditions
), ( = (1,0) ), ( = ) (0,
2 1
t h u t h t u (5)
where
2 1 2 1
and , , h h g g are known functions and ) , ( t x u is the unknown function.
Note that at 2, = Eq.(3) is the classical linear Klien-Gordon equation
On the Numerical Solution for the Linear Fractional Klien-Gordon Equation Using Legendre Pseudospectral Method 3
). , ( ) , ( ) ( ) , ( t x f t x u x d t x u
xx tt
=
Our idea is to apply the Legendre collocation method to discretize (3) to get a linear system of ODEs thus greatly
simplifying the problem, and use finite difference method (Meerschaert & Tadjeran (2006), Smith (1965)) to solve the
resulting system.
Legendre polynomials are well known family of orthogonal polynomials on the interval 1,1] [ that have many
applications (Bell (1968), Khader et al. (2011), Khader & Hendy (2012a)). They are widely used because of their good
properties in the approximation of functions. However, with our best knowledge, very little work was done to adapt these
polynomials to the solution of FDEs.
The organization of this paper is as follows. In the next section, the approximation of fractional derivative
) (x y D
is obtained. Section 3 summarizes the application of Legendre collocation method to the solution of (3). As a
result a system of ordinary differential equations is formed and the solution of the considered problem is introduced. In
section 4, some numerical results are given to clarify the proposed method. Also a conclusion is given in section 5.
AN APPROXIMATE FORMULA OF THE FRACTIONAL DERIVATIVE
The well known Legendre polynomials are defined on the interval 1,1] [ and can be determined with the aid
of the following recurrence formula (Bell (1968))
1,2,..., = ), (
1
) (
1
1 2
= ) (
1 1
k z L
k
k
z L z
k
k
z L
k k k +
+
+
+
where 1 = ) (
0
z L and z z L = ) (
1
. In order to use these polynomials on the interval [0,1] we define the so
called shifted Legendre polynomials by introducing the change of variable 1 2 = x z .
Let the shifted Legendre polynomials 1) (2 x L
k
be denoted by ) (x P
k
. Then ) (x P
k
can be obtained as follows
1,2,..., = ), (
1
) (
1) (
1) 1)(2 (2
= ) (
1 1
k x P
k
k
x P
k
x k
x P
k k k +
+
+
+
(6)
where 1 = ) (
0
x P and 1 2 = ) (
1
x x P . The analytic form of the shifted Legendre polynomials ) (x P
k
of degree k is
given by
.
) ! )( (
)! (
1) ( = ) (
2
0 =
i i k
k
i
k
x
i i k
i k
x P
(7)
Note that
k
k
P 1) ( = (0) and 1 = (1)
k
P . The orthogonality condition is
j i
j i
i
dx x P x P
j i
for , 0
; = for ,
1 2
1
= ) ( ) (
1
0
(8)
The function ) (x y , which is square integrable in [0,1] , may be expressed in terms of shifted Legendre polynomials as
), ( = ) (
0 =
x P y x y
i i
i
where the coefficients
i
y are given by . 1,2,... = , ) ( ) ( 1) (2 =
1
0
i dx x P x y i y
i i
+
In practice, only the first 1) ( + m -terms of shifted Legendre polynomials are considered. Then we have
4 N. H. Sweilam, M. M. Khader & A. M. S. Mahdy
). ( = ) (
0 =
x P y x y
i i
m
i
m
(9)
The main approximate formula of the fractional derivative is given in the following theorem.
THEOREM
Let ) (x y be approximated by shifted Legendre polynomials as (9) and also suppose 0 > then
, = )) ( (
) (
,
= =
( (
k
k i i
i
k
m
i
m
x w y x y D (10)
where
) (
,
k i
w is given by
.
) 1 ( )! ( )! (
)! ( 1) (
=
) (
) (
,
+
+
+
k k k i
k i
w
k i
k i
(11)
PROOF
Since the Caputo's fractional differentiation is a linear operation we have
)). ( ( = )) ( (
0 =
x P D y x y D
i i
m
i
m
(12)
Employing Eqs.(1)-(2) in Eq.(7) we have
0. > 1, 0,1,..., = 0, = ) (
( i x P D
i
(13)
Therefore, for m i ..., , 1 , = + ( ( and by using Eqs.(1)-(2) and (7) we get
,
) 1 ( ) ! ( )! (
)! ( 1) (
= ) (
) ! ( )! (
)! ( 1) (
= ) (
=
2
0 =
+
(
+
+
+
+
k
k i i
k
k
k i i
k
i
x
k k k i
k i
x D
k k i
k i
x P D
(14)
a combination of Eqs.(12), (13) and (14) leads to the desired result.
PROCEDURE SOLUTION OF THE LINEAR FRACTIONAL KLIEN-GORDON EQUATION
Consider the LFKGE of type given in Eq.(3). In order to use Legendre collocation method, we first approximate t x u , ( ) as
). ( ) ( = ) , (
0 =
x P t u t x u
i i
m
i
m
(15)
From Eqs.(3), (15) and Theorem 1 we have
). , ( ) ( ) ( ) (
) (
) (
,
= =
2
2
0 =
t x f x w t u x d x P
t d
t u d
k
k i i
i
k
m
i
i
i
m
i
=
( (
(16)
We now collocate Eq.(16) at ) 1 ( ( + m points
p
x , ( m p 0,1,..., = as
). , ( ) ( ) ( ) ( ) (
) (
,
= = 0 =
t x f x w t u x d x P t u
p
k
p k i i
i
k
m
i
p p i i
m
i
=
( (
& & (17)
For suitable collocation points we use roots of shifted Legendre polynomial ) (
1
x P
m ( +
.
Also, by substituting Eq.(15) in the boundary conditions (5) we can obtain ( equations as follows
On the Numerical Solution for the Linear Fractional Klien-Gordon Equation Using Legendre Pseudospectral Method 5
). ( = ) ( ), ( = ) ( 1) (
2
0 =
1
0 =
t h t u t h t u
i
m
i
i
i
m
i
(18)
Eq.(17), together with ( equations of the boundary conditions (18), give 1) ( + m of ordinary differential equations
which
can be solved, for the unknowns , 0,1,..., = , m i u
i
using the finite difference method, as described in the following
section.
NUMERICAL RESULTS
In this section, we implement the proposed method to solve LFKGE (3) with 1.8 = , of the form
0, > 1, < < 0 ), , ( ) , ( ) ( ) , (
1.8
t x t x f t x u D x d t x u
tt
=
with the coefficient function: , (1.2) = ) (
1.8
x x d
the source function: , 1) (4 = ) , (
2 t
e x x t x f
under initial conditions 1), ( = ,0) ( ), (1 = ,0) (
2 2
x x x u x x x u
t
and Dirichlet conditions 0. = ) (1, = ) (0, t u t u
The exact solution to this problem is , ) (1 = ) , (
2 t
e x x t x u
which can be verified by applying the fractional
differential formula (2).
We apply the proposed method with 3 = m , and approximate the solution as follows
). ( ) ( = ) , (
3
0 =
3
x P t u t x u
i i
i
(19)
Using Eq.(17) we have
0,1, = ), , ( ) ( ) ( ) ( ) (
1.8 (1.8)
,
2 =
3
2 =
3
0 =
p t x f x w t u x d x P t u
p
k
p k i i
i
k i
p p i i
i
=
& & (20)
where
p
x are roots of shifted Legendre polynomial ) (
2
x P , i.e. 0.788675. = 0.211324, =
1 0
x x
By using Eqs.(18) and (20) we can obtain the following system of ODEs
), ( ) ( ) ( ) ( ) ( ) (
0 3 2 2 1 3 2 1 1 0
t f t u R t u R t u k t u k t u = + + & & & & & & (21)
), ( ) ( ) ( ) ( ) ( ) (
1 3 22 2 11 3 22 1 11 0
t f t u R t u R t u k t u k t u = + + & & & & & & (22)
0, = ) ( ) ( ) ( ) (
3 2 1 0
t u t u t u t u + (23)
0, = ) ( ) ( ) ( ) (
3 2 1 0
t u t u t u t u + + + (24)
where
), ( = ), ( = ), ( = ), ( =
1 3 22 1 1 11 0 3 2 0 1 1
x P k x P k x P k x P k
], [ ) ( = , ) ( =
1.2
0
(1.8)
3,3
0.2
0
(1.8)
3,2 0 2
0.2
0
(1.8)
2,2 0 1
x w x w x d R x w x d R +
]. [ ) ( = , ) ( =
1.2
1
(1.8)
3,3
0.2
1
(1.8)
3,2 1 22
0.2
1
(1.8)
2,2 1 11
x w x w x d R x w x d R +
Now, to use FDM for solving the system (21)-(24), we use the notations i t
i
= to be the integration time , 0 T t
i
6 N. H. Sweilam, M. M. Khader & A. M. S. Mahdy
, / = N T for N i 0,1,..., = for an arbitrary integer number . N Define ). ( = ), ( =
n i
n
i n i
n
i
t f f t u u
Then the system (21)-(24), is discretized in time and takes the following form
,
2 2 2
1
0
1
3 2
1
2 1 2
1
3 3
1
3
2 2
1
1 1
1
1
1 2
1
0 0
1
0 + + +
+ + +
=
+
+
+
+
+
n n n
n n n n n n n n n
f u R u R
u u u
k
u u u
k
u u u
(25)
,
2 2 2
1
1
1
3 22
1
2 11
2
1
3 3
1
3
22
2
1
1 1
1
1
11
2
1
0 0
1
0 + + +
+ + +
=
+
+
+
+
+
n n n
n n n n n n n n n
f u R u R
u u u
k
u u u
k
u u u
(26)
0, =
1
3
1
2
1
1
1
0
+ + + +
+
n n n n
u u u u (27)
0. =
1
3
1
2
1
1
1
0
+ + + +
+ + +
n n n n
u u u u (28)
We can write the above system (25)-(28) in the following matrix form
.
0
0
0 0 0 0
0 0 0 0
0 1
0 1
0 0 0 0
0 0 0 0
2 0 2 2
2 0 2 2
=
1 1 1 1
1 1 1 1
1
1
1
1
2
0
2
1
3
2
1
0
22 11
2 1
3
2
1
0
22 11
2 1
1
3
2
1
0
22
2
22 11
2
11
2
2
2 1
2
1
+
+
|
|
|
|
|
|
\
|
+
|
|
|
|
|
|
\
|
|
|
|
|
|
|
\
|
|
|
|
|
|
|
\
|
|
|
|
|
|
|
\
|
|
|
|
|
|
|
\
|
|
|
|
|
|
|
\
|
n n n
n
f
f
u
u
u
u
k k
k k
u
u
u
u
k k
k k
u
u
u
u
R k R k
R k R k
(29)
We use the notation for the above system
, = , , =
1 1 1 1 1 1 1 1 1 + + + +
+ +
n n n n n n n n
F A U C A U B A U or F U C U B U A (30)
where
T n n n n n
u u u u U ) , , , ( =
3 2 1 0
and . 0) 0, , , ( =
1
2
0
2 T n n n
f f F
The obtained numerical results by means of the proposed method are shown in Table 1 and figures 1-2. In
Table 1, the absolute errors between the exact solution
ex
u and the approximate solution
approx
u at 3 = m and 5 = m
with the final time 2 = T are given. Also, in figures 1 and 2, comparison between the exact solution and the approximate
solution at 1 = T with time step 0.0025, = 3 = m and 5 = m , respectively, are presented.
Table 1: The Absolute Error between the Exact Solution and the Approximate Solution at
at 3 = m , 5 = m and 2 = T
x
3 at
approx ex
= m u u
5 at
approx ex
= m u u
0.0 4.483787e-03
2.726496e-04
0.1 4.479660e-03
3.455890e-04
0.2 4.201329e-03
3.809670e-04
0.3 3.695172e-03
3.809103e-04
0.4 3.007566e-03
3.514280e-04
0.5 2.184889e-03
3.009263e-04
0.6 1.273510e-03
2.387121e-04
0.7 0.319831e-03
1.735125e-04
0.8 0.629793e-03
1.119821e-04
0.9 1.528978e-03
0.572150e-04
1.0 2.331347e-03
0.072566e-04
On the Numerical Solution for the Linear Fractional Klien-Gordon Equation Using Legendre Pseudospectral Method 7
Figure 1: Comparison between the Exact Solution and the Approximate Solution at 1 = T with 0025 . 0 = and
3 = m
Figure 2: Comparison between the Exact Solution and the Approximate Solution at 1 = T with 0025 . 0 = and
5 = m
CONCLUSIONS
In this paper, we considered the numerical solutions for linear fractional Klein-Gordon equation using the
application of Legendre pseudo-spectral method. The properties of the Legendre polynomials are used to reduce the
proposed problem to the solution of system of ordinary differential equations which solved by using FDM. The fractional
derivative is considered in the Caputo sense. The solutions obtained using the suggested method are in excellent agreement
with the exact solution and show that this approach can be solved the problem effectively. Although we only considered a
model problem in this paper, the main idea and the used techniques in this work are also applicable to many other
problems. It is evident that the overall errors can be made smaller by adding new terms from the series (15). Comparisons
are made between the approximate solution and the exact solution to illustrate the validity and the great potential of the
technique. All computations in this paper are done using Matlab 8.
REFERENCES
1. Bagley, R. L., & Torvik, P. J. (1984). On the appearance of the fractional derivative in the behavior of real
materials, J. Appl. Mech., 51, 294-298
8 N. H. Sweilam, M. M. Khader & A. M. S. Mahdy
2. Bell, W. W. (1968). Special Functions for Scientists and Engineers, Great Britain, Butler & Tanner Ltd, Frome
and London
3. Das, S. (2008). Functional Fractional Calculus for System Identification and Controls, Springer, New York.
4. Dehghan, M. & Shokri, A. (2009). Numerical solution of the nonlinear Klein-Gordon equation using radial basis
functions, Journal of Computational and Applied Mathematics, 230, 400-410
5. El-Sayed, S. M. (2003). The decomposition method for studying the Klein-Gordon equation, Chaos, Solitons &
Fractals, 18(5), 1026-1030
6. El-Sayed, A. M. A., Elsaid, A. & Hammad, D. (2012). A reliable treatment of homotopy perturbation method for
solving the nonlinear Klein-Gordon equation of arbitrary (fractional) orders, Journal of Applied Mathematics,
2012, 1-13
7. El-Sayed, A. M. A., Elsaid, A., El-Kalla, I. L. & Hammad, D. (2012). A homotopy perturbation technique for
solving partial differential equations of fractional order in finite domains, Applied Mathematics & Computation,
218, 8329-8340
8. Golmankhaneh, A. K., Golmankhaneh, A. K. & Baleanu, D. (2011). On nonlinear fractional Klein-Gordon
equation, Signal Processing, 91, 446-451
9. Hashim, I., Abdulaziz, O. & Momani, S. (2009). Homotopy analysis method for fractional IVPs, Commun.
Nonlinear Sci. Numer. Simul., 14, 674-684
10. He, J. H. (1998). Approximate analytical solution for seepage flow with fractional derivatives in porous media,
Computer Methods in Applied Mechanics and Engineering, 167(1-2), 57-68
11. Inc, M. (2008). The approximate and exact solutions of the space-and time-fractional Burger's equations with
initial conditions by VIM, J. Math. Anal. Appl., 345, 476-484
12. Jafari, H. & Daftardar-Gejji, V. (2006). Solving linear and nonlinear fractional diffusion and wave equations by
ADM, Appl. Math. & Comput., 180, 488-497
13. Khader, M. M. (2011). On the numerical solutions for the fractional diffusion equation, Communications in
Nonlinear Science & Numerical Simulations, 16, 2535-2542
14. Khader, M. M. (2012). Introducing an efficient modification of the homotopy perturbation method by using
Chebyshev polynomials. Arab Journal of Mathematical Sciences, 18, 61-71
15. Khader, M. M., Sweilam, N. H., & Mahdy, A. M. S. (2011). An efficient numerical method for solving the
fractional diffusion equation. J. of Applied Mathematics & Bioinformatics, 1, 1-12
16. Khader, M. M., & Hendy, A. S. (2012). The approximate and exact solutions of the fractional order delay
differential equations using Legendre pseudospectral method. International Journal of Pure & Applied
Mathematics, 74(3), 287-297
17. Khader, M. M. & Hendy, A. S. (2012). A numerical technique for solving fractional variational problems.
Accepted in Mathematical Methods in Applied Sciences
18. Lakestani, M. & Dehghan, M. (2010). Collocation and finite difference-collocation methods for the solution of
nonlinear Klein-Gordon equation. Computer Physics Communications, 181, 1392-1401
On the Numerical Solution for the Linear Fractional Klien-Gordon Equation Using Legendre Pseudospectral Method 9
19. Meerschaert, M. M. & Tadjeran, C. (2006). Finite difference approximations for two-sided space fractional partial
differential equations. Appl. Numer. Math. 56, 80-90
20. Podlubny, I. (1999). Fractional Differential Equations. Academic Press, New York
21. Rashidini, J., & Mohammadi, R. (2010). Tension spline approach for the numerical solution of nonlinear Klein-
Gordon equation, Computer Physics Communications, 181, 78-91
22. Sassaman, R., & Biswas, A. (2011). Soliton solutions of the generalized Klein-Gordon equation by semi-inverse
variational principle. Mathematics in Engineering Science & Aerospace, 2(1), 99-104
23. Sassaman, R. & Biswas, A. (2011). 1-soliton solution of the perturbed Klein-Gordon equation. Physics Express,
1(1), 9-14
24. Smith, G. D. (1965). Numerical Solution of Partial Differential Equations. Oxford University Press
25. Sweilam, N. H., Khader, M. M. & Al-Bar, R. F. (2007). Numerical studies for a multi-order fractional differential
equation. Physics Letters A, 371, 26-33
26. Sweilam, N. H., & Khader, M. M. (2010). A Chebyshev pseudo-spectral method for solving fractional integro-
differential equations. ANZIAM, 51, 464-475
27. Sweilam, N. H., Khader, M. M., & Nagy, A. M. (2011). Numerical solution of two-sided space fractional wave
equation using finite difference method. J. of Computional & Applied Mathematics, 235, 2832-2841
28. Sweilam, N. H., Khader, M. M. & Adel, M. (2012). On the stability analysis of weighted average finite difference
methods for fractional wave equation. Fractional Differential Calculus, 2(1), 17-29
29. Sweilam, N. H., Khader, M. M. & Mahdy, A. M. S. (2012). Crank-Nicolson finite difference method for solving
time-fractional diffusion equation. Journal of Fractional Calculus and Applications, 2(2), 1-9
30. Sweilam, N. H., Khader, M. M. & Mahdy, A. M. S. (2012). Numerical studies for solving fractional-order
Logistic equation, Int. J. of Pure and Applied Mathematics, 78(8), 1199-1210
31. Sweilam, N. H., Khader, M. M. & Mahdy, A. M. S. (2012). Numerical studies for fractional-order Logistic
differential equation with two different delays, Journal of Applied Mathematics, 2012, 1-14
32. Sweilam, N. H., Khader, M. M. & Mahdy, A. M. S. (2012). Numerical studies for solving fractional Riccati
differential equation, Accepted for publication in Applications & Applied Mathematics: An International Journal
33. Wazwaz, A. M. (2006). Compacton solitons and periodic solutions for some forms of nonlinear Klein-Gordon
equations. Chaos, Solitons & Fractals, 28(4), 1005-1013
34. Yusufoglu, E. (2008). The variational iteration method for studying the Klein-Gordon equation. Applied
Mathematics Letters, 21(7), 669-674