article

Jie Shen and Changtao Sheng Spectral methods for fractional differential equations using generalized Jacobi functions

Abstract: We present essential properties of the generalized Jacobi functions (GJFs) and their application to construct efficient and accurate spectral methods fora class of fractional differential equations. In particular, it is shown that GJFs allow us to effortlessly compute the stiffness matrices, and resolve the leading singular term for a general class of fractional differential equations.

Keywords: fractional differential equations; generalized Jacobi functions; spectral method; Petrov-

AMS: 65N35, 65E05, 65M70, 41A05, 41A10

1 Introduction

Fractional differential equations (FDEs) have attracted considerable attention in recent years due to their ability to model certain processes which can not be adequately described by usual partial differential equations. Two main difficulties for dealing with FDEs are (i) fractional derivatives are non-local operators; (ii) fractional derivatives involve singular kernel/weight functions, and the solutions of FDEs are usually weakly singular near the boundaries and at initial time. Hence, a straightforward extension of usual polynomial based numerical methods for FDEs are not effective as it usually involves dense matrices even for the simplest FDEs and suffers from low convergence rate due to the weak singularity. Thus,one needs to develop non-standard and non-polynomial based numerical methods to effectively deal with the difficulties associated with FDEs.

Jie Shen, Department of Mathematics, Purdue University; School of Mathematical Sciences and Fujian Provincial Key Laboratory on Mathematical Modeling & High Performance Scientific Computing, Xiamen University. This work is supported in part by AFOSR FA9550- 16-1-0102 and NSF DMS-1620262, DMS-1720442. Changtao Sheng, School of Mathematical Sciences and Fujian Provincial Key Laboratory on Mathematical Modeling & High Performance Scientific Computing, Xiamen University. 2 J. Shen and C. Sheng

In this paper, we shall focus on some recently developed spectral methods using the generalized Jacobi functions (GJFs) for solving FDEs. Some pioneer work on using spectral methods for solving FDEs are carried out [17, 18]. However, the methods in these papers use the usual polynomial approximations which do not particularly address the two difficulties mentioned above. A breakthrough is made in [32] in which the authors introduced the so called poly-fractonomials, which are eigenfunctions of some fractional Sturm-Liouville operator. So using them as basis functions greatly simplifies the computation of fractional derivatives and leads to sparse matrices for some simple model equations. Furthermore, one can choose suitable parameters in poly-fractonomials so that its leading term is in fact the leading singular term of the corresponding FDE. Thus, the spectral method using poly-fractonomials can also resolve the leading singularity in a FDE. It turns out that the poly-fractonomials introduced in [32] coincide, within certain parameter range, with the generalized Jacobi functions introduced in [10]. In [5], the authors reexamined the generalized Jacobi functions in the context of FDEs and derived optimal approximation results with norms suitable for fractional derivatives. In particular, it is shown in [5] that well constructed spectral methods using GJFs for some typical FDEs can lead to exponential convergence despite the fact that their solutions are weakly singular. Thanks to the aforementioned remarkable properties of the poly-fractonomials/GJFs with regards to fractional derivatives and fractional differential equations, there is now a significant number of recent work on using the poly-fractonomials/GJFs for different kind of FDEs and singular integral equations, including, for examples, spectral-Galerkin or spectral Petrov-Galerkin methods [31, 11, 36, 23, 21, 28, 15]; spectral collocation methods [35, 36, 15, 12, 14, 34, 13]; DG spectral-element methods [33, 16]. The aim of this paper is not to provide an exhaustive review of all developments with regards to spectral methods for FDEs, rather, it aims to present essential properties of the GJFs, including relations to the fractional derivatives and their approximation results in properly weighted Sobolev spaces, and how one can use them to construct efficient and accurate spectral methods for FDEs. In order to illustrate the idea and advantage of spectral methods using GJFs, we shall consider the following FDE:

⎧ 퐶 훼 푅 훽 푅 훽 ⎨⎪ 훾 퐷푡 푢(푥, 푡) − 푝 퐷푥푢(푥, 푡) − (1 − 푝) 푥퐷 푢(푥, 푡) = 푓(푥, 푡), 푢(푥, 푡)|휕Λ = 0, ∀푡 ∈ 퐼 := (0, 푇 ), (1.1) ⎪ ⎩ 푢(푥, 0) = 푢0(푥), ∀푥 ∈ Λ = (푎, 푏),

퐶 훼 푅 훽 푅 훽 where 0 < 훼 < 1, 1 < 훽 < 2, 푝 ∈ [0, 1]; 퐷푡 , 퐷푥 and 푥퐷 are the Caputo, left- and right- Riemann Liouville fractional derivative operator, respectively. More spectral methods for FDEs 3 precisely, we shall consider, successively, the following four cases: (i) 훾 = 0, 푝 = 1: an initial-value problem and a boundary-value problem with one-sided fractional derivative; (ii) 훾 = 0, 푝 = 1/2: Riesz FDE; (iii) 훾 = 0, 푝 ̸= 0, 1/2, 1: a boundary- value problem with general two-sided fractional derivatives; and (iv) 훾 ̸= 0 and 푝 = 1/2: a space-time fractional diffusion equation. The rest of the paper is organized as follows. In the next section, we introduce the GJFs corresponding to the one-sided fractional derivative, Riesz derivative and two-sided fractional derivatives with different coefficients, summarize their special properties, particularly with regards to fractional derivatives, and present approximation results using these GJFs. In Section 3, we construct successively efficient spectral methods using GJFs for the four cases above, and derive their error estimates. We provide some concluding remarks in the last section. Due to the space constraint, we shall not present numerical results in this paper. However, theoretical results presented in this paper have been validated by ample numerical experiments in the correspondingly cited papers.

2 Generalized Jacobi functions and their approximation properties

In this section, we collect some basic relations and approximation properties of GJFs with respect to fractional derivatives from [21, 23, 22]. These results will play essential roles in developing efficient algorithms for FDEs and in deriving the corresponding error estimates in the next section.

2.1 Fractional integrals/derivatives

We inotrduce below the definitions of fractional integrals/derivatives. Let 푎 < 푏 and denote Λ = (푎, 푏).

Definition 2.1 (One-sided fractional integrals and derivatives [24, 7]). For 휌 ∈ + R , the left and right fractional integrals are respectively defined as 푥 1 ∫︁ 푣(푦) 퐼휌푣(푥) = 푑푦, 푥 ∈ Λ, 푥 Γ(휌) (푥 − 푦)1−휌 푎 (2.1) 푏 ∫︁ 휌 1 푣(푦) 푥퐼 푣(푥) = 푑푦, 푥 ∈ Λ, Γ(휌) (푦 − 푥)1−휌 푥 4 J. Shen and C. Sheng where Γ(·) is the usual Gamma function. For 푠 ∈ [푘 − 1, 푘) with 푘 ∈ N, the left-sided Riemann-Liouville fractional derivative of order 푠 is defined by 푥 1 푑푘 ∫︁ 푣(푦) 푅퐷푠푣(푥) = 푑푦, 푥 ∈ Λ, (2.2) 푥 Γ(푘 − 푠) 푑푥푘 (푥 − 푦)푠−푘+1 푎 and the right-sided Riemann-Liouville fractional derivative of order 푠 is defined by

푏 (−1)푘 푑푘 ∫︁ 푣(푦) 푅퐷푠푣(푥) = 푑푦, 푥 ∈ Λ. (2.3) 푥 Γ(푘 − 푠) 푑푥푘 (푦 − 푥)푠−푘+1 푥 For 푠 ∈ [푘 − 1, 푘) with 푘 ∈ N, the left-sided Caputo fractional derivatives of order 푠 is defined by 푥 1 ∫︁ 푣(푘)(푦) 퐶퐷푠푣(푥) := 푑푦, 푥 ∈ Λ, (2.4) 푥 Γ(푘 − 푠) (푥 − 푦)푠−푘+1 푎 and the right-sided Caputo fractional derivatives of order 푠 is defined by

푏 (−1)푘 ∫︁ 푣(푘)(푦) 퐶퐷푠푣(푥) := 푑푦, 푥 ∈ Λ. (2.5) 푥 Γ(푘 − 푠) (푦 − 푥)푠−푘+1 푥

According to [7, Thm. 2.14], we have that for any absolutely integrable function 푣, and real 푠 ≥ 0;

푅 푠 푠 푅 푠 푠 퐷푥 퐼푥푣(푥) = 푣(푥), 푥퐷 푥퐼 푣(푥) = 푣(푥), 푎.푒. 푖푛 Λ. (2.6)

The following lemma shows the relationship between the Riemann-Liouville and Caputo fractional derivatives (see, e.g., [7, 24]).

Lemma 2.1. For 푠 ∈ [푘 − 1, 푘) with 푘 ∈ N, we have 푘−1 ∑︁ 푢(푗)(푎) 푅퐷푠푢(푡) = 퐶퐷푠푢(푡) + (푡 − 푎)푗−푠. (2.7) 푡 푡 Γ(1 + 푗 − 푠) 푗=0

Definition 2.2. (Riesz fractional integrals and derivatives [25]) For 휌 ∈ [0, 1), the Riesz fractional integral of order 휌 is defined as 1 퐼휌푣(푥) := (퐼휌 + 퐼휌)푣(푥), 푥 ∈ Λ. (2.8) 2 cos(휋휌/2) 푥 푥 For 휌 ∈ [2푘 − 1, 2푘) with 푘 ∈ N, the Riesz fractional derivative (RFD) of order 휌 is defined by: 퐷휌푣(푥) := 퐷2푘퐼2푘−휌푣(푥). (2.9) spectral methods for FDEs 5

The following results [8, 17] play fundamental roles in the analysis of FDEs.

Lemma 2.2. For all 0 < 훼 < 2 and 훼 ̸= 1, we have

푅 훼 푅 훼 푅 훼 훼/2 ( 퐷 푣, 푤) = (︀ 퐷 2 푣, 퐷 2 푤)︀ , ∀푣, 푤 ∈ 퐻 (Λ); (2.10) 푡 Λ 푡 푡 Λ 0

Lemma 2.3. For all 훼 > 0 and that 훼 − 1/2 is not an integer, we have

훼 훼 훼/2 (︀푅 2 푅 2 )︀ ∼ 2 퐷푡 푣, 푡 퐷 푣 = ‖푣‖ 훼/2 , ∀푣 ∈ 퐻0 (Λ). (2.11) Λ 퐻0 (Λ) In the sequel, we use 푐 to denote a generic constant.

2.2 GJFs for one-sided fractional derivatives

We start by considering the one-sided fractional derivatives. Unless otherwise specified, we set Λ = (−1, 1).

2.2.1 Jacobi polynomials and Bateman’s fractional integral formula

According to [30, (4.21.2)], the classical Jacobi polynomials with parameters 훼, 훽 ∈ R can be defined by (훼 + 1) (︁ 1 − 푥 )︁ 푃 (훼,훽)(푥) = 푛 퐹 − 푛, 푛 + 훼 + 훽 + 1; 훼 + 1; (2.12) 푛 푛! 2 1 2 where 2퐹1(푎, 푏; 푐; 푥) is the hypergeometric function, and the rising factorial in the Pochhammer symbol, for 푎 ∈ R and 푗 ∈ N0, is defined by Γ(푎 + 푗) (푎) = 1; (푎) := 푎(푎 + 1) ··· (푎 + 푗 − 1) = , for 푗 ≥ 1. (2.13) 0 푗 Γ(푎)

For 훼, 훽 > −1, the classical Jacobi polynomials are orthogonal with respect to the Jacobi weight function: 휔(훼,훽)(푥) = (1 − 푥)훼(1 + 푥)훽, namely,

1 ∫︁ (훼,훽) (훼,훽) (훼,훽) (훼,훽) 푃푛 (푥)푃푛′ (푥)휔 (푥)푑푥 = 훾푛 훿푛푛′ , (2.14) −1 where 훿푛푛′ is the Dirac Delta symbol, and the normalization constant is given by

