1 Introduction

Due to their accuracy, fractional partial differential equations (PDEs) in the description of nonlinear phenomena in engineering, physics, viscoelasticity, fluid mechanics, biology, and other areas of science have got a lot of attention in recent years [13]. There are many advantages of fractional derivatives, one of them is that it can be seen as a set of ordinary derivatives that give the fractional derivatives the ability to describe what integer-order derivatives cannot [4]. One may refer for the historical development of fractional operators to [5, 6].

The tau spectral method is one of the most important methods that have been used to find numerical solutions of differential equations. Expressing the solution as an expansion of certain orthogonal polynomials and then choosing the coefficients in the expansion in order to satisfy the differential equation as accurately as possible is the main idea of the spectral methods.

In a lot of papers there have been proposals for solving the multi-term fractional differential equations such as the Haar wavelet [7, 8], the homotopy analysis method [9, 10], the Legendre wavelet method [11], the homotopy-perturbation method [12, 13], and the variational iteration method [14]. Spectral methods have been used to introduce approximate solutions for the fractional differential equations based on collocation and tau methods, see [15, 16]. Moreover, spectral methods are applied with the help of the operational matrix of fractional derivatives for numerical approximations of the linear and nonlinear FDEs [1719], not only the operational matrices of fractional derivatives, but those of fractional integrations are used with the help of the tau and pseudospectral methods to solve some types of FDEs [2022].

The use of general Jacobi polynomials has the advantage of obtaining the solutions in terms of the Jacobi parameters α and β. Hence to generalize and instead of developing approximation results for each particular pair of indices, it would be very useful to carry out a systematic study on Jacobi polynomials (α,β>1) with general indices, which can then be directly applied to other applications. It is with this motivation that we introduce in this paper a family of Jacobi polynomials with indices α,β>1.

The operational matrix was presented for fractional derivatives of shifted Jacobi polynomials by Doha et al. [23] and used with the help of the spectral tau method to introduce numerical solutions of FDEs. Recently, spectral methods are used together with the shifted Jacobi polynomials for investigating numerical approximations of linear and nonlinear FDEs with constant and variable coefficients in [24].

During the past few decades fractional order partial differential equations began to play a key role especially in the study and modeling of anomalies and complex systems [2, 2529]. SFDEs model phenomena exhibiting anomalous diffusion that cannot be modeled accurately by the classical diffusion equations. Because of the nonlocal property of fractional differential operators, the numerical methods for SFDEs often generate dense or even full coefficient matrices. Numerical approaches to different types of fractional diffusion models have been increasingly appearing in the literature [3035]. Spectral methods are applied together with the finite difference method [36] in order to find an approximate solution of SFDEs; see [30]. Bhrawy and Baleanu [37] proposed the Legendre-Gauss-Lobatto collocation scheme for solving the SFDEs with variable coefficients. Recently, Saadatmandi and Dehghan [38] and Doha et al. [39] applied the operational matrix of fractional derivatives with the help of tau approximations based on Legendre polynomials and Chebyshev polynomials for numerical solutions of SFDEs, respectively.

In this paper we are concerned with the direct solution techniques for the numerical solution of SFDEs, using the Jacobi tau approximations. Developing an efficient algorithm using the tau method together with operational matrices of a fractional derivative and integration of shifted Jacobi polynomials is our main aim. The shifted Jacobi tau method based on Jacobi operational matrices reduces SFDEs to a system of algebraic equations, which simplifies the problem. We note that the improved operational matrix techniques based on the Legendre tau method [38], the Chebyshev tau method [39], and some other interesting methods can be obtained directly as special cases from our proposed shifted Jacobi operational matrices with Jacobi tau approximations.

The article is arranged in the following way: In Section 2, some properties of Jacobi polynomials and some necessary definitions are introduced. In Section 3, we apply our algorithm for the solution of SFDEs. The error estimate is given in Section 4. In Section 5 several examples have been applied. Also, a conclusion is presented in the final section.

2 Basic ideas and definitions

2.1 Fractional derivation and integration

The Riemann-Liouville and Caputo fractional definitions are the two most used definitions of fractional calculus.

Definition 2.1 The integral of order ν0 (fractional) according to Riemann-Liouville is given by

J ν f ( x ) = 1 Γ ( ν ) 0 x ( x t ) ν 1 f ( t ) d t , ν > 0 , x > 0 , J 0 f ( x ) = f ( x ) ,
(1)

where

Γ(ν)= 0 x ν 1 e x dx

is the gamma function.

The operator J ν satisfies the following properties:

J ν J μ f ( x ) = J ν + μ f ( x ) , J ν J μ f ( x ) = J μ J ν f ( x ) , J ν x β = Γ ( β + 1 ) Γ ( β + 1 + ν ) x β + ν .
(2)

Definition 2.2 The Caputo fractional derivatives of order ν is defined as

D ν f(x)= 1 Γ ( m ν ) 0 x ( x t ) m ν 1 d m d t m f(t)dt,m1<νm,x>0,
(3)

where m is the ceiling function of ν.

The operator D ν satisfies the following properties:

D ν C = 0 (C is constant) , D ν J ν f ( x ) = f ( x ) , J ν D ν f ( x ) = f ( x ) i = 0 m 1 f ( i ) ( 0 + ) x i i ! , D ν x β = Γ ( β + 1 ) Γ ( β + 1 ν ) x β ν , D ν ( λ f ( x ) + μ g ( x ) ) = λ D ν f ( x ) + μ D ν g ( x ) .
(4)

2.2 SFDE

Consider a one-dimensional SFDE considered as

u ( x , t ) t =c(x) ν u ( x , t ) x ν +q(x,t),0<x<L,0<tτ,1<ν2,
(5)

with initial and boundary conditions

u(x,0)=f(x),0<x<L,
(6)

and

u ( 0 , t ) = g 0 ( t ) , 0 < t τ , u ( L , t ) = g 1 ( t ) , 0 < t τ ,
(7)

respectively, where u(x,t) represents the solute concentration, q(x,t) is the source term and f(x) is the initial solute concentration but g 0 (x) and g 1 (x) are the boundary solute concentrations.

2.3 Properties of shifted Jacobi polynomials

The Jacobi polynomials are orthogonal with Jacobi weight function w(z)= ( 1 z ) α ( 1 + z ) β over I=[1,1], namely

1 1 P j ( α , β ) (z) P k ( α , β ) (z) w ( α , β ) (z)dz= δ j k γ k ( α , β ) ,

where δ j k is the Kronecker function and

γ k ( α , β ) = 2 α + β + 1 Γ ( k + α + 1 ) Γ ( k + β + 1 ) ( 2 k + α + β + 1 ) k ! Γ ( k + α + β + 1 ) .

One can generate Jacobi polynomials from the recurrence relation:

P i ( α , β ) ( z ) = ( α + β + 2 i 1 ) { α 2 β 2 + z ( α + β + 2 i ) ( α + β + 2 i 2 ) } 2 i ( α + β + i ) ( α + β + 2 i 2 ) P i 1 ( α , β ) ( z ) ( α + i 1 ) ( β + i 1 ) ( α + β + 2 i ) i ( α + β + i ) ( α + β + 2 i 2 ) P i 2 ( α , β ) ( z ) , i = 2 , 3 , ,

where

P 0 ( α , β ) (z)=1and P 1 ( α , β ) (z)= α + β + 2 2 (z)+ α β 2 .

By introducing the variable z= 2 x L 1, Jacobi polynomials can be used in the interval x[0,L] that will be called shifted Jacobi polynomials. Let the shifted Jacobi polynomials P i ( α , β ) ( 2 x L 1) be denoted by P L , i ( α , β ) (x). Then the shifted Jacobi polynomials are orthogonal with respect to the weight function w L ( α , β ) (x) over I=[0,L], namely