2훼+훽+1Γ(푛 + 훼 + 1)Γ(푛 + 훽 + 1) 훾(훼,훽) = . (2.15) 푛 (2푛 + 훼 + 훽 + 1)푛!Γ(푛 + 훼 + 훽 + 1) 6 J. Shen and C. Sheng

The following fractional integral formula of hypergeometric functions due to Bateman [3] (also see [2, P. 313]) plays an important role in the computation of fractional integrals/derivatives: for real 푐, 휌 ≥ 0,

푥 Γ(푐 + 휌) ∫︁ 퐹 (푎, 푏; 푐 + 휌; 푥) = 푥1−(푐+휌) 푡푐−1(푥 − 푡)휌−1 퐹 (푎, 푏; 푐; 푡) 푑푡, |푥| < 1. 2 1 Γ(푐)Γ(휌) 2 1 0 (2.16) One derives easily from (2.12) and (2.16) the following results (cf. [30, P. 96]):

+ Lemma 2.4. Let 휌 ∈ R , 푛 ∈ N0 and 푥 ∈ Λ. (i) For 훼 > −1 and 훽 ∈ R,

1 (훼+휌,훽−휌) ∫︁ 훼 (훼,훽) 훼+휌 푃푛 (푥) Γ(훼 + 휌 + 1) (1 − 푦) 푃푛 (푦) (1 − 푥) = 1−휌 푑푦. 푃 (훼+휌,훽−휌)(1) Γ(훼 + 1)Γ(휌) (푦 − 푥) 푃 (훼,훽)(1) 푛 푥 푛 (2.17) (ii) For 훼 ∈ R and 훽 > −1, 푥 푃 (훼−휌,훽+휌)(푥) Γ(훽 + 휌 + 1) ∫︁ (1 + 푦)훽 푃 (훼,훽)(푦) (1 + 푥)훽+휌 푛 = 푛 푑푦. (훽+휌,훼−휌) Γ(훽 + 1)Γ(휌) (푥 − 푦)1−휌 (훽,훼) 푃푛 (1) 푃푛 (1) −1 (2.18)

Using the notation in Definition 2.1, we can rewrite the formulas in Lemma 2.4as follows.

+ Lemma 2.5. Let 휌 ∈ R , 푛 ∈ N0 and 푥 ∈ Λ. – For 훼 > −1 and 훽 ∈ R, Γ(푛 + 훼 + 1) 퐼휌{︀(1 − 푥)훼푃 (훼,훽)(푥)}︀ = (1 − 푥)훼+휌푃 (훼+휌,훽−휌)(푥). 푥 푛 Γ(푛 + 훼 + 휌 + 1) 푛 (2.19) – For 훼 ∈ R and 훽 > −1, Γ(푛 + 훽 + 1) 퐼휌{︀(1 + 푥)훽푃 (훼,훽)(푥)}︀ = (1 + 푥)훽+휌푃 (훼−휌,훽+휌)(푥). (2.20) 푥 푛 Γ(푛 + 훽 + 휌 + 1) 푛

Thanks to (2.6), we obtain from Lemma 2.5 the following useful “inverse” rules.

+ Lemma 2.6. Let 푠 ∈ R , 푛 ∈ N0 and 푥 ∈ Λ. – For 훼 > −1 and 훽 ∈ R, Γ(푛 + 훼 + 푠 + 1) 푅퐷푠{︀(1 − 푥)훼+푠푃 (훼+푠,훽−푠)(푥)}︀ = (1 − 푥)훼푃 (훼,훽)(푥). 푥 푛 Γ(푛 + 훼 + 1) 푛 (2.21) spectral methods for FDEs 7

– For 훼 ∈ R and 훽 > −1, Γ(푛 + 훽 + 푠 + 1) 푅퐷푠{︀(1 + 푥)훽+푠푃 (훼−푠,훽+푠)(푥)}︀ = (1 + 푥)훽푃 (훼,훽)(푥). 푥 푛 Γ(푛 + 훽 + 1) 푛 (2.22)

The above lemmas are remarkable in the sense that fractional integrals/derivatives 훼 (훼,훽) of functions in the form of (1 ± 푥) 푃푛 can be expressed in the same form with a set of different parameters (훼, 훽). In other words, the global fractional integral/derivative operators become local operators in suitable "spectral" spaces. 푅 푠 In particular, if 훼 = 0 in (2.21), the fractional derivative operator 푥퐷 takes 푠 (푠,훽−푠) (0,훽) (1 − 푥) 푃푛 (푥) to the polynomial 푃푛 (푥); conversely, if 훼 + 푠 = 푘 ∈ N0, 푅 푠 푘 (푘,훽−푠) 푘−푠 (푘−푠,훽) 푥퐷 takes the polynomial (1 − 푥) 푃푛 (푥) to (1 − 푥) 푃푛 (푥). Such remarkable properties are essential for constructing efficient spectral algorithms for FDEs.

Definition 2.3 (One-sided generalized Jacobi functions [5]). Define

+ (−훼,훽) 훼 (훼,훽) 퐽푛 (푥) := (1 − 푥) 푃푛 (푥), for 훼 > −1, 훽 ∈ R, (2.23) and − (훼,−훽) 훽 (훼,훽) 퐽푛 (푥) := (1 + 푥) 푃푛 (푥), for 훼 ∈ R, 훽 > −1, (2.24)

for all 푥 ∈ Λ and 푛 ∈ N0.

2.2.2 Some important properties of GJFs

It follows straightforwardly from (2.14) and Definition 2.3 that for 훼, 훽 > −1,

1 ∫︁ + (−훼,훽) + (−훼,훽) (−훼,훽) 퐽푛 (푥) 퐽푛′ (푥) 휔 (푥) 푑푥 −1 (2.25) 1 ∫︁ − (훼,−훽) − (훼,−훽) (훼,−훽) (훼,훽) = 퐽푛 (푥) 퐽푛′ (푥) 휔 (푥) 푑푥 = 훾푛 훿푛푛′ , −1 ′ Similarly, we have that for 훼 > −1 and 푘 ∈ N, and 푛, 푛 ≥ 푘,, 1 ∫︁ + (−훼,−푘) + (−훼,−푘) (−훼,−푘) 퐽푛 (푥) 퐽푛′ (푥) 휔 (푥) 푑푥 −1 (2.26) 1 ∫︁ − (−푘,−훼) − (−푘,−훼) (−푘,−훼) (훼,−푘) = 퐽푛 (푥) 퐽푛′ (푥) 휔 (푥) 푑푥 = 훾푛 훿푛푛′ , −1 8 J. Shen and C. Sheng

(훼,훽) (훼,−푘) where 훾푛 and 훾푛 are some constants which can be found in [5]. With the above definitions, we can rewrite Lemma 2.6 as

+ Theorem 2.1. Let 푠 ∈ R , 푛 ∈ N0 and 푥 ∈ Λ. – For 훼 > 푠 − 1 and 훽 ∈ R, Γ(푛 + 훼 + 1) 푅퐷푠{︀+퐽(−훼,훽)(푥)}︀ = +퐽(−훼+푠,훽+푠)(푥). (2.27) 푥 푛 Γ(푛 + 훼 − 푠 + 1) 푛

– For 훼 ∈ R and 훽 > 푠 − 1, Γ(푛 + 훽 + 1) 푅퐷푠{︀−퐽(훼,−훽)(푥)}︀ = −퐽(훼+푠,−훽+푠)(푥). (2.28) 푥 푛 Γ(푛 + 훽 − 푠 + 1) 푛

The analysis of GJFs essentially relies on the of fractional derivatives of GJFs. Recall the derivative formula of the classical Jacobi polynomials (see, e.g., [29, P. 72]): for 훼, 훽 > −1 and 푛 ≥ 푙,

푙 (훼,훽) (훼,훽) (훼+푙,훽+푙) 퐷 푃푛 (푥) = 휅푛,푙 푃푛−푙 (푥), (2.29)

(훼,훽) 푅 푠+푙 푙 푙푅 푠 푅 푠+푙 where 휅푛,푙 is some constant. Noting that 푥퐷 = (−1) 퐷 푥퐷 and 퐷푥 = 푙푅 푠 + 퐷 퐷푥 for 푠 ∈ R and 푙 ∈ N, we derive from (2.14) and (2.27)-(2.29) the following orthogonality relations: – For 훼 > 0, 훼 + 훽 > −1, and 푛, 푛′ ≥ 푙 ≥ 0,

1 ∫︁ 푅 훼+푙 + (−훼,훽) 푅 훼+푙 + (−훼,훽) (푙,훼+훽+푙) (훼,훽) 푥퐷 퐽푛 (푥) 푥퐷 퐽푛′ (푥) 휔 (푥) 푑푥 = ℎ푛,푙 훿푛푛′ , −1 (2.30) where 2훼+훽+1Γ2(푛 + 훼 + 1)Γ(푛 + 훼 + 훽 + 푙 + 1) ℎ훼,훽 := . (2.31) 푛,푙 (2푛 + 훼 + 훽 + 1)푛!(푛 − 푙)!Γ(푛 + 훼 + 훽 + 1) – For 훼 + 훽 > −1, 훽 > 0, and 푛, 푛′ ≥ 푙 ≥ 0,

1 ∫︁ 푅 훽+푙 − (훼,−훽) 푅 훽+푙 − (훼,−훽) (훼+훽+푙,푙) (훽,훼) 퐷푥 퐽푛 (푥) 퐷푥 퐽푛′ (푥) 휔 (푥) 푑푥 = ℎ푛,푙 훿푛푛′ . −1 (2.32)

2.2.3 Approximation by the one-sided GJFs

We show below that approximation by GJFs can lead to truly spectral convergence for functions in properly weighted Sobolev spaces involving fractional derivatives. spectral methods for FDEs 9

{︀− (훼,−훽)}︀ For simplicity of presentation, we only provide the results 퐽푛 . Similar {︀+ (−훼,훽)}︀ results can be established for 퐽푛 [5]. Let 풫푁 be the set of all algebraic (real-valued) polynomials of degree at most 2 푁. Let 휛(푥) > 0, 푥 ∈ Λ, be a generic weight function. The weighted space 퐿휛(Λ) is defined as in Adams [1] with the inner product and norm ∫︁ 1/2 (푢, 푣)휛 = 푢(푥)푣(푥)휛(푥)푑푥, ‖푢‖휛 = (푢, 푢)휛 . Λ If 휛 ≡ 1, we omit the weight function in the notation. We define the finite-dimensional fractional-polynomial space:

− (훼,−훽) 훽 − (훼,−훽) ℱ푁 (Λ) = {휑 = (1 + 푥) 휓 : 휓 ∈ 풫푁 } = span{ 퐽푛 : 0 ≤ 푛 ≤ 푁}, 2 By the orthogonality (2.25), we can expand any 푢 ∈ 퐿휔(훼,−훽) as ∞ ∑︁ (훼,−훽)− (훼,−훽) 푢(푥) = 푢^푛 퐽푛 (푥), (2.33) 푛=0 where 1 1 ∫︁ 푢^(훼,−훽) = 푢−퐽(훼,−훽)휔(훼,−훽)푑푥, 푛 (훼,훽) 푛 훾푛 −1 and there holds the Parseval identity: ∞ 2 ∑︁ (훼,훽) (훼,−훽) 2 ‖푢‖휔(훼,−훽) = 훾푛 |푢^푛 | . (2.34) 푛=0

2 − (훼,−훽) Consider the 퐿휔(훼,−훽) -orthogonal projection onto ℱ푁 (Λ):

(︁− (훼,−훽) )︁ − (훼,−훽) 휋푁 푢 − 푢, 푣푁 = 0, ∀푣푁 ∈ ℱ푁 (Λ). (2.35) 휔(훼,−훽)

Then, it is easy to derive from (2.28) that for any 푙 ∈ N0, we have

(︁푅 훽+푙 − (훼,−훽) 푙 )︁ 퐷푥 ( 휋푁 푢 − 푢), 퐷 푤푁 = 0, ∀푤푁 ∈ 풫푁 (Λ). (2.36) 휔(훼+훽+푙,푙) To describe the projection error, we define

− 푚 {︀ 2 푅 훽+푙 2 }︀ ℬ훼,훽(Λ) := 푢 ∈ 퐿휔(훼,−훽) (Λ) : 퐷푥 푢 ∈ 퐿휔(훼+훽+푙,푙) (Λ) for 0 ≤ 푙 ≤ 푚 . (2.37) By (2.32) and (2.33), we have that for (훼, 훽) ∈ −Σ훼,훽 := {︀(훼, 훽): 훽 > 0, 훼 > }︀ −1 and 푙 ∈ N0 ∞ 푅 훽+푙 2 ∑︁ (훽,훼) (훼,−훽) 2 ‖ 퐷푥 푢‖휔(훼+훽+푙,푙) = ℎ푛,푙 |푢^푛 | . (2.38) 푛=푙 10 J. Shen and C. Sheng

− 훼,훽 − 푚 Theorem 2.2. Let (훼, 훽) ∈ Σ , and 푢 ∈ ℬ훼,훽(Λ). – For 0 ≤ 푙 ≤ 푚, we have

⃦푅퐷훽+푙(−휋(훼,−훽)푢 − 푢)⃦ ≤ 푐푁 푙−푚 ⃦푅퐷훽+푚푢⃦ . ⃦ 푥 푁 ⃦휔(훼+훽+푙,푙) ⃦ 푥 ⃦휔(훼+훽+푚,푚) (2.39) 2 – For 0 ≤ 푚, we also have the 퐿휔(훼,−훽) -estimate: ⃦−휋(훼,−훽)푢 − 푢⃦ ≤ 푐푁 −(훽+푚)⃦푅퐷훽+푚푢⃦ . (2.40) ⃦ 푁 ⃦휔(훼,−훽) ⃦ 푥 ⃦휔(훼+훽+푚,푚)

Proof. By (2.33), (2.35) and (2.38), we have ∞ (훼,−훽) 2 ∑︁ (훽,훼) (훼,−훽) ⃦푅퐷훽+푙(−휋 푢 − 푢)⃦ = ℎ |푢^ |2 ⃦ 푥 푁 ⃦휔(훼+훽+푙,푙) 푛,푙 푛 푛=푁+1 (2.41) ∞ (훽,훼) (훽,훼) ∑︁ ℎ푛,푙 (훽,훼) (훼,−훽) ℎ푁+1,푙 2 = ℎ |푢^ |2 ≤ ⃦푅퐷훽+푚푢⃦ . (훽,훼) 푛,푚 푛 (훽,훼) ⃦ 푥 ⃦휔(훼+훽+푚,푚) 푛=푁+1 ℎ푛,푚 ℎ푁+1,푚 We now estimate the constant factor. By (2.13), (2.31) and a direct calculation, we find that for 0 ≤ 푙 ≤ 푚 ≤ 푁, (훽,훼) ℎ Γ(푁 + 훼 + 훽 + 푙 + 2)(푁 − 푚 + 1)! 푁+1,푙 = (훽,훼) Γ(푁 + 훼 + 훽 + 푚 + 2)(푁 − 푙 + 1)! ℎ푁+1,푚 1 (푁 − 푚 + 1)! (2.42) = (푁 + 훼 + 훽 + 2 + 푙) ··· (푁 + 훼 + 훽 + 1 + 푚) (푁 − 푙 + 1)! (푁 − 푚 + 1)! ≤ 푁 푙−푚 , (푁 − 푙 + 1)! where we used the fact: 훼 + 훽 > −1. Thus, we obtain (2.39) from (2.41), (2.42) and the property of the Gamma function. 2 The 퐿휔(훼,−훽) -estimates can be obtained by using the same argument. We sketch the derivation below. By (2.34) and (2.38), ∞ (훼,−훽) 2 ∑︁ (훼,훽) (훼,−훽) ⃦−휋 푢 − 푢⃦ = 훾 |푢^ |2 ⃦ 푁 ⃦휔(훼,−훽) 푛 푛 푛=푁+1 (2.43) ∞ (훼,훽) (훼,훽) ∑︁ 훾 (훽,훼) (훼,−훽) 훾 2 = 푛 ℎ |푢^ |2 ≤ 푁+1 ⃦푅퐷훽+푚푢⃦ . (훽,훼) 푛,푚 푛 (훽,훼) ⃦ 푥 ⃦휔(훼+훽+푚,푚) 푛=푁+1 ℎ푛,푚 ℎ푁+1,푚 Working out the constants by (2.15) and (2.31), we use the property of the Gamma function again to get that (훼,훽) 훾 Γ(푁 + 훼 + 2)Γ(푁 + 푚 + 2)(푁 − 푚 + 1)! 푁+1 = ≤ 푐푁 −2(훽+푚). (훽,훼) Γ(푁 + 훽 + 2)Γ(푁 + 훼 + 훽 + 푚 + 2)(푁 + 푚 + 1)! ℎ푁+1,푚 (2.44) spectral methods for FDEs 11

Remark 2.1. Note that the error estimates, in the above theorem and in subse- quent theorems, depend on the smoothness of fractional derivatives of the function, instead of the usual smoothness. To better understand the above results, we consider a typical solution of a one-sided fractional

훽 + 푢(푥) = (1 − 푥) 푔(푥), 훽 ∈ R , 푥 ∈ Λ, (2.45) where 푔 is a smooth function, and compare the GJF approximation with the Legendre approximation. Recall the best 퐿2-approximation of 푢 by its orthogonal 퐿 projection 휋푁 푢 (see, e.g., [29, Ch. 3]): 퐿 1−푚 푚 ‖휋푁 푢 − 푢‖ ≤ 푐푁 ‖퐷 푢‖휔(푚,푚) .

If 훽 is not an integer, a direct calculation shows that the righthand side is only bounded for 푚 < 1 + 2훽 − 휖. On the other hand, using the explicit formulas for fractional integral/derivative of (1 + 푥)훽 and the Leibniz’ formula (see [7, Ch. 2]), 푅 훽+푚 we find that 퐷푥 푢 is integrable for any 푚 ∈ N0, so the convergence by GJF approximation is faster than any algebraic rate.

Remark 2.2. The results in Theorem 2.2 can be extended to some other (훼, 훽) ∈/ −Σ훼,훽, we refer to [5] for more detail.

2.3 GJFs for Riesz derivatives

The Riesz derivatives include both the left- and right-sided fractional derivatives so the one-sided GJFs defined above are not suitable. Instead, we define a newclass of GJFs: −휇,−휈 휇 휈 (휇,휈) 풥푛 (푥) = (1 − 푥) (1 + 푥) 푃푛 (푥), 휇, 휈 > −1. (2.46) −휇,−휈 It can be derived from (2.14) that the general Jacobi functions 풥푛 (푥) are mutually orthogonal:

1 ∫︁ −휇,−휈 −휇,−휈 (−휇,−휈) (휇,휈) 풥푛 (푥)풥푚 (푥)휔 (푥) = 훾푛 훿푚푛, (2.47) −1 and −휇,−휈 {︀ −휇,−휈 }︀ F푁 (Λ) := 풥푛 (푥): 푛 = 0, 1, ··· , 푁 . (2.48) −훼,−훼 For Riesz derivatives, we shall use 풥푛 (푥) which satisfied the following:

Theorem 2.3. If 푠 ∈ (2푘 − 1, 2푘) with 푘 ∈ N, then

− 푠 ,− 푠 Γ(푚 + 푠 + 1 − 2푘) ( 푠 −2푘, 푠 −2푘) 퐼2푘−푠풥 2 2 (푥) = (−1)푘 푃 2 2 (푥), (2.49) 푚 2−2푘푚! 푚+2푘 12 J. Shen and C. Sheng and for 푗 = 0, 1, ··· , 2푘 − 1,

− 푠 ,− 푠 Γ(푚 − 푗 + 1 + 푠) ( 푠 −푗, 푠 −푗) 퐷푠−푗풥 2 2 (푥) = 2푗(−1)푘 푃 2 2 (푥). (2.50) 푚 푚! 푚+푗 We point out in particular that with 푗 = 0 in (2.50), we have

Corollary 2.1. If 푠 ∈ (2푘 − 1, 2푘) with 푘 ∈ N, then

− 푠 ,− 푠 Γ(푚 + 1 + 푠) ( 푠 , 푠 ) 퐷푠풥 2 2 (푥) = (−1)푘 푃 2 2 (푥). (2.51) 푚 푚! 푚

Let 푠 ∈ (2푘 − 1, 2푘) with 푘 ∈ N, and 푙 ∈ N0, we denote for any 푚 ∈ N0 푚 2 푠−푘+푙 2 ℬ푠 (Λ) := {푢 ∈ 퐿 (− 푠 ,− 푠 ) (Λ) : 퐷 푢 ∈ 퐿 ( 푠 −푘+푙, 푠 −푘+푙) (Λ), for 0 ≤ 푙 ≤ 푚}. 휔 2 2 휔 2 2 (2.52) 2 By the orthogonality (2.47), we can expand any 푢 ∈ 퐿휔(−훼,−훼) (Λ) as ∞ ∑︁ (−훼,−훼) −훼,−훼 푢(푥) = 푢^푛 풥푛 (푥), (2.53) 푛=0 and there holds the Parseval identity: ∞ 2 ∑︁ (훼,훼) (−훼,−훼) 2 ‖푢‖휔(−훼,−훼) = 훾푛 |푢^푛 | . (2.54) 푛=0 Moreover, for any 2훼 ∈ (2푘 − 1, 2푘) with 푘 ∈ N, we have ∞ 2훼−푘+푙 2 ∑︁ (훼,훼) (−훼,−훼) 2 ‖퐷 푢‖휔(훼−푘+푙,훼−푘+푙) = ℎ푛,푙 |푢^푛 | . (2.55) 푛=푙

푚 Theorem 2.4. Assume 2훼 ∈ (2푘 − 1, 2푘) and 푘 ∈ N. Let 푢 ∈ ℬ2훼(Λ). We have 2훼−푘+푙 (−훼,−훼) 푙−푚 2훼−푘+푚 ‖퐷 (휋푁 푢−푢)‖휔(훼−푘+푙,훼−푘+푙) ≤ 푐푁 ‖퐷 푢‖휔(훼−푘+푚,훼−푘+푚) , (2.56) and

(−훼,−훼) 푘−(2훼+푚) 2훼−푘+푚 ‖휋푁 푢 − 푢‖휔(−훼,−훼) ≤ 푐푁 ‖퐷 푢‖휔(훼−푘+푚,훼−푘+푚) . (2.57)

Proof. By (2.68) (with 휇 = 휈 = 훼) and (2.55), we have

∞ (−훼,−훼) 2 ∑︁ (훼,훼) (−훼,−훼) ⃦퐷2훼−푘+푙(휋 푢 − 푢)⃦ = ℎ |푢^ |2 ⃦ 푁 ⃦휔(훼−푘+푙,훼−푘+푙) 푛,푙 푛 푛=푁+1 ∞ (훼,훼) (훼,훼) ∑︁ ℎ푛,푙 (훼,훼) (−훼,−훼) ℎ푁+1,푙 = ℎ |푢^ |2 ≤ ⃦퐷2훼−푘+푚푢⃦ . (훼,훼) 푛,푚 푛 (훼,훼) ⃦ ⃦휔(훼−푘+푚,훼−푘+푚) 푛=푁+1 ℎ푛,푚 ℎ푁+1,푚 (2.58) spectral methods for FDEs 13

We now estimate the constant factor. Similar to the proof in Theorem 2.2, we find that for 0 ≤ 푙 ≤ 푚 ≤ 푁,