0 L P L , j ( α , β ) (x) P L , k ( α , β ) (x) w L ( α , β ) (x)dx= h L , k ( α , β ) ,
(8)

where

h L , k ( α , β ) = ( L 2 ) α + β + 1 δ j k γ j ( α , β ) = L α + β + 1 Γ ( k + α + 1 ) Γ ( k + β + 1 ) ( 2 k + α + β + 1 ) k ! Γ ( k + α + β + 1 ) .

The analytic form of the shifted Jacobi polynomials P L , i ( α , β ) (x) of degree i is given by

P L , i ( α , β ) (x)= k = 0 i ( 1 ) i k Γ ( i + β + 1 ) Γ ( i + k + α + β + 1 ) Γ ( k + β + 1 ) Γ ( i + α + β + 1 ) ( i k ) ! k ! L k x k ,
(9)

where

P L , i ( α , β ) (0)= ( 1 ) i Γ ( i + β + 1 ) Γ ( β + 1 ) i ! , P L , i ( α , β ) (L)= Γ ( i + α + 1 ) Γ ( α + 1 ) i ! .

A function u(x), square integrable in (0,L), can be expressed in terms of shifted Jacobi polynomials as

u(x)= j = 0 c j P L , j ( α , β ) (x),

where the coefficients c j are given by

c j = 1 h L , j ( α , β ) 0 L w L ( α , β ) (x)u(x) P L , j ( α , β ) dx,j=0,1,.
(10)

In practice, only the first (N+1) terms of shifted Jacobi polynomials are considered. Hence we can write

u N (x) j = 0 N c j P L , j ( α , β ) (x)= C T ϕ L , N (x),
(11)

where the shifted Jacobi coefficient vector C and the shifted Jacobi vector ϕ L , N (x) are given by

C T = [ c 0 , c 1 , , c N ] , ϕ L , N ( x ) = [ P L , 0 ( α , β ) ( x ) , P L , 1 ( α , β ) ( x ) , , P L , N ( α , β ) ( x ) ] T .
(12)

Similarly a function u(x,t) of two independent variables defined for 0<x<L and 0<tτ may be expanded in terms of the double shifted Jacobi polynomials as

u M , N (x,t)= i = 0 M j = 0 N c i j P τ , i ( α , β ) (t) P L , j ( α , β ) (x)= ϕ τ , M T (t)A ϕ L , N (x),
(13)

where the shifted Jacobi vectors ϕ τ , M (t) and ϕ L , N (x) are defined similarly to (12); also the shifted Jacobi coefficient matrix A is given by

A= ( a 00 a 01 a 0 N a 10 a 11 a 1 N a M 0 a M 1 a M N ) ,

where

a i j = 1 h τ , i ( α , β ) h L , j ( α , β ) 0 τ 0 L u ( x , t ) P τ , i ( α , β ) ( t ) P L , j ( α , β ) ( x ) w τ ( α , β ) ( t ) w L ( α , β ) ( x ) d x d t , i = 0 , 1 , , M , j = 0 , 1 , , N .
(14)

The first integration of ϕ τ , M (t) can be expressed as

J 1 ϕ τ , M (t) P ( 1 ) ϕ τ , M (t),
(15)

where P ( 1 ) is an (M+1)×(M+1) operational matrix of integration of order one in the Riemann-Liouville sense and is defined as follows:

P ( 1 ) = ( Ω 1 ( 0 , 0 , α , β ) Ω 1 ( 0 , 1 , α , β ) Ω 1 ( 0 , M , α , β ) Ω 1 ( 1 , 0 , α , β ) Ω 1 ( 1 , 1 , α , β ) Ω 1 ( 1 , M , α , β ) Ω 1 ( i , 0 , α , β ) Ω 1 ( i , 1 , α , β ) Ω 1 ( i , M , α , β ) Ω 1 ( M , 0 , α , β ) Ω 1 ( M , 1 , α , β ) Ω 1 ( M , M , α , β ) ) ,
(16)

where