(훼,훼) ℎ (푁 + 푘 − 푚 + 1)! 푁+1,푙 ≤ 푁 푙−푚 . (2.59) (훼,훼) (푁 + 푘 − 푙 + 1)! ℎ푁+1,푚 Thus, we obtain (2.56) from (2.58), (2.59) and the property of the Gamma function. 2 The 퐿휔(−훼,−훼) -estimates can be obtained by using the same argument. We sketch the derivation below. By (2.54) and (2.55),

∞ (−훼,−훼) 2 ∑︁ (훼,훼) (−훼,−훼) ⃦휋 푢 − 푢⃦ = 훾 |푢^ |2 ⃦ 푁 ⃦휔(−훼,−훼) 푛 푛 푛=푁+1 ∞ (훼,훼) (훼,훼) ∑︁ 훾 (훼,훼) (훼,훼) 훾 = 푛 ℎ |푢^ |2 ≤ 푁+1 ⃦퐷2훼−푘+푚푢⃦ . (훼,훼) 푛,푚 푛 (훼,훼) ⃦ ⃦휔(훼−푘+푚,훼−푘+푚) 푛=푁+1 ℎ푛,푚 ℎ푁+1,푚 Similarly, by (2.15) and (2.31), we obtain that

(훼,훼) 훾 (푁 + 1)!(푁 + 푘 + 푚 + 1)!(푁 + 푘 − 푚 + 1)! 푁+1 = (훼,훼) Γ(푁 + 2훼 + 2)Γ(푁 + 2훼 − 푘 + 푚 + 2)(푁 + 푘 + 푚 + 1)! ℎ푁+1,푚 ≤ 푁 2푘−(4훼+2푚).

This completes the proof.

2.4 GJFs for two-sided fractional derivatives with different coefficients

For 1 < 훽 < 2, 0 < 휇, 휈 < 훽, 휇 + 휈 = 훽, 0 ≤ 푝 ≤ 1 and 푝 ̸= 1/2, we define the two-sided fractional integral operator

휇,휈,휌 휌 휌 ℐ푝 := 퐶훽,푝(푝퐼푥 + (1 − 푝)푥퐼 ), (2.60) where sin(휋휇) + sin(휋휈) 퐶 := 퐶(훽, 휇, 휈) = . 훽,푝 sin(휋훽) Then for 푠 ∈ (푘 − 1, 푘), we define the two-sided fractional derivative operator

푑푘 풟휇,휈,푠 := ℐ휇,휈,푘−푠. (2.61) 푝 푑푥푘 푝 It turns out that suitable basis functions for dealing with two-sided FDEs with −휇,−휈 different coefficients are of the form 풥푛 (푥) where (휇, 휈) are determined as follows ([9, 22]): 14 J. Shen and C. Sheng

Theorem 2.5. Given (푝, 훽) such that 0 ≤ 푝 ≤ 1 and 1 < 훽 < 2, let (휇, 휈) be determined from

휇 + 휈 = 훽, 푝 sin(휋휇) = (1 − 푝) sin(휋휈), (2.62) then for 푛 = 0, 1, 2, ··· , it holds that

Γ(푛 + 훽 − 1) ℐ휇,휈,2−훽풥 −휇,−휈 (푥) = 4 푃 (휈−2,휇−2)(푥), (2.63) 푝 푛 푛! 푛+2 and for 푘 = 1, 2, ··· , 푛 + 2,

Γ(푛 + 푘 + 훽 − 1) 풟휇,휈,푘+훽−2풥 −휇,−휈 (푥) = 푃 (휈−2+푘,휇−2+푘)(푥). (2.64) 푝 푛 2푘−2푛! 푛+2−푘 In particular, for 푘 = 2,

Γ(푛 + 훽 + 1) 풟휇,휈,훽풥 −휇,−휈 (푥) = 푃 (휈,휇)(푥). (2.65) 푝 푛 푛! 푛

휇,휈,휌 휇,휈,휌 휌 휌 For the sake of simplicity, we shall denote ℐ푝 and 풟푝 by ℐ푝 and 풟푝, respectively. By virtue of (2.14), a consequent result of equation (2.64) is the orthogonality 훽+푙 of 풟푝 for 푙 = −1, 0, 1, ··· , min{푚, 푛}. If (휇, 휈) and (푝, 훽) satisfy the conditions of Theorem 2.5, then

1 ∫︁ 훽+푙 −휇,−휈 훽+푙 −휇,−휈 (휈+푙,휇+푙) 풟푝 풥푚 (푥)풟푝 풥푛 (푥)휔 (푥)푑푥 = 0, ∀푛 ̸= 푚, (2.66) −1

1 ∫︁ 훽+푙 −휇,−휈 훽+푙 −휇,−휈 (휈+푙,휇+푙) 풟1−푝풥푚 (푥)풟1−푝풥푛 (푥)휔 (푥)푑푥 = 0, ∀푛 ̸= 푚. (2.67) −1

We define

(︁ (−휇,−휈) )︁ −휇,−휈 휋푁 푢 − 푢, 푣푁 = 0, ∀푣푁 ∈ F푁 (Λ), (2.68) 휔(−휇,−휈) and for 휇, 휈 satisfying (2.62), we denote

˜푚 2 훽+푙 2 ℬ훽,푝(Λ) := {푢 ∈ 퐿휔(−휇,−휈) (Λ) : 풟푝 푢 ∈ 퐿휔(휈+푙,휇+푙) (Λ), for − 1 ≤ 푙 ≤ 푚}. (2.69) Then, we have the approximation results for the projection errors. spectral methods for FDEs 15

˜푚 Theorem 2.6. Assume 1 < 훽 < 2 and let 푢 ∈ ℬ훽,푝(Λ) with 푚 ∈ N. Then for a given 푝, 0 ≤ 푝 ≤ 1, if 0 < 휇, 휈 < 훽, and 휇, 휈 satisfying (2.62), we have that, for −1 ≤ 푙 ≤ 푚 ≤ 푁,

훽+푙 (−휇,−휈) 푙−푚 훽+푚 ‖풟푝 (휋푁 푢 − 푢)‖휔(휈+푙,휇+푙) ≤ 푐푁 ‖풟푝 푢‖휔(휈+푚,휇+푚) , (2.70) and

(−휇,−휈) −(훽+푚) 훽+푚 ‖휋푁 푢 − 푢‖휔(−휇,−휈) ≤ 푐푁 ‖풟푝 푢‖휔(휈+푚,휇+푚) . (2.71)

Proof. The proof is similar to that of Theorem 2.4.

3 Spectral methods for FDEs based on generalized Jacobi functions

In this section, we present spectral methods using the GJFs defined in the last section to solve several typical fractional differential equations.

3.1 Fractional differential equations with one-sided fractional derivative

We consider first a fractional initial value problem, followed by a fractional boundary value problem with one-sided fractional derivative.

3.1.1 A fractional initial value problem (FIVP)

As the first example, we consider the fractional initial value problem of order 푠 ∈ (0, 1): 퐶 푠 퐷푡 푢(푡) = 푓(푡), 푡 ∈ 퐼 := (0, 푇 ); 푢(0) = 푢0. (3.1)

For the non-homogeneous initial conditions 푢(0) = 푢0, we first decompose the solution 푢(푡) into two parts as

ℎ 푢(푡) = 푢 (푡) + 푢0, (3.2)

ℎ 퐶 푠 with 푢 (0) = 0. By definition, 퐷푡 푢0 = 0, we then derive from (2.7) that the equation (3.1) is equivalent to the following equation with Riemann-Liouville fractional derivative:

푅 푠 ℎ ℎ 퐷푡 푢 (푡) = 푓(푡), 푡 ∈ 퐼 := (0, 푇 ); 푢 (0) = 0. (3.3) 16 J. Shen and C. Sheng

ℎ − (−푠,−푠) A Petrov-Galerkin scheme for (3.3) is: find 푢푁 ∈ ℱ푁 (퐼) (defined in (2.2.3)) such that

푅 푠 ℎ ( 퐷푡 푢푁 , 푣푁 ) = (푓, 푣푁 ), ∀ 푣푁 ∈ 풫푁 (퐼). (3.4)

We expand 푓(푡) as ∞ ∑︁ 푓(푡) = 푓˜푛 푃˜푛(푡), (3.5) 푛=0 (0,0) where 푃˜푛(푡) := 푃푛 (푥(푡)), 푥(푡) = (2푡 − 푇 )/푇 is the shifted Legendre polynomial of degree 푛 on 퐼, and write

푁 ℎ ∑︁ (푠) −˜(−푠,−푠) − (−푠,−푠) 푢푁 (푡) = 푢˜푛 퐽푛 (푡) ∈ ℱ푁 (퐼). (3.6) 푛=0 ˜ Taking 푣푁 = 푃푙(푡) in (3.4), we obtain from (2.28) and the orthogonality of Legendre polynomials that 푛! 푢˜(푠) = 푓˜ , 0 ≤ 푛 ≤ 푁. (3.7) 푛 Γ(푛 + 푠 + 1) 푛 ℎ Therefore, we obtain the numerical solution 푢푁 without solving any algebraic equation. Hence, the method is very efficient. As for the error estimate, we have the following result [5]:

ℎ ℎ Theorem 3.7. Let 푢 and 푢푁 be the solution of (3.3) and (3.4), respectively. Then 푅 푠 ℎ ℎ −푚 (푚) ‖ 퐷푡 (푢 − 푢푁 )‖ ≤ 푐푁 ‖푓 ‖휔(푚−1,푚−1) . (3.8)

− (−푠,−푠) ℎ Proof. Let 휋푁 푢 be as defined in (2.35) for 0 < 푠 < 1. By (2.28), we have (︀푅 푠 − (−푠,−푠) ℎ ℎ )︀ 퐷푡 ( 휋푁 푢 − 푢 ), 휓 = 0, ∀ 휓 ∈ 풫푁 . Then by (3.3),

(︀ 푅 푠 − (−푠,−푠) ℎ )︀ (︀푅 푠 ℎ 푅 푠 − (−푠,−푠) ℎ )︀ 푓 − 퐷푡 휋푁 푢 , 휓 = 퐷푡 푢 − 퐷푡 휋푁 푢 , 휓 = 0, ∀ 휓 ∈ 풫푁 . 2 Let 휋푁 푓 be the 퐿 -orthogonal projection of 푓 upon 풫푁 . We infer from the above 푅 푠 − (−푠,−푠) ℎ 푅 푠 ℎ that 퐷푡 휋푁 푢 = 휋푁 푓 = 퐷푡 푢푁 . Therefore, 푅 푠 ℎ ℎ ⃦푅 푠 ℎ − (−푠,−푠) ℎ ⃦ ‖ 퐷푡 (푢 − 푢푁 )‖ = ⃦ 퐷푡 (푢 − 휋 푢 )⃦ 푁 (3.9) ⃦푅 푠 ℎ − (−푠,−푠) ℎ ⃦ ≤ ⃦ 퐷푡 (푢 − 휋푁 푢 )⃦ + ‖휋푁 푓 − 푓‖. It follows from Theorem 2.2 (with 훼 = −훽 = 푠 and 0 < 푠 < 1), and the Legendre approximation results (see, e.g., [29, Ch. 3]) that

푅 푠 ℎ ℎ −푚(︀ 푅 푠+푚 ℎ⃦ (푚) )︀ ‖ 퐷 (푢 − 푢 )‖ ≤ 푐푁 ‖ 퐷 푢 + ‖푓 ‖ (푚−1,푚−1) . (3.10) 푡 푁 푡 ⃦휔(푚,푚) 휔 spectral methods for FDEs 17

We deduce from (3.1) that

⃦푅퐷푠+푚푢ℎ⃦ ≤ 푐⃦푓 (푚)⃦ . ⃦ 푡 ⃦휔(푚,푚) ⃦ ⃦휔(푚−1,푚−1)

3.1.2 One sided fractional boundary value problems

Now we consider an one-sided fractional boundary value problem

푅 휈 푥퐷 푢(푥) = 푓(푥), 푥 ∈ Λ = (−1, 1); 푢(±1) = 0, (3.11) where 휈 ∈ (1, 2). Let 푠 = 휈 − 1 and introduce the solution and test function spaces:

{︀ 2 푅 푠 2 }︀ 푈 := 푢 ∈ 퐿 (−푠,−1) (Λ) : 푥퐷 푢 ∈ 퐿 (0,푠−1) (Λ) ; 휔 휔 (3.12) {︀ 2 2 }︀ 푉 := 푣 ∈ 퐿휔(−1,−푠) (Λ) : 퐷푣 ∈ 퐿휔(0,1−푠) (Λ) , equipped with the norms

(︀ 2 푅 푠 2 )︀1/2 ‖푢‖푈 = ‖푢‖휔(−푠,−1) + ‖푥퐷 푢‖휔(0,푠−1) ; (3.13) (︀ 2 2 )︀1/2 ‖푣‖푉 = ‖푣‖휔(−1,−푠) + ‖퐷푣‖휔(0,1−푠) .

For 푢 ∈ 푈 and 푣 ∈ 푉 , we write

∞ ∞ ∑︁ + (−푠,−1) 푠 ∑︁ (푠,1) 푢(푥) = 푢^푛 퐽푛 (푥) = (1 − 푥) (1 + 푥) 푢˜푛푃푛−1 (푥), 푛=1 푛=1 ∞ ∞ (3.14) ∑︁ − (−1,−푠) 푠 ∑︁ (1,푠) 푣(푥) = 푣^푛 퐽푛 (푥) = (1 − 푥)(1 + 푥) 푣˜푛푃푛−1 (푥). 푛=1 푛=1

With the above setup, we can build in the homogenous boundary conditions and also perform fractional . Hence, a weak form of (3.11) is to find 푢 ∈ 푈 such that

푅 푠 푎(푢, 푣) := (푥퐷 푢, 퐷푣) = (푓, 푣), ∀ 푣 ∈ 푉. (3.15)

+ (−푠,−1) − (−1,−푠) Let ℱ푁 (Λ) and ℱ푁 (Λ) be the finite-dimensional spaces as defined in the previous section. Then the GJF-Petrov-Galerkin scheme for (3.15) is to find + (−푠,−1) 푢푁 ∈ ℱ푁 (Λ) such that

푅 푠 − (−1,−푠) 푎(푢푁 , 푣푁 ) = (푥퐷 푢푁 , 퐷푣푁 ) = (푓, 푣푁 ), ∀ 푣푁 ∈ ℱ푁 (Λ). (3.16) 18 J. Shen and C. Sheng

푅 1 푑 We derive from (2.27) and 퐷푥 = 푑푥 that

+ (−푠,−1) − (−1,−푠) 푠 + (0,푠−1) − (0,1−푠) 푎( 퐽푛 (푥), 퐽푚 (푥)) = 퐶푛,푚( 퐽푛 (푥), 퐽푚 (푥)) = 0 ∀푛 ̸= 푚. (3.17)

Hence, we can obtain 푢푁 directly without solving any algebraic equation. To characterise the regularity of 푢, we define for any 푚 ∈ N0,

+ 푚 {︀ 2 푅 훼+푙 2 }︀ ℬ훼,훽(Λ) := 푢 ∈ 퐿휔(−훼,훽) (Λ) : 푥퐷 푢 ∈ 퐿휔(푙,훼+훽+푙) (Λ) for 0 ≤ 푙 ≤ 푚 . (3.18)

Theorem 3.8. Let 푠 ∈ (0, 1), and let 푢 and 푢푁 be the solutions of (3.15) and + 푚 (3.16), respectively. If 푢 ∈ 푈 ∩ ℬ푠,−1(Λ) with 0 ≤ 푚 ≤ 푁, then we have the error estimates: ‖푢 − 푢 ‖ ≤ 푐푁 −푚⃦푅퐷푠+푚푢⃦ . (3.19) 푁 푈 ⃦푥 ⃦휔(푚,푠−1+푚) (푚−1) 2 In particular, if 푓 ∈ 퐿휔(푚,푠−1+푚) (Λ) for 푚 ≥ 1, we have

‖푢 − 푢 ‖ ≤ 푐푁 −푚⃦푓 (푚−1)⃦ . (3.20) 푁 푈 ⃦ ⃦휔(푚,푠−1+푚)

Here, 푐 is a positive constant independent 푢, 푁 and 푚.

Proof. We derive from (3.15) and (3.16) that

− (−1,−푠) 푎(푢 − 푢푁 , 푣푁 ) = 0 ∀ 푣푁 ∈ ℱ푁 (Λ),

+ (−푠,−1) which, along with (3.17), implies immediately that 푢푁 = 휋푁 푢. Hence, the 푅 휈 푅 푠+1 desired results follow from Theorem 4.1 in [5] and the fact 푥퐷 푢 = 푥퐷 푢 = 푓.

3.2 Fractional boundary value problems with Riesz derivatives

We consider first the so called Riesz fractional differential equations, followed bya more general case with a zeroth-order term.

3.2.1 Riesz fractional differential equations

We consider the Riesz fractional equation of order 2훼 ∈ (2푘 − 1, 2푘) with 푘 ∈ N:

(−1)푘퐷2훼푢(푥) =푓(푥), 푥 ∈ Λ, (3.21) 푢(푙)(±1) =0, 푙 = 0, 1, ··· , 푘 − 1. spectral methods for FDEs 19

−훼,−훼 A Petrov-Galerkin spectral method for (3.21) is: Find 푢푁 ∈ F푁 such that

푘 2훼 (−1) (퐷 푢푁 , 푣푁 )휔(훼,훼) = (푓, 푣푁 )휔(훼,훼) , ∀푣푁 ∈ 푃푁 . (3.22)

The solution to this discrete problem can be found directly as follows. Given

∞ ∑︁ (훼,훼) 푓(푥) = 푓푚푃푚 (푥), (3.23) 푚=0 and write 푁 ∑︁ −훼,−훼 푢푁 (푥) = 푢^푛풥푛 (푥). (3.24) 푛=0 (훼,훼) Plugging the above in (3.22), using (2.51) and the orthogonality of {푃푚 } in 2 퐿휔(훼,훼) (Λ), we find (︁ Γ(푛 + 1 + 2훼) )︁ 푢^ = 푓 2 cos(휋훼) , ∀ 0 ≤ 푛 ≤ 푁. (3.25) 푛 푛 푛! As for the error estimate, we have

(푗) 2 Theorem 3.9. Assuming 푓 ∈ 퐿휔훼+푗,훼+푗 (Λ) for 0 ≤ 푗 ≤ 푚, we have

−2훼−푚 (푚) ‖푢 − 푢푁 ‖휔(−훼,−훼) ≤ 푐푁 ‖푓 ‖휔(훼+푚,훼+푚) . (3.26)

2훼 −푚 (푚) ‖퐷 (푢 − 푢푁 )‖휔(훼,훼) ≤ 푐푁 ‖푓 ‖휔(훼+푚,훼+푚) . (3.27)

(−훼,−훼) Proof. It is clear from (3.25) that 푢푁 = 휋푁 푢. Hence, by (2.57), we have

(−훼,−훼) −2훼−푚 2훼+푚 ‖푢−푢푁 ‖휔(−훼,−훼) = ‖푢−휋푁 푢‖휔(−훼,−훼) ≤ 푐푁 ‖퐷 푢‖휔(훼+푚,훼+푚) .

On the other hand, we derive from (2.56) with 푘 = 푙 = 0 that

2훼 2훼 (−훼,−훼) −푚 2훼+푚 ‖퐷 푢−푢푁 ‖휔(훼,훼) = ‖퐷 (푢−휋푁 푢)‖휔(훼,훼) ≤ 푐푁 ‖퐷 푢‖휔(훼+푚,훼+푚) .

Since 퐷2훼+푚푢 = 푓 (푚), we obtain the desired results from the above two inequalities.

3.2.2 A more general case

In the previous examples, we have developed optimal spectral methods using GJFs in the sense that (i) the numerical solution can be determined directly without solving any algebraic equation; and (ii) the error converges faster than any algebraic 20 J. Shen and C. Sheng rate as long as the righthand side function 푓 is smooth, despite the fact that the solution is weakly singular at the endpoint(s). However, it is not possible to construct such optimal spectral methods for more general FDEs. Nevertheless, using proper GJFs still allows us to (i) deal with fractional derivatives efficiently, and (ii) resolve the leading singular term inthe solution. Consider for example

휌푢(푥) − 퐷2훼푢(푥) = 푓, 푥 ∈ Λ = (−1, 1), (3.28) 푢(±1) = 0, where 휌 > 0 and 2훼 ∈ (1, 2). A GJF spectral Galerkin approximation to (3.28) is: −훼,−훼 find 푢푁 ∈ F푁 (Λ) such that 2훼 −훼,−훼 푎(푢푁 , 푣푁 ) := 휌(푢푁 , 푣푁 ) − (퐷 푢푁 , 푣푁 ) = (푓, 푣푁 ), ∀푣푁 ∈ F푁 (Λ). (3.29) Setting 푁 ∑︁ −훼,−훼 푢푁 (푥) = 푢˜푛풥푛 (푥). (3.30) 푛=0 Setting

푁 ∑︁ −훼,−훼 푢푁 (푥) = 푢˜푛풥푛 (푥), 푈 = (˜푢0, 푢˜1, ··· , 푢˜푁 ), 푛=0 −훼,−훼 −훼,−훼 2훼 −훼,−훼 −훼,−훼 푚푗푘 = (풥푘 (푥), 풥푗 (푥)), 푠푗푘 = −(퐷 풥푘 (푥), 풥푗 (푥)), ˜ −훼,−훼 ˜ ˜ ˜ 푇 푀 = (푚푗푘), 푆 = (푠푗푘), 푓푗 = (푓, 풥푗 (푥)), 퐹 = (푓0, 푓1, ··· , 푓푁 ) . (3.31) Then, (3.29) reduces to the following matrix system:

(휌푀 + 푆)푈 = 퐹.

We recall from (2.50), (2.14) that 푆 is a diagonal matrix

22훼+1Γ(푘 + 훼 + 1)2 푠 = 훿 . (3.32) 푗푘 (푘!)2(2푘 + 2훼 + 1) 푗푘 The mass matrix 푀 is full but its entries can be evaluated exactly (cf. [4]):

1 ∫︁ 2 훼 (훼,훼) 2 훼 (훼,훼) 푚푗푘 = (1 − 푥 ) 푃푗 (푥)(1 − 푥 ) 푃푘 (푥)푑푥 −1 푗−푘 √ (−푗 − 훼) 푗+푘 (−푘 − 훼) 푗+푘 (−1) 2 (푗 + 푘)! 휋Γ(2훼 + 1) = 2 2 , (3.33) 2푗+푘푗!푘! 3 푗+푘 Γ(2훼 + 3 ) (2훼 + 2 ) 푗+푘 2 ! 2 2 Γ(푎+휈) where the Pochhammer symbol (푎)휈 = Γ(푎) . spectral methods for FDEs 21

2 2훼 2 Lemma 3.7. For all 푢 ∈ {푢 ∈ 퐿휔−훼,−훼 (Λ) : 퐷 푢 ∈ 퐿 (Λ)}, we have 2 2훼 ‖푢‖휔(−훼,−훼) ≤ −(퐷 푢, 푢). (3.34)

∑︀∞ −훼,−훼 Proof. We write 푢 = 푖=0 푢˜푖풥푖 (푥), so that ∞ 2 ∑︁ 2 (훼,훼) ‖푢‖휔(−훼,−훼) = 푢˜푖 훾푖 . 푖=0 By Theorem 2.3 and (2.14), we have