Ω 1 ( i , j , α , β ) = k = 0 i ( 1 ) i k Γ ( i + β + 1 ) Γ ( i + k + α + β + 1 ) τ Γ ( k + β + 1 ) Γ ( j + α + β + 1 ) ( i k ) ! Γ ( k + 2 ) × f = 0 j ( 1 ) j f Γ ( j + f + α + β + 1 ) Γ ( α + 1 ) Γ ( f + k + β + 2 ) ( 2 j + α + β + 1 ) j ! Γ ( j + α + 1 ) Γ ( f + β + 1 ) ( j f ) ! f ! Γ ( f + k + α + β + 3 )

(see [40] for a proof).

The fractional derivative of order ν>0 of ϕ L , N (x) can be expressed as

D ν ϕ L , N (x) D ( ν ) ϕ L , N (x),
(17)

where D ( ν ) is the (N+1)×(N+1) Jacobi operational matrix of derivatives of order ν in the Caputo sense and is defined as follows:

D ( ν ) = ( 0 0 0 0 0 0 0 0 Δ ν ( ν , 0 ) Δ ν ( ν , 1 ) Δ ν ( ν , 2 ) Δ ν ( ν , N ) Δ ν ( i , 0 ) Δ ν ( i , 1 ) Δ ν ( i , 2 ) Δ ν ( i , N ) Δ ν ( N , 0 ) Δ ν ( N , 1 ) Δ ν ( N , 2 ) Δ ν ( N , N ) ) ,
(18)

where

Δ ν ( i , j ) = k = ν i ( 1 ) i k L α + β ν + 1 Γ ( j + β + 1 ) Γ ( i + β + 1 ) Γ ( i + k + α + β + 1 ) h j Γ ( j + α + β + 1 ) Γ ( k + β + 1 ) Γ ( i + α + β + 1 ) Γ ( k ν + 1 ) ( i k ) ! × l = 0 j ( 1 ) j l Γ ( j + l + α + β + 1 ) Γ ( α + 1 ) Γ ( l + k + β ν + 1 ) Γ ( l + β + 1 ) Γ ( l + k + α + β ν + 2 ) ( j l ) ! l ! .
(19)

Note that in D ( ν ) , the first ν rows are all zero (see [23] for a proof).

3 The numerical scheme

In this section, we apply the spectral tau method together with the shifted Jacobi operational matrix to solve SFDE (5) with initial conditions (6) and boundary conditions (7).

First, we approximate u(x,t), c(x), q(x,t), and f(x) by the shifted Jacobi polynomials as

u M , N ( x , t ) = ϕ τ , M T ( t ) A ϕ L , N ( x ) , c N ( x ) = C T ϕ L , N ( x ) , q M , N ( x , t ) = ϕ τ , M T ( t ) Q ϕ L , N ( x ) , f ( x ) = ϕ τ , M T ( t ) F ϕ L , N ( x ) ,
(20)

where A is an unknown (M+1)×(N+1) matrix, but C T , Q and F are known matrices which can be written as

C T = [ c 0 , c 1 , , c N ] , Q = ( q 00 q 01 q 0 N q 10 q 11 q 1 N q M 0 q M 1 q M N ) , F = ( f 0 f 1 f N 1 f N 0 0 0 0 0 0 0 0 ) ,
(21)

where c j and f j are given as in (10) but the q i j are given as in (14).

By getting the integrated form of (5) from 0 to t and using (6), we have

u(x,t)f(x)= 0 t c(x) ν u ( x , t ) x ν dt+ 0 t q(x,t)dt.
(22)

Using (15), (17), and (20) it is easy to obtain

0 t c ( x ) ν u ( x , t ) x ν d t ( C T ϕ L , N ( x ) ) ( 0 t ϕ τ , M T ( t ) d t ) A ( D ν ϕ L , N ( x ) ) , = ( C T ϕ L , N ( x ) ) ( ϕ τ , M T ( t ) P T A D ( ν ) ϕ L , N ( x ) ) = ϕ τ , M T ( t ) P T A D ( ν ) ϕ L , N ( x ) ϕ L , N T ( x ) C .
(23)