∞ ∞ 2훼 ∑︁ 2훼 −훼,−훼 ∑︁ −훼,−훼 −(퐷 푢, 푢) = (− 푢˜푖퐷 풥푖 , 푢˜푗풥푗 ) 푖=0 푗=0 ∞ ∞ ∑︁ Γ(푖 + 2훼 + 1) (훼,훼) ∑︁ (훼,훼) = ( 푢˜ 푃 , 푢˜ 푃 ) (훼,훼) 푖 푖! 푖 푗 푗 휔 푖=0 푗=0 ∞ ∑︁ Γ(푖 + 2훼 + 1) (훼,훼) = 푢˜2훾 . 푖! 푖 푖 푖=0 We can easily to get the desired result (3.34) by comparing the above results.

We define the energy norm associated with (3.28) by

2 2훼 ‖푢‖퐵훼 = 휌(푢, 푢) − (퐷 푢, 푢). (3.35)

Theorem 3.10. Assume 2훼 ∈ (1, 2). Let 푢 and 푢푁 be the solution of (3.28) and (3.29), then we have

1−푚 2훼−1+푚 ‖푢 − 푢푁 ‖퐵훼 ≤ 푁 ‖퐷 푢‖휔(훼−1+푚,훼−1+푚) . (3.36)

(−훼,−훼) Proof. Let us denote 푢̃︀푁 := 휋푁 푢 and 푒푁 := 푢̃︀푁 − 푢푁 . We derive from (3.28) and (3.29) that

2훼 푎(푒푁 , 푣푁 ) = 휌(푒푁 , 푣푁 ) − (퐷 푒푁 , 푣푁 ) 2훼 −훼,−훼 = 휌(푢̃︀푁 − 푢, 푣푁 ) − (퐷 (푢̃︀푁 − 푢), 푣푁 ), ∀푣 ∈ F푁 (Λ).

Taking 푣푁 = 푒푁 in the above, we derive from (3.35) and Cauchy-Schwarz inequality that

2 2훼 (−훼,−훼) ‖푒푁 ‖퐵훼 := 휌(푒푁 , 푒푁 ) − (퐷 푒푁 , 푒푁 ) ≤ 휌‖휋푁 푢 − 푢‖휔(훼,훼) ‖푒푁 ‖휔(−훼,−훼) 2훼 (−훼,−훼) + ‖퐷 (휋푁 푢 − 푢)‖휔(훼,훼) ‖푒푁 ‖휔(−훼,−훼) . The above and Lemma 3.7 lead to

(−훼,−훼) 2훼 (−훼,−훼) ‖푒푁 ‖퐵훼 ≤ 휌‖휋푁 푢 − 푢‖휔(−훼,−훼) + ‖퐷 (휋푁 푢 − 푢)‖휔(훼,훼) . 22 J. Shen and C. Sheng

Then, by Theorem 2.4, the right hand side terms of (3.39) can be estimate as

(−훼,−훼) 1−(2훼+푚) 2훼−1+푚 ‖휋푁 푢 − 푢‖휔(−훼,−훼) ≤ 푐푁 ‖퐷 푢‖휔(훼−1+푚,훼−1+푚) , (3.37)

and

2훼 (−훼,−훼) 1−푚 2훼−1+푚 ‖퐷 (휋푁 푢 − 푢)‖휔(훼,훼) ≤ 푐푁 ‖퐷 푢‖휔(훼−1+푚,훼−1+푚) , (3.38)

which implied that

1−푚 2훼−1+푚 ‖푒푁 ‖퐵훼 ≤ 푐푁 ‖퐷 푢‖휔(훼−1+푚,훼−1+푚) . (3.39)

On the other hand,

2훼 (−훼,−훼) (−훼,−훼) − (퐷 (푢 − 휋푁 푢), 푢 − 휋푁 푢) 2훼 (−훼,−훼) (−훼,−훼) ≤ ‖퐷 (휋푁 푢 − 푢)‖휔(훼,훼) ‖푢 − 휋푁 푢‖휔(−훼,−훼) . Since

(−훼,−훼) (−훼,−훼) ‖푢 − 휋푁 푢‖ ≤ ‖푢 − 휋푁 푢‖휔(−훼,−훼) .

We find from the above that

(−훼,−훼) (−훼,−훼) 2훼 (−훼,−훼) ‖푢 − 휋 푢‖퐵훼 ≤ 휌‖푢 − 휋푁 푢‖휔(−훼,−훼) + ‖퐷 (휋푁 푢 − 푢)‖휔(훼,훼) .

Finally, since 푢 − 푢푁 = 푢 − 푢˜푁 + 푒푁 , combining the above with (3.39), (3.37) and (3.38), we obtain the desired result.

Remark 3.1. We emphasize that unlike in previous examples, here we can not easily bound the errors in terms of 푓. In particular, the smoothness of 푓 does not imply that the righthand side of (3.45) is bounded for any 푚. Hence, only an algebraic convergence rate can be achieved in this case.

3.3 Two-sided fractional differential equations with different coefficients

We consider the two-sided fractional differential equation

훽 푅 훽 푅 훽 풟푝 푢(푥) := 퐶훽,푝(푝 퐷푥 푢(푥) + (1 − 푝)푥퐷 푢(푥)) = 푓(푥), 푥 ∈ Λ, (3.40) 푢(±1) = 0,

where 1 < 훽 < 2, 0 ≤ 푝 ≤ 1, 퐶훽,푝 defined in (2.4), and 푓(푥) is a given function. spectral methods for FDEs 23

Let 휇, 휈 satisfy (2.62) and 0 < 휇, 휈 < 훽. A Petrov-Galerkin spectral method −휇,−휈 for (3.40) is: Find 푢푁 ∈ F푁 such that 훽 (풟푝 푢푁 , 푣푁 )휔(휈,휇) = (푓, 푣푁 )휔(휈,휇) , ∀푣푁 ∈ 풫푁 . (3.41)

The solution to this discrete problem can be found directly as follows. We expand 푓(푥) as ∞ ∑︁ (휈,휇) 푓(푥) = 푓푚푃푚 (푥), (3.42) 푚=0 and write 푁 ∑︁ −휇,−휈 푢푁 (푥) = 푢^푛풥푛 (푥). (3.43) 푛=0 (휈,휇) Plugging (3.43) and (3.42) in (3.41), using (2.65) and the orthogonality of {푃푚 } 2 in 퐿휔(휈,휇) (Λ), we find (︁ Γ(푛 + 1 + 훽) )︁ 푢^ = 푓 , ∀ 0 ≤ 푛 ≤ 푁. (3.44) 푛 푛 푛! As for the error estimate, we have

(푗) 2 Theorem 3.11. Assuming 푓 ∈ 퐿휔(휈+푗,휇+푗) (Λ) for 0 ≤ 푗 ≤ 푚, let 푢 and 푢푁 be the solution of (3.40) and (3.41), then we have

−훽−푚 (푚) ‖푢 − 푢푁 ‖휔(−휇,−휈) ≤ 푐푁 ‖푓 ‖휔(휈+푚,휇+푚) . (3.45) 훽 −푚 (푚) ‖풟푝 (푢 − 푢푁 )‖휔(휈,휇) ≤ 푐푁 ‖푓 ‖휔(휈+푚,휇+푚) . (3.46)

(−휇,−휈) Proof. It is clear from (3.44) that 푢푁 = 휋푁 푢. Hence, by (2.71), we have

(−휇,−휈) −훽−푚 훽+푚 ‖푢 − 푢푁 ‖휔(−휇,−휈) = ‖푢 − 휋푁 푢‖휔(−휇,−휈) ≤ 푐푁 ‖풟푝 푢‖휔(휈+푚,휇+푚) . On the other hand, we derive from (2.70) with 푙 = 0 that

훽 훽 (−휇,−휈) −푚 훽+푚 ‖풟푝 (푢 − 푢푁 )‖휔(휈,휇) = ‖풟푝 (푢 − 휋푁 푢)‖휔(휈,휇) ≤ 푐푁 ‖풟푝 푢‖휔(휈+푚,휇+푚) . 훽+푚 (푚) Since 풟푝 푢 = 푓 , we obtain the desired results from the above.

3.4 Space-time fractional differential equations

As the last example, we consider

퐶 훼 2훽 퐷푡 푢(푥, 푡) − 퐷 푢(푥, 푡) = 푓(푥, 푡), ∀(푥, 푡) ∈ 푄 = Λ × 퐼, 푢(푥, 푡)|휕Λ = 0, ∀푡 ∈ 퐼 := (0 < 푇 ), (3.47) 푢(푥, 0) = 푢0(푥) ∀푥 ∈ Λ, 24 J. Shen and C. Sheng where 훼 ∈ (0, 1), 2훽 ∈ (1, 2). To deal with the non-homogeneous initial condition, we first decompose the solution 푢(푥, 푡) into two parts as ℎ 푢(푥, 푡) = 푢 (푥, 푡) + 푢0(푥), (3.48) with 푢ℎ(푥, 0) = 0. Hence, the equation (3.47) is equivalent to the following with Riemann-Liouville fractional derivative: 푅 훼 ℎ 2훽 ℎ 퐷푡 푢 (푥, 푡) − 퐷 푢 (푥, 푡) = 푔(푥, 푡), ∀(푥, 푡) ∈ 푄, 푢ℎ(푥, 0) = 0, ∀푥 ∈ Λ, (3.49) ℎ 푢 (푥, 푡)|휕Λ = 0, ∀푡 ∈ 퐼, where 2훽 푔(푥, 푡) = 푓(푥, 푡) + 퐷 푢0(푥). We consider the following weak formulation of (3.49): find 푢 ∈ 푋, such that ℎ 푅 훼 ℎ 2훽 ℎ 풜(푢 , 푣) := ( 퐷푡 푢 , 푣)푄 − (퐷 푢 , 푣)푄 = (푔, 푣)푄, ∀푣 ∈ 푌, (3.50) and describe a space-time spectral method for solving the above equation. For the time variable, we shall use the shifted fractional polynomial space. (훼,훽) (훼,훽) − (−훼,−훼) Let 푥(푡) = 2푡/푇 − 1. We denote 푃˜푛 (푡) = 푃푛 (푥(푡)), 퐽˜푛 (푡) := 훼 (−훼,훼) 푡 푃˜푛 (푡), and

− (−훼,−훼) −˜(−훼,−훼) (3.51) ℱ푁 (퐼) = span{ 퐽푛 (푡) : 0 ≤ 푛 ≤ 푁}. −훽,−훽 For the space variable, we shall use F푀 defined in (2.48). Then, the Petrov- ℎ ℎ −훽,−훽 − (−훼,−훼) Galerkin method for (3.49) is: find 푢퐿(푥, 푡) := 푢푀푁 ∈ F푀 ⊗ ℱ푁 such that ℎ 푅 훼 ℎ 2훽 ℎ −훽,−훽 풜(푢퐿, 푣) := ( 퐷푡 푢퐿, 푣)푄 − (퐷 푢퐿, 푣)푄 = (푔, 푣)푄, ∀푣 ∈ F푀 ⊗ 풫푁 . (3.52) We first describe an efficient algorithm for solving (3.52) similar to the one used in [23]. We write 푀 푁 ℎ ∑︁ ∑︁ ℎ −훽,−훽 −˜(−훼,−훼) 푢퐿(푥, 푡) = 푢̃︀푚푛풥푚 (푥) 퐽푛 (푡). (3.53) 푚=0 푛=0 −훽,−훽 (훼) (훼) For the test function, we take 푣퐿 = 풥푝 (푥)퐿푞 (푡) where 퐿푞 (푡) := 푞!(2푞 + 1) 휅 푃˜(0,0)(푡) with 휅 = . Substituting the above in into (3.52), 푞,훼 푞 푞,훼 푇 · Γ(푞 + 훼 + 1) we obtain 푀 푁 ∑︁ ∑︁ ℎ {︁ −훽,−훽 −훽,−훽 푅 훼−˜(−훼,−훼) (훼) 푢̃︀푚푛 (풥푚 , 풥푝 )( 퐷푡 퐽푛 , 퐿푞 ) 푚=0 푛=0 2훽 −훽,−훽 −훽,−훽 − (−훼,−훼) (훼) }︁ (3.54) − (퐷 풥푚 , 풥푝 )( 퐽˜푛 , 퐿푞 )

−훽,−훽 (훼) = (푔, 풥푝 퐿푞 )푄. spectral methods for FDEs 25

Denote

−훽,−훽 (훼) 푔푝푞 = (푔, 풥푝 (푥)퐿푞 (푡))푄, 퐺 = (푔푝푞)0≤푝≤푀,0≤푞≤푁 , ∫︁ ∫︁ 푡 푅 훼− (−훼,−훼) (훼) 푡 − (−훼,−훼) (훼) 푠푝푞 = 퐷푡 퐽˜푞 (푡)퐿푝 (푡)푑푡, 푚푝푞 = 퐽˜푞 (푡)퐿푝 (푡)푑푡, 퐼 퐼 ℎ 푡 푡 푡 푡 푈 = (푢̃︀푚푛)0≤푚≤푀,0≤푛≤푁 , 푆 = (푠푝푞)0≤푝,푞≤푁 , 푀 = (푚푝푞)0≤푝,푞≤푁 .

Note that 푆푡 is a diagonal matrix, 푀 푡 is not sparse but its entries can be accurately computed by Jacobi-Gauss quadrature with index (0, 훼). Then, from (3.4), we find that (3.52) is equivalent to the following linear system: 푀 푥푈(푆푡)푇 + 푆푥푈(푀 푡)푇 = 퐺, (3.55)

where 푀 푥 and 푆푥 are the mass and stiffness matrix in the 푥-direction defined in (3.31). 푆푥 is a diagonal matrix and 푀 푥 is full but symmetric. The linear system (3.55) can be solved efficiently by using the matrix diagonalization method [26].

Indeed, let 퐸 := (¯푒0, ··· , 푒¯푁 ) = (푒푝푞)푝,푞=0,··· ,푁 be the matrix formed by the 푥 푥 orthonormal eigenvectors of the generalized eigenvalue problem 푀 푒¯푗 = 휆푗푆 푒¯푗 and Λ = diag(휆0, ··· , 휆푁 ), i.e.,

푀 푥퐸 = 푆푥 퐸Λ. (3.56)

Setting 푈 = 퐸푉 , and multiplying both sides of (3.55) by (푆푥퐸)−1 = 퐸푇 푆푥, we arrive at Λ 푉 (푆푡)푇 + 푉 (푀 푡)푇 = 퐻 := 퐸푇 푆푥퐺. (3.57)

Hence, let v푚 and h푚 be the 푚-th row of 푉 and 퐻, respectively, the above matrix equation becomes:

푡 푡 (휆푚푆 + 푀 )v푚 = h푚, 0 ≤ 푚 ≤ 푀, (3.58)

which we solve directly with 퐿푈 decomposition. Once we obtain 푉 , we set 푈 = 퐸푉 . ℎ Finally, we obtain the numerical solutions of (3.47) by 푢퐿 = 푢퐿 + 푢0. We now turn to the error estimate. Thanks to (3.34), we can define the following norm: 1/2 (︁ 푅 훼 2 2훽 )︁ ‖푣‖푋훼,훽 (푄) := ‖ 퐷푡 푣‖푄 − (퐷 푣, 푣)푄 . 26 J. Shen and C. Sheng

ℎ ℎ Theorem 3.12. Let 푢 and 푢퐿 be the solutions of (3.50) and (3.52), respectively. Then we have the following error estimates:

‖푢 − 푢퐿‖푋훼,훽 (푄) 1−(2훽+푚) 2훽−1+푚 푅 훼 ≲ 푀 ‖퐷 ( 퐷푡 푢)‖퐿2 (Λ;퐿2(퐼)) 휔(훽−1+푚,훽−1+푚) +푁 −(훼+푛)⃦푅퐷훼+푛(퐷2훽푢)⃦ ⃦ 푡 ⃦퐿2(Λ;퐿2 (퐼)) 휔(푛,푛) 1−푚 2훽−1+푚 +푀 ‖퐷 푢‖퐿2 (Λ;퐿2 (퐼)) 휔(훽−1+푚,훽−1+푚) 휔(−훼,−훼) +푁 −푛⃦푅퐷훼+푛푢⃦ . ⃦ 푡 ⃦퐿2 (Λ;퐿2 (퐼)) 휔(−훽,−훽) 휔(푛,푛)

ℎ − (−훼,−훼) (−훽,−훽) ℎ (−훽,−훽) − (−훼,−훼) ℎ Proof. Let us denote 푢˜퐿 := 휋푁 휋푀 푢 = 휋푀 휋푁 푢 and ℎ ℎ −훽,−훽 푒퐿 :=푢 ˜퐿 − 푢퐿. We derive from (3.49) and (3.52) that for all ∀푣퐿 ∈ F푀 ⊗ 풫푁 , we have 푅 훼 2훽 푏(푒퐿, 푣퐿) : = ( 퐷푡 푒퐿, 푣)푄 − (퐷 푒퐿, 푣퐿)푄 푅 훼 ℎ ℎ 2훽 ℎ ℎ = ( 퐷푡 (푢̃︀퐿 − 푢 ), 푣퐿)푄 − (퐷 (푢̃︀퐿 − 푢 ), 푣퐿)푄 = (︀푅퐷훼(휋(−훽,−훽)푢ℎ − 푢ℎ), 푣 )︀ − (퐷2훽(−휋(−훼,−훼)푢ℎ − 푢ℎ), 푣 ) . 푡 푀 퐿 푄 푁 퐿 푄

푅 훼 −훽,−훽 Taking 푣퐿 = 퐷푡 푒퐿 (∈ F푀 ⊗ 풫푁 ) in the above equation, we obtain that 푅 훼 푅 훼 2훽 푅 훼 ( 퐷푡 푒퐿, 퐷푡 푒퐿)푄 − (퐷 푒퐿, 퐷푡 푒퐿)푄 푅 훼 (−훽,−훽) ℎ ℎ 푅 훼 2훽 − (−훼,−훼) ℎ ℎ 푅 훼 = ( 퐷푡 (휋푀 푢 − 푢 ), 퐷푡 푒퐿)푄 − (퐷 ( 휋푁 푢 − 푢 ), 퐷푡 푒퐿)푄. (3.59)

Thanks to the generalized Poincaŕe inequality [8]:

푅 훼 ‖푢‖퐿2(퐼) ≤ 푐‖ 퐷푡 푢‖퐿2(퐼),

we derive from Lemmas 2.2-2.3, (3.59) that

훼 훼 (퐷2훽푒 , 푒 ) (퐷2훽(푅퐷 2 푒 ), 푅퐷 2 푒 )︀ 퐿 퐿 푄 ≲ 푡 퐿 푡 퐿 푄 2훽 푅 훼 푅 훼 2훽 푅 훼 ∼ (퐷 ( 퐷 2 푒 ), 퐷 2 푒 )︀ = (퐷 푒 , 퐷 푒 ) , (3.60) = 푡 퐿 푡 퐿 푄 퐿 푡 퐿 푄 This, along with equation (3.59), yields

‖푅퐷훼푒 ‖2 + (퐷2훽푒 , 푒 ) ≤ ‖푅퐷훼(휋(−훽,−훽)푢ℎ − 푢ℎ)‖ ‖푅퐷훼푒 ⃦ 푡 퐿 푄 퐿 퐿 푄 푡 푀 푄 푡 퐿⃦푄 2훽 − (−훼,−훼) ℎ ℎ 푅 훼 +‖퐷 ( 휋푁 푢 − 푢 )‖푄 ‖ 퐷푡 푒퐿‖푄, which implies

2 푅 훼 2 2훽 ‖푒퐿‖푋훼,훽 (푄) := ‖ 퐷푡 푒퐿‖푄 + (퐷 푒퐿, 푒퐿)푄 푅 훼 (−훽,−훽) ℎ ℎ 2 2훽 − (−훼,−훼) ℎ ℎ 2 ≲ ‖ 퐷푡 (휋푀 푢 − 푢 )‖푄 + ‖퐷 ( 휋푁 푢 − 푢 )‖푄. spectral methods for FDEs 27

The two terms at the right-hand side can be bounded by using Lemma 2.2 and Lemma 2.4 as follows: 푅 훼 (−훽,−훽) ℎ ℎ 푅 훼 (−훽,−훽) ℎ ℎ ‖ 퐷푡 (휋푀 푢 − 푢 )‖푄 ≲ ‖ 퐷푡 (휋푀 푢 − 푢 )‖퐿2 (Λ;퐿2(퐼)) 휔(−훽,−훽) 1−(2훽+푚) 2훽−1+푚 푅 훼 ≲ 푀 ‖퐷 ( 퐷푡 푢)‖퐿2 (Λ;퐿2(퐼)), 휔(훽−1+푚,훽−1+푚) and 2훽 − (−훼,−훼) ℎ ℎ 2훽 − (−훼,−훼) ℎ ℎ ‖퐷 ( 휋푁 푢 − 푢 )‖푄 ≲ ‖퐷 ( 휋푁 푢 − 푢 )‖퐿2(Λ;퐿2 (퐼)) 휔(−훼,−훼) 푁 −(훼+푛)⃦푅퐷훼+푛(퐷2훽푢)⃦ . ≲ ⃦ 푡 ⃦퐿2(Λ;퐿2 (퐼)) 휔(푛,푛) Combining the above estimates, we arrive at 1−(2훽+푚) 2훽−1+푚 푅 훼 ‖푒퐿‖푋훼,훽 (푄) ≲푀 ‖퐷 ( 퐷푡 푢)‖퐿2 (Λ;퐿2(퐼)) 휔(훽−1+푚,훽−1+푚) + 푁 −(훼+푛)⃦푅퐷훼+푛(퐷2훽푢)⃦ . (3.61) ⃦ 푡 ⃦퐿2(Λ;퐿2 (퐼)) 휔(푛,푛) ℎ ℎ ℎ On the other hand, we have 푢 − 푢퐿 = 푢 − 푢˜퐿 + 푒퐿. Then, using Lemma 2.2 and Lemma 2.4 again yields 2훽 ℎ ℎ ℎ ℎ (퐷 (˜푢 − 푢 ), 푢˜ − 푢 )푄 2훽 ℎ ℎ ℎ ℎ ≤ ‖퐷 (˜푢 − 푢 )‖퐿2 (Λ;퐿2 (퐼))‖푢˜ − 푢 ‖퐿2 (Λ;퐿2 (퐼)) 휔(훽,훽) 휔(훼,훼) 휔(−훽,−훽) 휔(−훼,−훼) 2훽 ℎ ℎ 2 ℎ ℎ 2 ≤ ‖퐷 (˜푢 − 푢 )‖퐿2 (Λ;퐿2 (퐼)) + ‖푢˜ − 푢 ‖퐿2 (Λ;퐿2 (퐼)) 휔(훽,훽) 휔(훼,훼) 휔(−훽,−훽) 휔(−훼,−훼) := 퐼1 + 퐼2. Similarly, these two terms can be estimated as follows: 2훽 (−훽,−훽) − (−훼,−훼) ℎ ℎ 2 퐼1 ≤ ‖퐷 휋푀 ( 휋푁 푢 − 푢 )‖퐿2 (Λ;퐿2 (퐼)) 휔(훽,훽) 휔(훼,훼) 2훽 (−훽,−훽) ℎ ℎ 2 +‖퐷 (휋푀 푢 − 푢 )‖퐿2 (Λ;퐿2 (퐼)) 휔(훽,훽) 휔(훼,훼) 2훽 − (−훼,−훼) ℎ ℎ 2 ≤ ‖퐷 ( 휋푁 푢 − 푢 )‖퐿2 (Λ;퐿2 (퐼)) 휔(훽,훽) 휔(−훼,−훼) 2훽 (−훽,−훽) ℎ ℎ 2 +‖퐷 (휋푀 푢 − 푢 )‖퐿2 (Λ;퐿2 (퐼)) 휔(훽,훽) 휔(훼,훼) 2 ≤ 푐푁 −2(훼+푛)⃦푅퐷훼+푛(퐷2훽푢)⃦ ⃦ 푡 ⃦퐿2(Λ;퐿2 (퐼)) 휔(푛,푛) 2−2푚 2훽−1+푚 2 +푀 ‖퐷 푢‖퐿2 (Λ;퐿2(퐼)). 휔(훽−1+푚,훽−1+푚) and − (−훼,−훼) (−훽,−훽) ℎ ℎ 2 퐼2 ≤ ‖ 휋푁 (휋푀 푢 − 푢 )‖퐿2 (Λ;퐿2 (퐼)) 휔(−훽,−훽) 휔(−훼,−훼) − (−훼,−훼) ℎ ℎ 2 +‖ 휋푁 푢 − 푢 ‖퐿2 (Λ;퐿2 (퐼)) 휔(−훽,−훽) 휔(−훼,−훼) (−훽,−훽) ℎ ℎ 2 ≤ ‖휋푀 푢 − 푢 ‖퐿2 (Λ;퐿2 (퐼)) 휔(−훽,−훽) 휔(−훼,−훼) − (−훼,−훼) ℎ ℎ 2 +‖ 휋푁 푢 − 푢 ‖퐿2 (Λ;퐿2 (퐼)) 휔(−훽,−훽) 휔(−훼,−훼) 2−2(2훽+푚) 2훽−1+푚 2 ≤ 푐푀 ‖퐷 푢‖퐿2 (Λ;퐿2 (퐼)) 휔(훽−1+푚,훽−1+푚) 휔(−훼,−훼) 2 +푐푁 −2(훼+푛)⃦푅퐷훼+푛푢⃦ . ⃦ 푡 ⃦퐿2 (Λ;퐿2 (퐼)) 휔(−훽,−훽) 휔(푛,푛) 28 J. Shen and C. Sheng