Let

ϕ L , N (x) ϕ L , N T (x)C H T ϕ L , N (x),
(24)

where H is a (N+1)×(N+1) matrix. To illustrate H, (24) can be written as

k = 0 N c k P L , k ( α , β ) (x) P L , j ( α , β ) (x)= k = 0 N H k j P L , k ( α , β ) (x),j=0,1,,N.

Multiplying both sides of the above equation by P L , i ( α , β ) (x) w L ( α , β ) (x), i=0,1,,N and integrating the result from 0 to L, we obtain

k = 0 N c k 0 L P L , i ( α , β ) ( x ) P L , k ( α , β ) ( x ) P L , j ( α , β ) ( x ) w L ( α , β ) ( x ) d x = H i j 0 L P L , i ( α , β ) ( x ) P L , i ( α , β ) ( x ) w L ( α , β ) ( x ) d x .
(25)

By using (25) and making use of (8) we have

H i j = 1 h L , i ( α , β ) k = 0 N ( c k ( x ) 0 L P L , i ( α , β ) ( x ) P L , k ( α , β ) ( x ) P L , j ( α , β ) ( x ) w L ( α , β ) ( x ) d x ) , i , j = 0 , 1 , , N .
(26)

Employing (24), (23) can be written as

0 t c(x) ν u ( x , t ) x ν dt= ϕ τ , M T (t) P T A D ( ν ) H T ϕ L , N (x).
(27)

Also using (15) and (20) we get

0 t q M , N (x,t)dt= ϕ τ , M T (t) P T Q ϕ L , N (x).
(28)

Applying (20), (27), and (28) the residual R N , M (x,t) for (22) can be written as

R N , M ( x , t ) = ϕ τ , M T ( t ) [ A F P T A D ( ν ) H T P T Q ] ϕ L , N ( x ) = ϕ τ , M T ( t ) E ϕ L , N ( x ) ,
(29)

where

E=AF P T A D ( ν ) H T P T Q.

As in a typical tau method, see [41], we generate (M+1)×(N1) linear algebraic equations using the following algebraic equations:

E i j =0,i=0,1,,M,j=0,1,,N2.
(30)

Also, substituting (20) in (7) we obtain

ϕ τ , M T (t)A ϕ L , N (0)= g 0 (t),
(31)
ϕ τ , M T (t)A ϕ L , N (L)= g 1 (t),
(32)

respectively. Equations (31) and (32) are collocated at (M+1) points. For suitable collocation points we use the shifted Jacobi roots t i , i=1,2,,M+1 of P τ , M + 1 ( α , β ) (t). The number of unknown coefficients a i j is equal to (N+1)(M+1) and can be obtained from (30)-(32). Consequently u N , M (x,t) given in (20) can be calculated.

4 Numerical results

Example 1 Let us consider (5) with initial condition u(x,0)= x 4 , 0<x<1, and boundary conditions u(0,t)=0 and u(1,t)= e t , with c(x)= 1 24 Γ(5ν) x ν and d(x,t)=2 e t x 4 ; see [31].

The exact solution of the problem is of the form u(x,t)= e t x 4 .

Consider u(x,t) and u M , N (x,t), the exact and approximated solutions, respectively. Then the error is defined by

u ( x , t ) u M , N ( x , t ) ,
(33)

where is the l norm.

Regarding this problem we study four different choices of ν, △x and △t with N=M=5.

In Tables 1 and 2, we compare l errors using the proposed method, at N=M=5 with different choices of ν, △x, α, β and △t, and that obtained by Sousa [31]. Also, in Figure 1, we plot the error function at N=M=8, α=β=1, and ν=1.6, while in Figure 2, we show the logarithmic graphs of the maximum absolute errors (MAEs) (Log10error) at α=β=0, ν=1.2, and various choices of N (N=M); by using our algorithm. From these figures, it is shown that the numerical errors decay rapidly as N increased. This confirms that the proposed method has an exponential rate of convergence.

Figure 1
figure 1

Error function at N=M=8 , α=β=0 , and ν=1.6 for Example 1 .

Figure 2
figure 2

Convergence of the MAEs at α=β=0 and ν=1.2 for Example 1 .

Table 1 l error at N=M=5 for ν=1.2,1.4 and x=t for Example 1
Table 2 l error at N=M=5 for ν=1.5,1.8 and x=t for Example 1

In [31], Sousa implemented the Crank-Nicolson discretization in time together with the spline approximations for introducing a solution of this problem and the results are shown in Tables 1 and 2. It is clear from Tables 1 and 2 that the presented method is more accurate than the spline method. Moreover, numerical results that have been obtained in the case of α=β= 1 2 are entirely consistent with the results presented by Doha et al. [39].

Example 2 Consider the following problem:

u ( x , t ) t =c(x) 1.8 u ( x , t ) x 1.8 +q(x,t),0<x<1,0<t2,
(34)

where

c(x)=Γ(1.2) x 1.8 ,q(x,t)= ( 6 x 3 3 x 2 ) e t ,

with initial condition

u(x,0)= x 2 x 3 ,

and boundary conditions

u(0,t)=u(1,t)=0,

where the exact solution of this problem is

u(x,t)= ( x 2 x 3 ) e t .

This problem was also investigated by Khader using the Chebyshev collocation method, see [30], but in [38] the authors introduced a tau approach based on shifted Legendre polynomials for solving it. In Table 3 we introduce the absolute errors at N=M=5 with t=2, and various choices of α and β, while in Figure 3, we plot the error function at N=M=8 and α=β=1. For the sake of comparison, the results obtained by Khader [30] are also introduced in the second column of Table 3. Table 3 confirms that this method is more accurate than the Chebyshev collocation method [30] (see Table 1 in [30]). Results that have been obtained in the case of α=β=0, are entirely consistent with the results presented by Saadatmandi and Dehghan [38].

Figure 3
figure 3

Error function at N=M=8 , α=β=1 , and ν=1.8 for Example 2 .

Table 3 Absolute errors at N=M=5 with t=2 and various choices of α , β , for Example 2

In the case where an exact solution is not known, one follows a similar method. The difference is that one calculates the residual errors only, since comparison to an exact solution is not possible.

Example 3 Consider (5) with the coefficient function, c(x)= 1 2 Γ(3ν) x ν , and the source function, q(x,t)=sin(t) x 2 cos(t) x 2 , with initial condition u(x,0)= x 2 , 0<x<1, and boundary conditions u(0,t)=0 and u(1,t)=cos(t).

The exact solution of the problem is of the form u(x,t)=cos(t) x 2 .

Table 4 lists the absolute errors using the Jacobi tau spectral method based on the Jacobi operational matrix at x=1 with N=M=5 and different choices of α, and β. Also in Figure 4, we show the logarithmic graphs of the MAEs at α=β=1, ν=1.5, and various choices of N (N=M); by using our algorithm.

Figure 4
figure 4

Convergence of the MAEs at α=β=1 and ν=1.5 for Example 3 .

Table 4 Absolute errors at N=M=5 , ν=1.8 with x=1 and different choices of α , β for Example 3

Results that have been obtained in the case of α=β= 1 2 are entirely consistent with the results presented by Doha et al. [39].

5 Conclusion

The fundamental objective of the paper is to introduce a new method for solving the SFDE (5)-(7). Using the tau spectral method based on shifted Jacobi polynomials together with the operational matrix of fractional derivatives this objective has been achieved. The fractional derivatives are described in the Caputo sense. By adding more terms of the shifted Jacobi polynomial from (13), the errors will be smaller. In order to illustrate the accuracy of the method, we compared our approximate solutions of the problems with their exact and with the approximate solutions presented by other methods. According to the numerical results given in the previous section, the proposed method may be extended to solve several types of two-sided space-fractional partial FDEs subject to nonhomogeneous conditions.