Moreover, we have

푅 훼 (−훽,−훽)− (−훼,−훼) ℎ ℎ ‖ 퐷푡 (휋푀 휋푁 푢 − 푢 )‖푄 푅 훼− (−훼,−훼) (−훽,−훽) ℎ ℎ 푅 훼 − (−훼,−훼) ℎ ℎ ≤ ‖ 퐷푡 휋푁 (휋푀 푢 − 푢 )‖푄 + ‖ 퐷푡 ( 휋푁 푢 − 푢 )‖푄 푅 훼 (−훽,−훽) ℎ ℎ 푅 훼 − (−훼,−훼) ℎ ℎ ≤ ‖ 퐷푡 (휋푀 푢 − 푢 )‖푄 + ‖ 퐷푡 ( 휋푁 푢 − 푢 )‖푄 1−(2훽+푚) 2훽−1+푚 푅 훼 ≲ 푐푀 ‖퐷 ( 퐷푡 푢)‖퐿2 (Λ;퐿2(퐼)) 휔(훽−1+푚,훽−1+푚) +푐푁 −푛⃦푅퐷훼+푛푢⃦ . ⃦ 푡 ⃦퐿2(Λ;퐿2 (퐼)) 휔(푛,푛) Consequently, the desired result follows from the above estimates and the triangle inequality.

Remark 3.2. Note that the error estimate in the above theorem can not be easily expressed in terms of the data (푓, 푢0). In particular, the space-time Petrov- Galerkin method (3.52) will not lead to high-order convergence, even if 푓 and

푢0 are sufficiently smooth, due to the singularities of the solution at 푡 = 0 and 푥 = ±1. However, the leading singular term in time and in space is included in our approximation space so our method will lead to better convergence rate than those based on the polynomial approximations.

4 Concluding remarks

We presented in this article essential properties of the GJFs and their application to a class of fractional differential equations. In particular, we showed that (i) by using suitable GJFs, the non-local fractional operators become local operators in the space spanned by GJFs; (ii) for simple FDEs, the spectral methods using GJFs can lead to exponential convergence rate despite the non-smoothness of the solution in usual Sobolev spaces; and (iii) for more general FDEs, a suitable spectral method using GJFs is still very efficient as the non-local fractional stiffness matrices can be easily computed, and furthermore, it is also more accurate than using a usual polynomial based method as the GJFs include the leading singular term of the underlying FDEs. We only consider one dimensional FDEs in this paper. For multi-dimensional fractional PDEs with only fractional derivative in time, one can couple the GJF spectral method in time with a usual spatial approximation to construct a space- time Petrov-Galerkin method. It can still be efficiently solved by using the matrix diagonalization method as in the last subsection, we refer to [27] for more detail. As for FDEs with multi-dimensional fractional operators in space, one has to construct appropriate numerical methods with respect to the specific definitions of fractional operator. In particular, the GJFs for Riesz equation in one-dimension can REFERENCES 29 be extended to deal with fractional Laplacian by the integral definition on the multi- dimensional balls [20]. On the other hand, for fractional Laplacian defined through the spectral decomposition of the Laplacian operator, one can use the Caffarelli- Silvestre extension to cast the fractional Laplacian equation in 푑-dimension into an extended problem in 푑 + 1-dimension with regular derivatives and a weakly singular weight in the extended direction. Then, one can construct efficient and accurate spectral method in the extended direction to couple with any consistent approximation in space, for more detail, we refer to [6]. For other types of multi- dimensional fractional PDEs, we refer to a recent review paper [19] for a nice presentation on different definitions of fractional Laplacian and their numerical treatments.

References

[1] R. A. Adams. Sobolev Spaces. Academic Press, New York, 1975. [2] George E Andrews, Richard Askey, Ranjan Roy, et al. Special functions, encyclopedia of mathematics and its applications, 1999. [3] Harry Bateman. The solution of linear differential equations by means of definite integrals. Trans. Camb. Phil. Soc, 21:171–196, 1909. [4] Lizhen Chen, Zhiping Mao, and Huiyuan Li. Jacobi-galerkin spectral method for eigenvalue problems of riesz fractional differential equations. arXiv preprint arXiv:1803.03556. [5] S. Chen, J. Shen, and L. L. Wang. Generalized Jacobi functions and their applications to fractional differential equations. Math. Comput., 85(300):1603– 1638, 2016. [6] Sheng Chen and Jie Shen. An efficient and accurate method for the fractional Laplacian equation using the Caffarelli-Silvestre extension. Preprint. [7] K. Diethelm. The Analysis of Fractional Differential Equations. Springer- Verlag, Berlin, 2010. [8] V. J. Ervin and J. P. Roop. Variational formulation for the stationary fractional advection dispersion equation. Numer. Meth. Part. D. E., 22(3):558–576, 2006. [9] V.J. Ervin, N. Heuer, and J.P. Roop. Regularity of the solution to 1-d fractional order diffusion equations. Preprint, 2016. [10] Ben-Yu Guo, Jie Shen, and Li-Lian Wang. Generalized jacobi polyno- mials/functions and their applications. Applied Numerical Mathematics, 59(5):1011–1028, 2009. [11] Dianming Hou and Chuanju Xu. A fractional spectral method with applications to some singular problems. Adv. Comput. Math., 43(5):911–944, 2017. 30 REFERENCES

[12] Can Huang, Yujian Jiao, Li-Lian Wang, and Zhimin Zhang. Optimal fractional integration preconditioning and error analysis of fractional using nodal generalized Jacobi functions. SIAM J. Numer. Anal., 54(6):3357– 3387, 2016. [13] Can Huang and Martin Stynes. A spectral collocation method for a weakly singular Volterra integral equation of the second kind. Adv. Comput. Math., 42(5):1015–1030, 2016. [14] Yujian Jiao, Li-Lian Wang, and Can Huang. Well-conditioned fractional collocation methods using fractional Birkhoff interpolation basis. J. Comput. Phys., 305:1–28, 2016. [15] Ehsan Kharazmi, Mohsen Zayernouri, and George Em Karniadakis. Petrov- Galerkin and spectral collocation methods for distributed order differential equations. SIAM J. Sci. Comput., 39(3):A1003–A1037, 2017. [16] Ehsan Kharazmi, Mohsen Zayernouri, and George Em Karniadakis. A Petrov- Galerkin for fractional elliptic problems. Comput. Methods Appl. Mech. Engrg., 324:512–536, 2017. [17] X. Li and C. Xu. A space-time spectral method for the time fractional diffusion equation. SIAM Journal on Numerical Analysis, 47(3):2108–2131, 2009. [18] X. Li and C. Xu. Existence and uniqueness of the weak solution of the space-time fractional diffusion equation and a spectral method approximation. Communications in Computational Physics, 8(5):1016, 2010. [19] Anna Lischke, Guofei Pang, Mamikon Gulian, Fangying Song, Christian Glusa, Xiaoning Zheng, Zhiping Mao, Mark M. Meerschaert Wei Cai, Mark Ainsworth, and George Em Karniadakis. What is the fractional Laplacian? arXiv:1801.09767. [20] Suna Ma, Huiyuan Li, and Zhiming Zhang. Efficient spectral methods for the fractional laplacian. Preprint. [21] Zhiping Mao, Sheng Chen, and Jie Shen. Efficient and accurate spectral method using generalized jacobi functions for solving riesz fractional differential equations. Applied Numerical Mathematics, 106:165–181, 2016. [22] Zhiping Mao and George Em Karniadakis. A spectral method (of exponential convergence) for singular solutions of the diffusion equation with general two-sided fractional derivative. SIAM J. Numer. Anal., 56(1):24–49, 2018. [23] Zhiping Mao and Jie Shen. Efficient spectral-Galerkin methods for fractional partial differential equations with variable coefficients. J. Comput. Phys., 307:243–261, 2016. [24] I. Podlubny. Fractional Differential Equations. Academic Press, New York, 1999. [25] S. G. Samko, A. A. Kilbas, and O. I. Marichev. Fractional Integrals and REFERENCES 31

Derivatives:Theory and Applications. Gordon and Breach Science, Yverdon, Switzerland, 1993. [26] Jie Shen. Efficient spectral-galerkin method i. direct solvers of second-and fourth-order equations using legendre polynomials. SIAM Journal on Scientific Computing, 15(6):1489–1505, 1994. [27] Jie Shen and Changtao Sheng. An efficient space-time method for time fractional diffusion equation. Preprint. [28] Jie Shen, Changtao Sheng, and Zhongqing Wang. Generalized Jacobi spectral- Galerkin method for nonlinear Volterra integral equations with weakly singular kernels. J. Math. Study, 48(4):315–329, 2015. [29] Jie Shen, Tao Tang, and Li-Lian Wang. Spectral methods: algorithms, analysis and applications, volume 41. Springer Science & Business Media, 2011. [30] G. Szegö. Orthogonal Polynomials (fourth edition), volume 23. AMS Coll. Publ., 1975. [31] Mohsen Zayernouri, Mark Ainsworth, and George Em Karniadakis. A unified Petrov-Galerkin spectral method for fractional PDEs. Comput. Methods Appl. Mech. Engrg., 283:1545–1569, 2015. [32] Mohsen Zayernouri and George Em Karniadakis. Fractional Sturm-Liouville eigen-problems: theory and numerical approximation. J. Comput. Phys., 252:495–517, 2013. [33] Mohsen Zayernouri and George Em Karniadakis. Exponentially accurate spectral and spectral element methods for fractional ODEs. J. Comput. Phys., 257(part A):460–480, 2014. [34] Mohsen Zayernouri and George Em Karniadakis. Fractional spectral collo- cation methods for linear and nonlinear variable order FPDEs. J. Comput. Phys., 293:312–338, 2015. [35] Fanhai Zeng, Zhiping Mao, and George Em Karniadakis. A generalized spectral collocation method with tunable accuracy for fractional differential equations with end-point singularities. SIAM J. Sci. Comput., 39(1):A360–A383, 2017. [36] Zhongqiang Zhang, Fanhai Zeng, and George Em Karniadakis. Optimal error estimates of spectral Petrov-Galerkin and collocation methods for initial value problems of fractional differential equations. SIAM J. Numer. Anal., 53(4):2074–2096, 2015.