Theory and Modern Applications

# Analysis of two Legendre spectral approximations for the variable-coefficient fractional diffusion-wave equation

## Abstract

In this paper, we solve the variable-coefficient fractional diffusion-wave equation in a bounded domain by the Legendre spectral method. The time fractional derivative is in the Caputo sense of order $$\gamma \in (1,2)$$. We propose two fully discrete schemes based on finite difference in temporal and Legendre spectral approximations in spatial discretization. For the first scheme, we discretize the time fractional derivative directly by the $$L_{1}$$ approximation coupled with the Crank–Nicolson technique. For the second scheme, we transform the equation into an equivalent form with respect to the Riemann–Liouville fractional integral operator. We give a rigorous analysis of the stability and convergence of the two fully discrete schemes. Numerical examples are carried out to verify the theoretical results.

## 1 Introduction

Fractional differential equations (FDEs) have a long history of applications in physics, chemistry, biology, engineering, economics, and many other scientific and engineering fields [1,2,3,4,5,6,7,8,9,10,11]. In most cases, analytical methods do not work well on most of FDEs, and even if they can be solved, the expressions of solution often contain infinite series or special functions, which are complicated or difficult to calculate [12, 13], so it is natural to resort to numerical approaches. Up to now, there are several numerical techniques to solve FDEs, such as the finite difference method (FDM) [14,15,16,17], the finite element method (FEM) [18,19,20], the discontinuous Galerkin method [21, 22], the spectral method [23,24,25,26,27,28], and so on.

In this paper, we consider the following variable-coefficient fractional diffusion-wave equation:

$${}^{C}_{0}{D}_{t}^{\gamma }u(x,t)= \mathcal{L}u(x,t)+g(x,t),\quad -1< x< 1, 0< t\leqslant T,$$
(1)

subject to the initial and boundary conditions

where $${}^{C}_{0}{D}_{t}^{\gamma }u$$ ($$\gamma \in (1,2)$$) is the Caputo fractional derivative with respect to t of order γ,

$${}^{C}_{0}{D}_{t}^{\gamma }u(x,t)= \frac{1}{\varGamma (2-\gamma )} \int _{0}^{t}(t-s)^{1-\gamma }\frac{ \partial ^{2} u(x,s)}{\partial s^{2}}{ \,\mathrm{d}}s,$$

$$\varGamma (\cdot )$$ is the gamma function,

\begin{aligned} \mathcal{L}u=\frac{\partial }{\partial x} \biggl(p(x)\frac{\partial u}{ \partial x} \biggr)-q(x)u, \end{aligned}

and the functions $$p(x)\geqslant c_{0}>0$$, $$q(x)\geqslant 0$$, and g are sufficiently smooth.

The fractional diffusion-wave equation is a mathematical model of some important physical phenomena [29]. When $$g\equiv 0$$, Schneider and Wyss [30] obtained the solution of the equation with constant coefficients in the whole space and half-space by Green functions. Agrawal [31] obtained a general solution in terms of Mittag-Leffler functions in a bounded domain. Pskhu [32] constructed a fundamental solution for a fractional diffusion-wave equation with Dzhrbashyan–Nersesyan fractional differential operator with respect to t, with Riemann–Liouville and Caputo derivatives as its particular cases. Chen et al. [33] considered a fractional diffusion-wave equation with damping; by using the method of separation of variables the analytical solution is derived, an implicit difference scheme is constructed, and the stability and convergence of the scheme are proved by the energy method. For numerical approximation of problem (1)–(3) with constant coefficients, Sun and Wu [34] proposed a fully discrete difference scheme and analyzed the solvability, stability, and $$L^{\infty }$$ convergence of the scheme by the energy method; its convergence rate is $$\mathrm{O}(\tau ^{3-\gamma }+h^{2})$$, where τ and h are the time- and space-step sizes, respectively. Huang et al. [35] proposed two finite difference schemes with convergence rates $$\mathrm{O}(\tau +h^{2})$$. Wang and Vong [36] proposed a compact difference scheme with convergence rate $$\mathrm{O}(\tau ^{2}+h^{4})$$. For variable-coefficient case, Wang [37] developed a compact difference scheme for a class of variable-coefficient time fractional convection–diffusion-wave equations with convergence rate $$\mathrm{O}( \tau ^{3-\gamma }+h^{4})$$.

In this paper, we aim to solve problem (1)–(3) by using two fully discrete spectral schemes, one based on the approximation of the Caputo fractional derivative, and the other based on the approximation of the Riemann–Liouville fractional integral operator. We give a detailed analysis of the stability and convergence of these two schemes. The first scheme is unconditionally stable, and its convergence rate in the $$H^{1}$$ norm is $$\mathrm{O}(\tau ^{3-\gamma }+N^{1-m})$$. By a delicate analysis the second scheme is conditionally stable, and its convergence rate in the $$L^{2}$$ norm is $$\mathrm{O}(\tau ^{2}+N^{1-m})$$.

The rest of the paper is organized as follows. We commence by reviewing some preliminaries and notations in the next section. In Sects. 3 and 4, we present formulations of two fully discrete spectral schemes and vigorously analyze their stability and convergence. Numerical experiments are presented in Sect. 5. We conclude by summary and discussion in the last section.

## 2 Preliminaries

In this section, we introduce some notations and lemmas, which will be used in the following sections.

### Definition 1

([38, 39])

Let $$\alpha >0$$. The left-side Riemann–Liouville fractional integral $${}_{0}{I}_{t}^{\alpha }f(t)$$ of order α of a given function $$f(t)$$ is defined by

$${}_{0}{I}_{t}^{\alpha }f(t)=\frac{1}{\varGamma (\alpha )} \int _{0}^{t} (t-s)^{\alpha -1}f(s)\,\mathrm{d}s,\quad t>0.$$

### Definition 2

([38, 39])

Let $$n-1\leqslant \alpha < n$$. The left-side Caputo fractional derivative $${}^{C}_{0}{D}_{t}^{\alpha }f(t)$$ of order α of $$f(t)$$ is defined by

$${}^{C}_{0}{D}_{t}^{\alpha }f(t)={}_{0}{I}_{t}^{n- \alpha }f^{(n)}(t)= \frac{1}{\varGamma (n-\alpha )} \int _{0}^{t}(t-s)^{n- \alpha -1}f^{(n)}(s) \,\mathrm{d}s,\quad t>0.$$

We have the following result by Theorem 3.8 in [38] (p. 54) for the Caputo fractional derivative

$${}_{0}{I}_{t}^{\alpha }{}^{C}_{0}{D}_{t}^{\alpha }f(t)=f(t)- \sum_{k=0}^{n-1}\frac{f^{(k)}(0)}{k!}t^{k}.$$
(4)

Let $$\varLambda =(-1,1)$$, amd let N be a positive integer. By $$L_{w}^{2}(\varLambda )$$ we denote the weighted $$L^{2}$$-space with weight function $$w(x)$$ and inner product and norm defined as

$$(u,v)_{w}= \int _{\varLambda }uv w\,\mathrm{d}x,\qquad \Vert v \Vert _{w}= \biggl( \int _{ \varLambda }v^{2} w\,\mathrm{d}x \biggr)^{\frac{1}{2}}.$$

Denote the norms of the Sobolev spaces $$W^{r,p}(\varLambda )$$ by $$\Vert \cdot \Vert _{r,p}$$, with the particular case $$H^{r}(\varLambda )\triangleq W^{r,2}(\varLambda )$$ with seminorm $$|\cdot |_{r}$$ and norm $$\Vert \cdot \Vert _{r}$$, and

$$H_{0}^{1}(\varLambda )= \bigl\{ v\in H^{1}(\varLambda ),v(\pm 1)=0 \bigr\} .$$

By $$\mathbb{P}_{N}(\varLambda )$$ we denote the space of all polynomials on Λ of degree less than or equal to N. We also denote $$\mathbb{P}_{N}^{0}(\varLambda ):= \mathbb{P}_{N}(\varLambda )\cap H_{0} ^{1}(\varLambda )$$.

For space-time functional spaces, we denote by $$L^{\infty }(0,T;H^{m}( \varLambda ))$$ the space of measurable functions $$v:(0,T)\rightarrow H ^{m}(\varLambda )$$ such that

$$\Vert v \Vert _{L^{\infty }(0,T;H^{m}(\varLambda ))} = \operatorname*{ess\,sup}_{t\in [0,T]} \bigl\Vert v(x,t) \bigr\Vert _{m}< \infty$$

and by $$C^{k} ([0,T];H^{m}(\varLambda ) )$$ ($$0\leqslant k<\infty$$) be the space of k-times continuous differentiable functions $$v:[0,T]\rightarrow H^{m}(\varLambda )$$ such that

$$\Vert v \Vert _{C^{k}([0,T];H^{m}(\varLambda ))}=\sum_{i=0}^{k} \max_{t\in [0,T]} \bigl\Vert \partial _{t}^{i}v(x,t) \bigr\Vert _{m}< \infty .$$

For simplicity, we denote $$\partial _{s}^{k}=\frac{\partial ^{k}}{ \partial s^{k}}$$. Throughout the paper, c denotes a generic positive constant.

Now we introduce some projection approximation results.

Let $$\pi _{N}^{1,0}$$ be the $$H_{0}^{1}$$-orthogonal projection operator from $$H_{0}^{1}(\varLambda )$$ onto $$\mathbb{P}_{N}^{0}$$ such that for all $$u \in H_{0}^{1}(\varLambda )$$,

$$\bigl(\partial _{x}\pi _{N}^{1,0}u-\partial _{x}u,\partial _{x}v_{N} \bigr)=0,\quad \forall v_{N}\in \mathbb{P}_{N}^{0}.$$

For the projection operator $$\pi _{N}^{1,0}$$, we have the following estimate.

### Lemma 1

([40], p. 288)

Let $$k=0,1$$ and $$m\geqslant k$$. For all $$u \in H^{m}(\varLambda )\cap H_{0}^{1}(\varLambda )$$, there exists a positive constant C, depending only on m, such that

$$\bigl\Vert u-\pi _{N}^{1,0}u \bigr\Vert _{k} \leqslant CN^{k-m} \Vert u \Vert _{m},$$

where C is a positive constant independent of N.

Define the modified projector $$\varPi _{N}^{1,0}: H_{0}^{1}(\varLambda ) \rightarrow \mathbb{P}_{N}^{0}$$ such that

$$\bigl(p(x)\partial _{x}\bigl(u-\varPi _{N}^{1,0}u \bigr),\partial _{x}v_{N} \bigr)+ \bigl(q(x) \bigl(u- \varPi _{N}^{1,0}u\bigr),v_{N} \bigr)=0,\quad \forall v_{N}\in \mathbb{P}_{N} ^{0}.$$

We have the following lemma.

### Lemma 2

For all $$u \in H_{0}^{1}(\varLambda )$$, we have

$$\bigl\Vert \partial _{x}\bigl(u-\varPi _{N}^{1,0}u \bigr) \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u-\varPi _{N}^{1,0}u \bigr\Vert _{q(x)}^{2} \leqslant CN^{2-2m} \Vert u \Vert _{m}^{2},\quad m \geqslant 1,$$

where C is a positive constant independent of N.

### Proof

By the definition of the operator $$\varPi _{N}^{1,0}$$ and the Hölder inequality we deduce that

\begin{aligned} & \bigl\Vert \partial _{x}\bigl(u-\varPi _{N}^{1,0}u \bigr) \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u-\varPi _{N}^{1,0}u \bigr\Vert _{q(x)}^{2} \\ &\quad = \bigl(p(x)\partial _{x}\bigl(u-\varPi _{N}^{1,0}u \bigr),\partial _{x}\bigl(u-\pi _{N}^{1,0}u\bigr) \bigr)+ \bigl(q(x) \bigl(u-\varPi _{N}^{1,0}u\bigr),u-\pi _{N}^{1,0}u \bigr) \\ &\quad \leqslant \bigl\Vert \partial _{x}\bigl(u-\varPi _{N}^{1,0}u\bigr) \bigr\Vert _{p(x)} \bigl\Vert \partial _{x}\bigl(u- \pi _{N}^{1,0}u\bigr) \bigr\Vert _{p(x)}+ \bigl\Vert u-\varPi _{N}^{1,0}u \bigr\Vert _{q(x)} \bigl\Vert u-\pi _{N}^{1,0}u \bigr\Vert _{q(x)} \\ &\quad \leqslant \bigl( \bigl\Vert \partial _{x}\bigl(u-\varPi _{N}^{1,0}u\bigr) \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u- \varPi _{N}^{1,0}u \bigr\Vert _{q(x)}^{2} \bigr)^{\frac{1}{2}} \bigl( \bigl\Vert \partial _{x}\bigl(u- \pi _{N}^{1,0}u\bigr) \bigr\Vert _{p(x)}^{2} + \bigl\Vert u-\pi _{N}^{1,0}u \bigr\Vert _{q(x)}^{2} \bigr)^{ \frac{1}{2}} . \end{aligned}

Thus we obtain

$$\bigl\Vert \partial _{x}\bigl(u-\varPi _{N}^{1,0}u \bigr) \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u-\varPi _{N}^{1,0}u \bigr\Vert _{q(x)}^{2} \leqslant \bigl\Vert \partial _{x}\bigl(u-\pi _{N}^{1,0}u \bigr) \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u- \pi _{N}^{1,0}u \bigr\Vert _{q(x)}^{2}.$$

Therefore by the boundedness of $$p(x)$$, $$q(x)$$ and Lemma 1 we have

$$\bigl\Vert \partial _{x}\bigl(u-\varPi _{N}^{1,0}u \bigr) \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u-\varPi _{N}^{1,0}u \bigr\Vert _{q(x)}^{2} \leqslant CN^{2-2m} \Vert u \Vert _{m}^{2}, \quad m \geqslant 1,$$

The lemma is proved. □

The Poincaré inequality is a useful tool in the following analysis.

### Lemma 3

For $$u(x)\in C^{1}[-1,1]$$ with $$u(\pm 1)=0$$, we have

$$\Vert u \Vert \leqslant \frac{1}{\sqrt{2}} \Vert \partial _{x} u \Vert .$$

### Proof

Since $$u(\pm 1)=0$$, we can see that for all $$x\in (-1,1)$$,

$$u(x)= \int ^{x}_{-1}\partial _{s}u(s) \,\mathrm{d}s= \int ^{x}_{1}\partial _{s}u(s) \,\mathrm{d}s=- \int ^{1}_{x}\partial _{s}u(s) \,\mathrm{d}s.$$

Thus by Hölder’s inequality we get

\begin{aligned} \int _{-1}^{0} \bigl\vert u(x) \bigr\vert ^{2}{\,\mathrm{d}}x &\leqslant \int _{-1}^{0} \biggl( \int _{-1}^{x}{\,\mathrm{d}}s \int _{-1}^{x} \bigl\vert \partial _{s}u(s) \bigr\vert ^{2} {\,\mathrm{d}}s \biggr)\,\mathrm{d}x \\ &\leqslant \int _{-1}^{0} \bigl\vert \partial _{s}u(s) \bigr\vert ^{2}{\,\mathrm{d}}s \int ^{0}_{-1}(x+1)\,\mathrm{d}x \\ &=\frac{1}{2} \int ^{0}_{-1} \bigl\vert \partial _{s}u(s) \bigr\vert ^{2}{\,\mathrm{d}}s. \end{aligned}

Analogously, we have

$$\int ^{1}_{0} \bigl\vert u(x) \bigr\vert ^{2}{\,\mathrm{d}}x \leqslant \int ^{1}_{0} \bigl\vert \partial _{s}u(s) \bigr\vert ^{2}{\,\mathrm{d}}s \int ^{1}_{0}(1-x)\,\mathrm{d}x= \frac{1}{2} \int ^{1}_{0} \bigl\vert \partial _{s}u(s) \bigr\vert ^{2}{\,\mathrm{d}}s.$$

Therefore by the above two inequalities we obtain

$$\Vert u \Vert ^{2}= \int ^{0}_{-1} \bigl\vert u(x) \bigr\vert ^{2}{\,\mathrm{d}}x+ \int ^{1}_{0} \bigl\vert u(x) \bigr\vert ^{2} {\,\mathrm{d}}x\leqslant \frac{1}{2} \Vert \partial _{x}u \Vert ^{2}.$$

The proof is completed. □

## 3 The fully discrete Scheme I

In this section, we consider the formulation of the first fully discrete spectral scheme for (1)–(3), which is based on the approximation of the Caputo fractional derivative directly, and present the stability and convergence analysis of the scheme.

Let τ be the time-step size, let M be a positive integer, $$\tau =T/M$$, and $$t_{k}=k\tau$$, $$k=0,1,\ldots ,M$$. For a given function w, we denote

\begin{aligned} &w^{k}=w(\cdot ,t_{k}),\qquad w^{k+\frac{1}{2}}= \frac{1}{2} \bigl(w^{k+1}+w^{k} \bigr), \\ &\delta _{t}w^{k+\frac{1}{2}}=\frac{1}{\tau } \bigl(w^{k+1}-w^{k} \bigr),\quad 0\leqslant k\leqslant M-1. \end{aligned}

### 3.1 Formulation of Scheme I

The first fully discrete scheme is based on the approximation of the Caputo fractional derivative of order $$\gamma \in (1,2)$$. We use the $$L_{1}$$ approximation coupled with the Crank–Nicolson technique as in [34, 37].

Denote $$\gamma _{0}=\tau ^{\gamma -1}\varGamma (3-\gamma )$$ and $$b_{j}=(j+1)^{2- \gamma }-j^{2-\gamma }$$, $$j\geqslant 0$$, and for a differentiable function $$v(t)$$, let

$$L_{t}^{\gamma }v^{k+\frac{1}{2}}=\frac{1}{\gamma _{0}} \Biggl(\delta _{t}v ^{k+\frac{1}{2}}-\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \delta _{t}v^{k-j- \frac{1}{2}}-b_{k}v'(t_{0}) \Biggr)$$

for $$k=1,2,\ldots , M-1$$.

We have the following lemma for the approximation of Caputo fractional derivative of order $$\gamma \in (1,2)$$.

### Lemma 4

([41], p. 122)

Let $$\gamma \in (1,2)$$. Suppose that $$v(t)\in C^{3}[0,t_{k+1}]$$ ($$0\leqslant k \leqslant M-1$$). Then

\begin{aligned} & \biggl\vert \frac{1}{2} \bigl({}^{C}_{0}{D}_{t}^{\gamma }v(t_{k+1}) +{}^{C}_{0}{D}_{t}^{\gamma }v(t_{k}) \bigr) -L_{t}^{\gamma }v ^{k+\frac{1}{2}} \biggr\vert \\ &\quad \leqslant \frac{1}{\varGamma (3-\gamma )} \biggl(\frac{2-\gamma }{12}+\frac{2^{3- \gamma }}{3-\gamma }- \bigl(1+2^{1-\gamma }\bigr)+\frac{1}{12} \biggr) \max_{t \in [0,t_{k+1}]} \bigl\vert v'''(t) \bigr\vert \tau ^{3-\gamma }. \end{aligned}

Next, we discretize the spatial component by the Legendre spectral method. Let $$u_{N}^{j}\in \mathbb{P}_{N}^{0}$$ be the approximation of $$u(x,t)$$ at $$t=t_{j}$$, $$j=0,1,\ldots , M$$. The first fully discrete spectral scheme (Scheme I) is: find $$u_{N}^{k+1}\in \mathbb{P}_{N} ^{0}$$ such that

\begin{aligned} &\bigl(\delta _{t} u_{N}^{k+\frac{1}{2}},v_{N} \bigr)+\gamma _{0}\bigl(p(x)\partial _{x} u_{N}^{k+\frac{1}{2}},\partial _{x} v_{N}\bigr)+ \gamma _{0}\bigl(q(x)u_{N}^{k+ \frac{1}{2}},v_{N} \bigr) \\ &\quad =\gamma _{0}\bigl(g^{k+\frac{1}{2}},v_{N}\bigr)+\sum _{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl( \delta _{t}u_{N}^{k-1-j+\frac{1}{2}},v_{N} \bigr)+b_{k}(\psi ,v_{N}), \quad \forall v_{N}\in \mathbb{P}_{N}^{0}, \end{aligned}
(5)

for $$k=1,2,\ldots ,M-1$$.

For given $$\{u_{N}^{j}\}_{j=0}^{k}$$, the well-posedness of problem (5) is guaranteed by the Lax–Milgram lemma.

### 3.2 Stability and convergence analysis

In this subsection, we analyze the stability and convergence of Scheme I.

It is easy to verify that

$$\textstyle\begin{cases} b_{i}>0, \quad i=0,1,\ldots ,k; \\ b_{k}< b_{k-1}< \cdots < b_{1}< b_{0}=1; \\ \sum_{i=0}^{k-1}(b_{i}-b_{i+1})+b_{k}=1. \end{cases}$$
(6)

Furthermore we have

$$b_{j} =(j+1)^{2-\gamma }-j^{2-\gamma } =(2-\gamma ) \int _{j}^{j+1}s ^{1-\gamma }{\,\mathrm{d}}s \geqslant (2-\gamma ) (j+1)^{1-\gamma }.$$

For the stability of the fully discrete scheme (5), we have the following result.

### Theorem 1

The fully discrete scheme (5) is unconditionally stable, that is, for all $$\tau >0$$,

\begin{aligned} & \bigl\Vert \partial _{x} u_{N}^{k+1} \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u_{N}^{k+1} \bigr\Vert _{q(x)}^{2} \\ &\quad \leqslant \bigl\Vert \partial _{x} u_{N}^{0} \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u_{N}^{0} \bigr\Vert _{q(x)} ^{2}+2\varGamma (2-\gamma )T^{\gamma -1} \tau \sum_{j=0}^{k} \bigl\Vert g^{j+ \frac{1}{2}} \bigr\Vert ^{2} +\frac{2T^{2-\gamma }}{\varGamma (3-\gamma )} \Vert \psi \Vert ^{2}. \end{aligned}

### Proof

Taking $$v_{N}=\delta _{t}u_{N}^{k+\frac{1}{2}}$$ in (5) yields

\begin{aligned} & \bigl\Vert \delta _{t} u_{N}^{k+\frac{1}{2}} \bigr\Vert ^{2}+\gamma _{0}\bigl(p(x)\partial _{x} u_{N}^{k+\frac{1}{2}},\partial _{x} \delta _{t}u_{N}^{k+\frac{1}{2}}\bigr)+ \gamma _{0} \bigl(q(x)u_{N}^{k+\frac{1}{2}},\delta _{t}u_{N}^{k+\frac{1}{2}} \bigr) \\ &\quad =\gamma _{0}\bigl(g^{k+\frac{1}{2}},\delta _{t}u_{N}^{k+\frac{1}{2}} \bigr)+ \sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl(\delta _{t}u_{N}^{k-1-j+\frac{1}{2}}, \delta _{t}u_{N}^{k+\frac{1}{2}}\bigr) +b_{k}\bigl(\psi , \delta _{t}u_{N}^{k+ \frac{1}{2}}\bigr). \end{aligned}
(7)

For the last two terms on the left-hand side of (7), we have

\begin{aligned} \gamma _{0} \bigl(p(x)\partial _{x} u_{N}^{k+\frac{1}{2}},\partial _{x} \delta _{t}u_{N}^{k+\frac{1}{2}} \bigr) &=\frac{\gamma _{0}}{2\tau } \bigl(p(x),\bigl(\partial _{x} u_{N}^{k+1} \bigr)^{2}-\bigl(\partial _{x} u_{N}^{k} \bigr)^{2} \bigr) \\ &=\frac{\gamma _{0}}{2\tau } \bigl( \bigl\Vert \partial _{x} u_{N}^{k+1} \bigr\Vert _{p(x)} ^{2}- \bigl\Vert \partial _{x} u_{N}^{k} \bigr\Vert _{p(x)}^{2} \bigr) \end{aligned}
(8)

and

\begin{aligned} \gamma _{0} \bigl(q(x) u_{N}^{k+\frac{1}{2}}, \delta _{t}u_{N}^{k+ \frac{1}{2}} \bigr) &=\frac{\gamma _{0}}{2\tau } \bigl(q(x),\bigl( u_{N}^{k+1}\bigr)^{2}-\bigl( u_{N}^{k}\bigr)^{2} \bigr) \\ &\quad =\frac{\gamma _{0}}{2\tau } \bigl( \bigl\Vert u_{N}^{k+1} \bigr\Vert _{q(x)}^{2}- \bigl\Vert u_{N} ^{k} \bigr\Vert _{q(x)}^{2} \bigr), \end{aligned}
(9)

respectively.

For the terms on the right-hand side of (7), by Hölder’s and Young’s inequalities, we get

\begin{aligned} &\gamma _{0}\bigl(g^{k+\frac{1}{2}},\delta _{t}u_{N}^{k+\frac{1}{2}}\bigr) \leqslant \frac{\gamma _{0}^{2}}{b_{k}} \bigl\Vert g^{k+\frac{1}{2}} \bigr\Vert ^{2}+\frac{1}{4}b _{k} \bigl\Vert \delta _{t}u_{N}^{k+\frac{1}{2}} \bigr\Vert ^{2}, \end{aligned}
(10)
\begin{aligned} &\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl(\delta _{t}u_{N}^{k-1-j+\frac{1}{2}}, \delta _{t}u_{N}^{k+\frac{1}{2}}\bigr) \\ &\quad \leqslant \frac{1}{2}\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl( \bigl\Vert \delta _{t}u_{N}^{k-1-j+\frac{1}{2}} \bigr\Vert ^{2}+ \bigl\Vert \delta _{t}u_{N}^{k+\frac{1}{2}} \bigr\Vert ^{2} \bigr) \\ &\quad = \frac{1}{2}\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl\Vert \delta _{t}u_{N}^{k-1-j+ \frac{1}{2}} \bigr\Vert ^{2}+\frac{1}{2}(1-b_{k}) \bigl\Vert \delta _{t}u_{N}^{k+ \frac{1}{2}} \bigr\Vert ^{2}, \end{aligned}
(11)

and

$$b_{k}\bigl(\psi ,\delta _{t}u_{N}^{k+\frac{1}{2}} \bigr)\leqslant b_{k} \biggl( \Vert \psi \Vert ^{2}+ \frac{1}{4} \bigl\Vert \delta _{t}u_{N}^{k+\frac{1}{2}} \bigr\Vert ^{2} \biggr),$$
(12)

respectively.

Substituting (8)–(12) into (7), we obtain

\begin{aligned} &\tau \sum_{j=0}^{k}b_{j} \bigl\Vert \delta _{t}u_{N}^{k-j+\frac{1}{2}} \bigr\Vert ^{2}+ \gamma _{0} \bigl\Vert \partial _{x} u_{N}^{k+1} \bigr\Vert _{p(x)}^{2}+\gamma _{0} \bigl\Vert u_{N} ^{k+1} \bigr\Vert _{q(x)}^{2} \\ &\quad \leqslant \tau \sum_{j=0}^{k-1}b_{j} \bigl\Vert \delta _{t}u_{N}^{k-1-j+ \frac{1}{2}} \bigr\Vert ^{2}+\gamma _{0} \bigl\Vert \partial _{x} u_{N}^{k} \bigr\Vert _{p(x)}^{2}+ \gamma _{0} \bigl\Vert u_{N}^{k} \bigr\Vert _{q(x)}^{2}+2\tau b_{k} \Vert \psi \Vert ^{2} \\ &\qquad {} +\frac{2\tau \gamma _{0}^{2}}{b_{k}} \bigl\Vert g^{k+\frac{1}{2}} \bigr\Vert ^{2}. \end{aligned}
(13)

Let

$$F^{0}=\gamma _{0} \bigl\Vert \partial _{x} u_{N}^{0} \bigr\Vert _{p(x)}^{2}+\gamma _{0} \bigl\Vert u _{N}^{0} \bigr\Vert _{q(x)}^{2}$$

and

$$F^{k+1}=\tau \sum_{j=0}^{k}b_{j} \bigl\Vert \delta _{t}u_{N}^{k-j+\frac{1}{2}} \bigr\Vert ^{2}+\gamma _{0} \bigl\Vert \partial _{x} u_{N}^{k+1} \bigr\Vert _{p(x)}^{2}+\gamma _{0} \bigl\Vert u _{N}^{k+1} \bigr\Vert _{q(x)}^{2},$$

$$0\leqslant k\leqslant M-1$$.

By (13) we have

$$F^{k+1}\leqslant F^{k}+2\tau b_{k} \Vert \psi \Vert ^{2}+\frac{2\tau \gamma _{0}^{2}}{b_{k}} \bigl\Vert g^{k+\frac{1}{2}} \bigr\Vert ^{2},$$

viz.,

$$F^{k+1}\leqslant F^{0}+\tau \sum _{j=0}^{k}\frac{2\gamma _{0}^{2}}{b _{j}} \bigl\Vert g^{j+\frac{1}{2}} \bigr\Vert ^{2}+2\tau (k+1)^{2-\gamma } \Vert \psi \Vert ^{2}.$$
(14)

Since $$b_{j}\geqslant (2-\gamma )(j+1)^{1-\gamma }$$, $$\varGamma (s+1)=s \varGamma (s)$$, and $$\gamma _{0}=\varGamma (3-\gamma )\tau ^{\gamma -1}$$, we obtain

$$b_{j}^{-1}\leqslant \varGamma (2-\gamma ) \frac{T^{\gamma -1}}{\gamma _{0}}, \tau (k+1)^{2-\gamma }\leqslant \frac{\gamma _{0}T^{2-\gamma }}{\varGamma (3-\gamma )}.$$
(15)

Substituting (15) into (14) yields

$$F^{k+1}\leqslant F^{0}+2\varGamma (2-\gamma )T^{\gamma -1} \gamma _{0} \tau \sum_{j=0}^{k} \bigl\Vert g^{j+\frac{1}{2}} \bigr\Vert ^{2}+\frac{2\gamma _{0}T^{2- \gamma }}{\varGamma (3-\gamma )} \Vert \psi \Vert ^{2}.$$

Then we deduce that

\begin{aligned} & \bigl\Vert \partial _{x} u_{N}^{k+1} \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u_{N}^{k+1} \bigr\Vert _{q(x)}^{2} \\ &\quad \leqslant \bigl\Vert \partial _{x} u_{N}^{0} \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u_{N}^{0} \bigr\Vert _{q(x)} ^{2}+2\varGamma (2-\gamma )T^{\gamma -1} \tau \sum_{j=0}^{k} \bigl\Vert g^{j+ \frac{1}{2}} \bigr\Vert ^{2} +\frac{2T^{2-\gamma }}{\varGamma (3-\gamma )} \Vert \psi \Vert ^{2}. \end{aligned}

The proof is completed. □

Now we analyze the convergence of the fully discrete scheme (5).

### Theorem 2

Let u be the solution of (1)(3), and let $$u_{N}^{k}$$ ($$0 \leqslant k \leqslant M$$) be the solutions of (5) with the initial condition $$u_{N}^{0}=\varPi _{N}^{1,0}u_{0}$$. Suppose that $$u\in C^{3} ([0,T];H^{1}(\varLambda ) )\cap L^{\infty } (0,T;H ^{m}(\varLambda ) )$$, $${}^{C}_{0}{D}_{t}^{\gamma }u\in L^{ \infty } (0,T;H^{m}(\varLambda ) )$$, $$\psi \in H^{m}(\varLambda )$$, $$m\geqslant 1$$. Then for $$1\leqslant k\leqslant M$$, we have

\begin{aligned} & \bigl\Vert \partial _{x} \bigl(u(t_{k})-u_{N}^{k} \bigr) \bigr\Vert _{p(x)}^{2}+ \bigl\Vert u(t _{k})-u_{N}^{k} \bigr\Vert _{q(x)}^{2} \\ &\quad \leqslant c\varGamma (2-\gamma )T^{\gamma } \bigl(N^{2-2m} \bigl\Vert {}^{C}_{0}{D}_{t}^{\gamma }u \bigr\Vert _{L^{\infty }(0,T;H^{m}(\varLambda ))}^{2} +\tau ^{6-2\gamma } \Vert u \Vert _{C^{3}([0,T];H^{1}(\varLambda ))}^{2} \bigr) \\ &\qquad {}+\frac{\mathit{cT}^{2-\gamma }}{\varGamma (3-\gamma )}N^{2-2m} \Vert \psi \Vert _{m}^{2}+cN^{2-2m} \Vert u \Vert _{L^{\infty }(0,T;H^{m}(\varLambda ))}^{2}, \end{aligned}

where c is a positive constant independent of N and γ.

### Proof

Let $$e_{N}^{j}=u(t_{j})-u_{N}^{j}=\widetilde{e}_{N}^{j}+\widehat{e} _{N}^{j}$$, $$\widetilde{e}_{N}^{j}=\varPi _{N}^{1,0}u(t_{j})-u_{N}^{j}$$, $$\widehat{e}_{N}^{j}=u(t_{j})-\varPi _{N}^{1,0}u(t_{j})$$. Obviously, $$\widetilde{e}_{N}^{0}=0$$, $$e_{N}^{0}=u_{0}-\varPi _{N}^{1,0}u_{0}= \widehat{e}_{N}^{0}$$. By the original equation (1) and the fully discrete scheme (5) we get the error equation

\begin{aligned} &\bigl(\delta _{t} e_{N}^{k+\frac{1}{2}},v_{N} \bigr)+\gamma _{0}\bigl(p(x)\partial _{x} e_{N}^{k+\frac{1}{2}},\partial _{x} v_{N}\bigr)+ \gamma _{0}\bigl(q(x)e_{N}^{k+ \frac{1}{2}},v_{N} \bigr) \\ &\quad =\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl(\delta _{t}e_{N}^{k-1-j+\frac{1}{2}},v _{N} \bigr)+\gamma _{0}\bigl(R_{t}\bigl(u^{k+\frac{1}{2}} \bigr),v_{N}\bigr),\quad \forall v_{N} \in \mathbb{P}_{N}^{0}, \end{aligned}

where $$R_{t}(u^{k+\frac{1}{2}})=L_{t}^{\gamma }u^{k+\frac{1}{2}}- \frac{1}{2} ({}^{C}_{0}{D}_{t}^{\gamma }u(t_{k+1})+ {}^{C}_{0}{D}_{t}^{\gamma }u(t_{k}) )$$.

By the definition of the projection operator $$\varPi _{N}^{1,0}$$ we have

\begin{aligned} &\bigl(\delta _{t} \widetilde{e}_{N}^{k+\frac{1}{2}},v_{N} \bigr)+\gamma _{0}\bigl(p(x) \partial _{x} \widetilde{e}_{N}^{k+\frac{1}{2}},\partial _{x} v_{N}\bigr)+ \gamma _{0}\bigl(q(x)\widetilde{e}_{N}^{k+\frac{1}{2}},v_{N} \bigr) \\ &\quad =\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl(\delta _{t}\widetilde{e}_{N}^{k-1-j+ \frac{1}{2}},v_{N} \bigr)+\gamma _{0}\bigl(R_{t}\bigl(u^{k+\frac{1}{2}} \bigr),v_{N}\bigr)+\sum_{i=1}^{2}R_{i}^{k+1}, \quad \forall v_{N}\in \mathbb{P}_{N}^{0}, \end{aligned}
(16)

where

\begin{aligned} &R_{1}^{k+1}=- \Biggl(\delta _{t} \widehat{e}_{N}^{k+\frac{1}{2}}-\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \delta _{t}\widehat{e}_{N}^{k-1-j+ \frac{1}{2}}-b_{k} \bigl(\psi -\varPi _{N}^{1,0}\psi \bigr), v_{N} \Biggr), \\ &R_{2}^{k+1}=-b_{k}\bigl(\psi -\varPi _{N}^{1,0}\psi ,v_{N}\bigr). \end{aligned}

Since

\begin{aligned} &\delta _{t}\widehat{e}_{N}^{k+\frac{1}{2}}-\sum _{j=0}^{k-1}(b_{j}-b _{j+1})\delta _{t}\widehat{e}_{N}^{k-1-j+\frac{1}{2}}-b_{k}\bigl( \psi -\varPi _{N}^{1,0}\psi \bigr) \\ &\quad =\gamma _{0} L_{t}^{\gamma }\widehat{e}_{N}^{k+\frac{1}{2}} \\ &\quad =\frac{\gamma _{0}}{2} \bigl({}^{C}_{0}{D}_{t}^{\gamma } \widehat{e}_{N}(t_{k+1})+{}^{C}_{0}{D}_{t}^{\gamma } \widehat{e}_{N}(t_{k}) \bigr)+\gamma _{0} R_{t}\bigl(\widehat{e}_{N}^{k+ \frac{1}{2}}\bigr), \end{aligned}

by Lemmas 2, 3, and 4 we obtain

\begin{aligned}& \begin{aligned}[b] \bigl\vert R_{1}^{k+1} \bigr\vert &\leqslant \frac{c\gamma _{0}^{2}}{b_{k}} \bigl(N^{2-2m} \bigl\Vert {}^{C}_{0}{D}_{t}^{\gamma }u \bigr\Vert _{L^{\infty }(0,T;H^{m}(\varLambda ))}^{2} +\tau ^{6-2\gamma } \Vert u \Vert _{C^{3}([0,T];H^{1}(\varLambda ))}^{2} \bigr) \\ &\quad {}+\frac{1}{6}b_{k} \Vert v_{N} \Vert ^{2}, \end{aligned} \end{aligned}
(17)
\begin{aligned}& \bigl\vert R_{2}^{k+1} \bigr\vert \leqslant \mathit{cb}_{k}N^{2-2m} \Vert \psi \Vert _{m}^{2}+ \frac{1}{6}b_{k} \Vert v_{N} \Vert ^{2}, \end{aligned}
(18)

and

$$\gamma _{0}\bigl(R_{t}\bigl(u^{k+\frac{1}{2}} \bigr),v_{N}\bigr) \leqslant \frac{c\gamma _{0}^{2}}{b_{k}}\tau ^{6-2\gamma } \Vert u \Vert _{C^{3}([0,T];L^{2}(\varLambda ))} ^{2}+\frac{1}{6}b_{k} \Vert v_{N} \Vert ^{2},$$
(19)

respectively.

Using inequality (6), Hölder’s inequality, and Young’s inequality, we get

\begin{aligned} &\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl(\delta _{t}\widetilde{e}_{N}^{k-1-j+ \frac{1}{2}},v_{N} \bigr) \\ &\quad \leqslant \frac{1}{2}\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl( \bigl\Vert \delta _{t} \widetilde{e}_{N}^{k-1-j+\frac{1}{2}} \bigr\Vert ^{2}+ \Vert v_{N} \Vert ^{2} \bigr) \\ &\quad =\frac{1}{2}\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl\Vert \delta _{t} \widetilde{e}_{N}^{k-1-j+\frac{1}{2}} \bigr\Vert ^{2}+\frac{1}{2}(1-b_{k}) \Vert v _{N} \Vert ^{2}. \end{aligned}
(20)

Substituting inequalities (17)–(20) into (16) and taking $$v_{N}=\delta _{t}\widetilde{e}_{N}^{k+ \frac{1}{2}}$$, we deduce that

\begin{aligned} &\tau \sum_{j=0}^{k}b_{j} \bigl\Vert \delta _{t}\widetilde{e}_{N}^{k-j+ \frac{1}{2}} \bigr\Vert ^{2}+\gamma _{0} \bigl\Vert \partial _{x} \widetilde{e}_{N}^{k+1} \bigr\Vert _{p(x)}^{2}+\gamma _{0} \bigl\Vert \widetilde{e}_{N}^{k+1} \bigr\Vert _{q(x)}^{2} \\ &\quad \leqslant \tau \sum_{j=0}^{k-1}b_{j} \bigl\Vert \delta _{t}\widetilde{e}_{N} ^{k-1-j+\frac{1}{2}} \bigr\Vert ^{2}+\gamma _{0} \bigl\Vert \partial _{x} \widetilde{e}_{N} ^{k} \bigr\Vert _{p(x)}^{2}+\gamma _{0} \bigl\Vert \widetilde{e}_{N}^{k} \bigr\Vert _{q(x)}^{2}+2 \tau b_{k}cN^{2-2m} \Vert \psi \Vert _{m}^{2} \\ &\qquad {}+\frac{2\tau \gamma _{0}^{2}}{b_{k}}c \bigl(N^{2-2m} \bigl\Vert {}^{C}_{0}{D}_{t}^{\gamma }u \bigr\Vert _{L^{\infty }(0,T;H^{m}(\varLambda ))}^{2}+\tau ^{6-2\gamma } \Vert u \Vert _{C^{3}([0,T],H^{1}(\varLambda ))}^{2} \bigr). \end{aligned}

Analogously to the proof of Theorem 1, we obtain

\begin{aligned} & \bigl\Vert \partial _{x} \widetilde{e}_{N}^{k+1} \bigr\Vert _{p(x)}^{2}+ \bigl\Vert \widetilde{e} _{N}^{k+1} \bigr\Vert _{q(x)}^{2} \\ &\quad \leqslant c\varGamma (2-\gamma )T^{\gamma } \bigl(N^{2-2m} \bigl\Vert {}^{C}_{0}{D}_{t}^{\gamma }u \bigr\Vert _{L^{\infty }(0,T;H^{m}(\varLambda ))}^{2}+\tau ^{6-2\gamma } \Vert u \Vert _{C^{3}([0,T];H^{1}(\varLambda ))}^{2} \bigr) \\ &\qquad {}+\frac{\mathit{cT}^{2-\gamma }}{\varGamma (3-\gamma )}N^{2-2m} \Vert \psi \Vert _{m}^{2}. \end{aligned}

Finally, applying the triangular inequality $$\|e_{N}^{k+1}\|\leqslant \|\widetilde{e}_{N}^{k+1}\|+\|\widehat{e}_{N}^{k+1}\|$$ and Lemmas 2 and 3, we complete the proof. □

## 4 The second fully discrete spectral scheme

From Lemma 4 we can see that the temporal accuracy of the scheme (5) is of order $$3-\gamma$$. In this section, we present the other fully discrete scheme based on the approximation of the Riemann–Liouville integral operator, which has second-order temporal accuracy. We also derive the stability and convergence of the scheme.

### 4.1 Scheme II

The second fully discrete spectral scheme is based on the fractional integro-differential equation, an equivalent form of the original equation.

By Definition 2 we can see that

$${}^{C}_{0}{D}_{t}^{\gamma }u(x,t) = \frac{1}{\varGamma (1-( \gamma -1))} \int _{0}^{t}(t-s)^{1-\gamma } \partial _{s} (\partial _{s} u )\,\mathrm{d}s ={}^{C}_{0}{D}_{t}^{\gamma -1} \bigl(\partial _{t} u(x,t) \bigr),$$

and by (4) we obtain

$${}_{0}{I}_{t}^{\gamma -1}{}^{C}_{0}{D}_{t}^{\gamma }u(x,t)= \partial _{t} u(x,t)-\psi (x).$$

Therefore an equivalent form of the original equation (1) is

$$\partial _{t} u(x,t)={}_{0}{I}_{t}^{\alpha } \mathcal{L}u(x,t)+f(x,t)+ \psi (x),$$

where $$\alpha =\gamma -1$$ and $$f(x,t)={}_{0}{I}_{t}^{\alpha }g(x,t)$$.

There is no loss of generality in assuming that $$u(x,0)=\varphi (x) \equiv 0$$. If $$u(x,0)=\varphi (x)\neq 0$$, we can consider the equation for $$v(x,t)=u(x,t)-\varphi (x)$$. For the discretization of the fractional integral operator $${}_{0}{I}_{t}^{\alpha }$$, we can continuously extend the solution $$u(x,t)$$ to be zero for $$t<0$$. We use the weighted and shifted difference operator as in [36] (p. 9), viz.,

$${}_{0}{I}_{t}^{\alpha }u(\cdot ,t_{k+1})=\tau ^{\alpha }\sum_{j=0}^{k+1} \lambda _{j}^{(\alpha )}u(\cdot ,t_{k+1-j})+\mathrm{O}\bigl( \tau ^{2}\bigr),$$
(21)

where

$$\lambda _{0}^{(\alpha )}= \biggl(1- \frac{\alpha }{2} \biggr)\omega _{0} ^{(\alpha )}, \qquad \lambda _{j}^{(\alpha )}= \biggl(1-\frac{\alpha }{2} \biggr) \omega _{j}^{(\alpha )}+\frac{\alpha }{2}\omega _{j-1}^{(\alpha )},\quad j\geqslant 1,$$
(22)

and $$\omega _{j}^{(\alpha )}=(-1)^{j}\binom{-\alpha }{j}$$ for $$j\geqslant 0$$.

### Remark 1

We refer to [42] (p. 3) for the details of the second-order weighted and shifted Grünwald difference (WSGD) operator, and (21) is derived analogously.

For simplicity, we denote

$$\mathrm{I}_{\tau }^{\alpha }u^{k+1}=\tau ^{\alpha } \sum_{j=0}^{k+1} \lambda _{j}^{(\alpha )}u^{k+1-j},$$

based on the Crank–Nicolson-type discretization. The second fully discrete spectral scheme (Scheme II) is: find $$u_{N}^{k+1}\in \mathbb{P}_{N}^{0}$$, $$k=0,1,\ldots ,M-1$$, such that

\begin{aligned} \bigl(\delta _{t} u_{N}^{k+\frac{1}{2}},v_{N} \bigr) &=-\frac{1}{2} \bigl(p(x) \mathrm{I}_{\tau }^{\alpha } \partial _{x}\bigl(u_{N}^{k+1}+u_{N}^{k} \bigr), \partial _{x} v_{N} \bigr)-\frac{1}{2} \bigl(q(x)\mathrm{I}_{\tau }^{ \alpha }\bigl(u_{N}^{k+1}+u_{N}^{k} \bigr),v_{N} \bigr) \\ &\quad {}+\bigl(f^{k+\frac{1}{2}},v_{N}\bigr)+(\psi ,v_{N}),\quad \forall v_{N}\in \mathbb{P}_{N}^{0}. \end{aligned}
(23)

For given $$u_{N}^{j}$$, $$j=0,1,\ldots ,k$$, the Lax–Milgram lemma guarantees the well-posedness of problem (23).

### 4.2 Stability and convergence of scheme (23)

To analyze the stability and convergence of the fully discrete scheme (23), we recall and introduce some useful tools.

### Lemma 5

(Discrete Grönwall’s inequality [43] (p. 369))

Let ν, B, and $$a_{\mu }$$, $$b_{\mu }$$, $$c_{\mu }$$, $$\gamma _{ \mu }$$ for integers $$\mu \geqslant 0$$ be nonnegative numbers such that

$$a_{n}+\nu \sum_{\mu =0}^{n} b_{\mu }\leqslant \nu \sum_{\mu =0}^{n} \gamma _{\mu }a_{\mu }+\nu \sum_{\mu =0} ^{n} c_{\mu }+B, \quad n\geqslant 0.$$

Suppose that $$\nu \gamma _{\mu }<1$$ for all μ, and set $$\sigma _{\mu }\equiv (1-\nu \gamma _{\mu })^{-1}$$. Then

$$a_{n}+\nu \sum_{\mu =0}^{n} b_{\mu }\leqslant \exp \Biggl( \nu \sum_{\mu =0}^{n} \sigma _{\mu }\gamma _{\mu } \Biggr) \Biggl\{ \nu \sum _{\mu =0}^{n} c_{\mu }+B \Biggr\} ,\quad n\geqslant 0.$$

For the coefficients of $$\{\lambda _{n}^{(\alpha )}\}_{n=0}^{\infty }$$, we have the following result.

### Lemma 6

([36] (p. 9))

Let $$\{\lambda _{n}^{(\alpha )}\}_{n=0}^{\infty }$$ be the series defined in (22). For any positive integer l and real vector $$( v_{1},v_{2},\ldots, v_{l})\in \mathbb{R}^{l}$$, we have that

$$\sum_{i=0}^{l-1} \Biggl(\sum _{j=0}^{i} \lambda _{j}^{(\alpha )}v_{i+1-j} \Biggr)v_{i+1}\geqslant 0.$$

We immediately get the following analogous result via the lemma.

### Lemma 7

([44] (p. 386))

Let $$r(x)$$ be a nonnegative continuous function. Then for any positive integer l and real continuous functions $$v_{1}(x)$$, $$v_{2}(x)$$, ..., $$v _{l}(x)$$, we have

$$\sum_{i=0}^{l-1} \Biggl(r(x)\sum_{j=0}^{i} \lambda _{j}^{( \alpha )}v_{i+1-j}(x),v_{i+1}(x) \Biggr)\geqslant 0,$$

where $$(\cdot ,\cdot )$$ denotes the inner product on Λ.

We have the following result for the stability of the fully discrete scheme (23).

### Theorem 3

Suppose that $$\tau <1/2$$. The fully discrete scheme (23) is stable, viz., for $$1\leqslant n\leqslant M$$,

$$\bigl\Vert u_{N}^{n} \bigr\Vert ^{2} \leqslant \exp \biggl({\frac{2T}{1-2\tau }} \biggr) \Biggl( \tau \sum _{k=0}^{n-1} \bigl\Vert f^{k+\frac{1}{2}} \bigr\Vert ^{2}+\tau \sum_{k=0}^{n-1} \Vert \psi \Vert ^{2} \Biggr).$$

### Proof

Taking $$v_{N}=u_{N}^{k+1}+u_{N}^{k}$$ in (23) yields

\begin{aligned} &\frac{1}{\tau } \bigl( \bigl\Vert u_{N}^{k+1} \bigr\Vert ^{2}- \bigl\Vert u_{N}^{k} \bigr\Vert ^{2} \bigr) \\ &\quad =-\frac{\tau ^{\alpha }}{2} \Biggl(p(x)\sum_{j=0}^{k} \lambda _{j}^{( \alpha )}\partial _{x} \bigl(u_{N}^{k+1-j}+u_{N}^{k-j} \bigr), \partial _{x} \bigl(u_{N}^{k+1}+u_{N}^{k} \bigr) \Biggr) \\ &\qquad {}-\frac{\tau ^{\alpha }}{2} \Biggl(q(x)\sum_{j=0}^{k} \lambda _{j}^{( \alpha )} \bigl(u_{N}^{k+1-j}+ u_{N}^{k-j} \bigr),u_{N}^{k+1}+u_{N} ^{k} \Biggr) \\ &\qquad {}+\bigl(f^{k+\frac{1}{2}},u_{N}^{k+1}+u_{N}^{k} \bigr)+\bigl(\psi ,u_{N}^{k+1}+u_{N} ^{k}\bigr). \end{aligned}
(24)

For the last two terms on the right-hand side of (24), using Hölder’s and Young’s inequalities, we have

$$\bigl(f^{k+\frac{1}{2}},u_{N}^{k+1}+u_{N}^{k} \bigr) \leqslant \bigl\Vert f^{k+ \frac{1}{2}} \bigr\Vert ^{2}+ \frac{1}{2} \bigl\Vert u_{N}^{k+1} \bigr\Vert ^{2}+\frac{1}{2} \bigl\Vert u_{N} ^{k} \bigr\Vert ^{2}$$
(25)

and

$$\bigl(\psi ,u_{N}^{k+1}+u_{N}^{k} \bigr) \leqslant \Vert \psi \Vert ^{2}+\frac{1}{2} \bigl\Vert u _{N}^{k+1} \bigr\Vert ^{2}+ \frac{1}{2} \bigl\Vert u_{N}^{k} \bigr\Vert ^{2},$$
(26)

respectively.

Substituting (25) and (26) into (24), summing for k from 0 to $$n-1$$, and using Lemma 7, we deduce that

\begin{aligned} \bigl\Vert u_{N}^{n} \bigr\Vert ^{2} & \leqslant -\frac{\tau ^{\alpha +1}}{2}\sum_{k=0} ^{n-1} \Biggl(p(x)\sum_{j=0}^{k}\lambda _{j}^{(\alpha )}\partial _{x} \bigl(u_{N}^{k+1-j}+u_{N}^{k-j} \bigr),\partial _{x} \bigl(u_{N} ^{k+1}+u_{N}^{k} \bigr) \Biggr) \\ &\quad {} -\frac{\tau ^{\alpha +1}}{2}\sum_{k=0}^{n-1} \Biggl(q(x)\sum_{j=0} ^{k}\lambda _{j}^{(\alpha )} \bigl( u_{N}^{k+1-j}+ u_{N}^{k-j} \bigr), u_{N}^{k+1}+u_{N}^{k} \Biggr) \\ &\quad {} +\tau \sum_{k=0}^{n-1} \bigl\Vert u_{N}^{k+1} \bigr\Vert ^{2}+\tau \sum _{k=0}^{n-1} \bigl\Vert u_{N}^{k} \bigr\Vert ^{2}+\tau \sum_{k=0}^{n-1} \bigl\Vert f^{k+\frac{1}{2}} \bigr\Vert ^{2}+ \tau \sum _{k=0}^{n-1} \Vert \psi \Vert ^{2} \\ &\leqslant 2\tau \sum_{k=0}^{n} \bigl\Vert u_{N}^{k} \bigr\Vert ^{2}+\tau \sum _{k=0}^{n-1} \bigl\Vert f^{k+\frac{1}{2}} \bigr\Vert ^{2}+\tau \sum_{k=0}^{n-1} \Vert \psi \Vert ^{2}. \end{aligned}

Thus by Lemma 5 we get

$$\bigl\Vert u_{N}^{n} \bigr\Vert ^{2} \leqslant \exp \biggl({\frac{2T}{1-2\tau }} \biggr) \Biggl(\tau \sum _{k=0}^{n-1} \bigl\Vert f^{k+\frac{1}{2}} \bigr\Vert ^{2}+\tau \sum_{k=0} ^{n-1} \Vert \psi \Vert ^{2} \Biggr).$$

The proof of the theorem is completed. □

### Remark 2

The restriction $$\tau <1/2$$ can be removed by using a delicate analysis as in [34].

Now we consider the error estimate of the fully discrete scheme (23).

### Theorem 4

Let u be the solution of (1)(3), let $$\{u_{N}^{k}\} _{k=0}^{M}$$ be the solutions of problem (23) with the initial condition $$u_{N}^{0}=\varPi _{N}^{1,0} u_{0}(x)$$. Assume that $$u \in L^{\infty } (0,T;H^{m}(\varLambda ) )$$, $$\frac{\partial u}{ \partial t}\in L^{2} (0,T;H^{m}(\varLambda ) )$$, $$m\geqslant 1$$, and $$\tau <1/2$$. Then we have

\begin{aligned} \bigl\Vert u(t_{k})-u_{N}^{k} \bigr\Vert &\leqslant \exp \biggl({\frac{2T}{1-2\tau }} \biggr) \bigl(c_{u}\tau ^{4}+cN^{2-2m} \Vert \partial _{t}u \Vert _{L^{2}(0,T;H^{m}(\varLambda ))}^{2} \bigr) \\ &\quad {}+cN^{2-2m} \Vert u \Vert _{L^{\infty }(0,T;H^{m}(\varLambda ))}^{2},\quad 1 \leqslant k\leqslant M, \end{aligned}

where c is a positive constant independent of N and τ, and $$c_{u}$$ is a positive constant depending only on u.

### Proof

Setting $$e_{N}^{j}=u^{j}-u_{N}^{j}=\widetilde{e}_{N}^{j}+\widehat{e} _{N}^{j}$$, $$\widetilde{e}_{N}^{j}=\varPi _{N}^{1,0}u^{j}-u_{N}^{j}$$, $$\widehat{e}_{N}^{j}=u^{j}-\varPi _{N}^{1,0}u^{j}$$, particularly, $$\widetilde{e}_{N}^{0}=0$$ and $$e_{N}^{0}=u^{0}-\varPi _{N}^{1,0}u^{0}= \widehat{e}_{N}^{0}$$, by (1) and (23) we get

\begin{aligned} \bigl(\delta _{t} \widetilde{e}_{N}^{k+\frac{1}{2}},v_{N} \bigr) = &-\frac{ \tau ^{\alpha }}{2} \Biggl(p(x)\sum_{j=0}^{k} \lambda _{j}^{(\alpha )} \partial _{x} \bigl(e_{N}^{k+1-j}+e_{N}^{k-j} \bigr), \partial _{x} v_{N} \Biggr) \\ &-\frac{\tau ^{\alpha }}{2} \Biggl(q(x)\sum_{j=0}^{k} \lambda _{j}^{( \alpha )} \bigl( e_{N}^{k+1-j}+ e_{N}^{k-j} \bigr),v_{N} \Biggr) \\ & -\bigl(\delta _{t} \widehat{e}_{N}^{k+\frac{1}{2}},v_{N} \bigr)+\bigl(R_{N}^{k+1},v _{N}\bigr),\quad \forall v_{N}\in \mathbb{P}_{N}^{0}, \end{aligned}
(27)

where

\begin{aligned} R_{N}^{k+1}= &\delta _{t}u^{k+\frac{1}{2}}-\partial _{t}u^{k+\frac{1}{2}} +{}_{0}{I}_{t}^{\alpha } \mathcal{L}u^{k+\frac{1}{2}} - \frac{1}{2}\partial _{x} \bigl(p(x)\mathrm{I}_{\tau }^{\alpha }\partial _{x} \bigl(u^{k+1}+u^{k}\bigr) \bigr) \\ &+\frac{1}{2}q(x)\mathrm{I}_{\tau }^{\alpha } \bigl(u^{k+1}+u^{k}\bigr). \end{aligned}

By the Taylor formula and (21) we have $$|R_{N}^{k+1}|\leqslant c_{u}\tau ^{2}$$.

Taking $$v_{N}=\widetilde{e}_{N}^{k+1}+\widetilde{e}_{N}^{k}$$ in (27) yields

\begin{aligned} &\frac{1}{\tau } \bigl( \bigl\Vert \widetilde{e}_{N}^{k+1} \bigr\Vert ^{2}- \bigl\Vert \widetilde{e}_{N}^{k} \bigr\Vert ^{2} \bigr) \\ &\quad =-\frac{\tau ^{\alpha }}{2} \Biggl(p(x)\sum_{j=0}^{k} \lambda _{j}^{( \alpha )}\partial _{x} \bigl(e_{N}^{k+1-j}+e_{N}^{k-j} \bigr), \partial _{x} \bigl(\widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k} \bigr) \Biggr) \\ &\qquad {}-\frac{\tau ^{\alpha }}{2} \Biggl(q(x)\sum_{j=0}^{k} \lambda _{j}^{( \alpha )} \bigl(e_{N}^{k+1-j}+ e_{N}^{k-j} \bigr),\widetilde{e}_{N} ^{k+1}+\widetilde{e}_{N}^{k} \Biggr) \\ &\qquad {}-\bigl(\delta _{t} \widehat{e}_{N}^{k+\frac{1}{2}}, \widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k} \bigr)+\bigl(R_{\tau }^{k+1},\widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k}\bigr). \end{aligned}
(28)

For the last two terms of the right-hand side of (28), by Hölder’s and Young’s inequalities we have

\begin{aligned} &{-}\bigl(\delta _{t}\widehat{e}_{N}^{k+\frac{1}{2}}, \widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k} \bigr) \\ &\quad =- \biggl(\frac{1}{\tau } \int _{t_{k}}^{t_{k+1}}\partial _{t}\widehat{e} _{N}{\,\mathrm{d}}t,\widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k} \biggr) \\ &\quad \leqslant \frac{1}{\tau } \int _{t_{k}}^{t_{k+1}} \Vert \partial _{t} \widehat{e}_{N} \Vert ^{2}{\,\mathrm{d}}t+\frac{1}{2} \bigl\Vert \widetilde{e}_{N}^{k+1} \bigr\Vert ^{2} +\frac{1}{2} \bigl\Vert \widetilde{e}_{N}^{k} \bigr\Vert ^{2} \end{aligned}
(29)

and

$$\bigl(R_{\tau }^{k+1},\widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k}\bigr) \leqslant \bigl\Vert R_{\tau }^{k+1} \bigr\Vert ^{2}+\frac{1}{2} \bigl\Vert \widetilde{e}_{N}^{k+1} \bigr\Vert ^{2}+\frac{1}{2} \bigl\Vert \widetilde{e}_{N}^{k} \bigr\Vert ^{2},$$
(30)

respectively.

Substituting (29) and (30) into (28), summing for k from 0 to $$n-1$$, and using Lemmas 2 and 7, we have

\begin{aligned} \bigl\Vert \widetilde{e}_{N}^{n} \bigr\Vert ^{2} &\leqslant -\frac{\tau ^{\alpha +1}}{2} \sum_{k=0}^{n-1} \Biggl(p(x)\sum_{j=0}^{k}\lambda _{j}^{(\alpha )} \partial _{x} \bigl( \widetilde{e}_{N}^{k+1-j} +\widetilde{e}_{N}^{k-j} \bigr), \partial _{x} \bigl(\widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k} \bigr) \Biggr) \\ &\quad {}-\frac{\tau ^{\alpha +1}}{2}\sum_{k=0}^{n-1} \Biggl(q(x)\sum_{j=0}^{k} \lambda _{j}^{(\alpha )} \bigl(\widetilde{e}_{N}^{k+1-j}+ \widetilde{e}_{N}^{k-j} \bigr), \widetilde{e}_{N}^{k+1}+ \widetilde{e}_{N}^{k} \Biggr) \\ &\quad {}+ \int _{0}^{t_{n}} \Vert \partial _{t} \widehat{e}_{N} \Vert ^{2}{\,\mathrm{d}}t+ \tau \sum _{k=0}^{n-1} \bigl\Vert \widetilde{e}_{N}^{k+1} \bigr\Vert ^{2}+\tau \sum_{k=0} ^{n-1} \bigl\Vert \widetilde{e}_{N}^{k} \bigr\Vert ^{2}+\tau \sum_{k=0}^{n-1} \bigl\Vert R_{\tau } ^{k+1} \bigr\Vert ^{2} \\ &\leqslant 2\tau \sum_{k=0}^{n} \bigl\Vert \widetilde{e}_{N}^{k} \bigr\Vert ^{2}+cN^{2-2m} \int _{0}^{T} \Vert \partial _{t} u \Vert _{m}^{2}{\,\mathrm{d}}t+c_{u}\tau ^{4}. \end{aligned}

By Lemma 5 we obtain

$$\bigl\Vert \widetilde{e}_{N}^{n} \bigr\Vert ^{2} \leqslant \exp \biggl({\frac{2T}{1-2 \tau }} \biggr) \bigl(c_{u}\tau ^{4}+cN^{2-2m} \Vert \partial _{t}u \Vert _{L^{2}(0,T;H ^{m}(\varLambda ))}^{2} \bigr).$$

Finally, using the triangular inequality $$\|e_{N}^{n}\|\leqslant \| \widetilde{e}_{N}^{n}\|+\|\widehat{e}_{N}^{n}\|$$ and Lemmas 2 and 3, we get the error estimate.

The proof is completed. □

## 5 Numerical experiments

In this section, we present numerical experiments to verify the theoretical results of two schemes.

### 5.1 Implementation

For the sake of implementation of two fully discrete schemes, all the integrals in (5) and (23) are evaluated by numerical quadratures from the practical and operational points of view as in [45]. Since the integrands in these integrals are polynomials with respect to x, we use the Legendre–Gauss–Lobatto quadrature to calculate these integrals.

Let $$L_{N}(x)$$ be the Legendre polynomials of degree N, and let $$\{x_{j}\}_{j=0}^{N}$$ be the zeros of $$(1-x^{2})L_{N}^{\prime }(x)$$. Then $$\{x_{j},\omega _{j}\}_{j=0}^{N}$$ are referred to as the Legendre–Gauss–Lobatto quadrature nodes and weights, and the weights are

$$\omega _{j}=\frac{2}{N(N+1)}\frac{1}{[L_{N}(x_{j})]^{2}},\quad 0\leqslant j \leqslant N.$$

$$\int _{-1}^{1}\varphi (x)\,\mathrm{d}x=\sum _{j=0}^{N} \varphi (x_{j}) \omega _{j}, \quad \forall \varphi \in \mathbb{P}_{2N-1}(\varLambda ).$$

Define the discrete inner product

$$(\phi ,\psi )_{N}=\sum_{j=0}^{N} \phi (x_{j})\psi (x_{j})\omega _{j}, \quad \forall \phi , \psi \in C^{0}(\overline{\varLambda }),$$

and the discrete norm $$\|\phi \|_{N}:=(\phi ,\phi )_{N}^{1/2}$$.

The function $$u_{N}^{k}$$ is expressed in terms of the Lagrangian interpolants $$h_{j}(x)$$ based on the Legendre–Gauss–Lobatto points $$x_{j}$$, $$j=0,1,\ldots ,N$$,

$$u_{N}^{k}(x)=\sum_{j=0}^{N} \widetilde{u}_{j}^{k}h_{j}(x),$$

where

$$\widetilde{u}_{j}^{k}:=u_{N}^{k}(x_{j}), \qquad h_{j}(x_{i})=\delta _{ij}, \quad i,j=0,1, \ldots ,N,$$

and $$\delta _{\mathit{ij}}$$ is the Kronecker delta symbol.

Letting $$\alpha =(\tau \gamma _{0})/2$$, we can reform the first scheme (5) as

$$\bigl(u_{N}^{k+1},v_{N} \bigr)_{N}+\alpha \bigl(p(x)\partial _{x}u_{N}^{k+1}, \partial _{x}v_{N} \bigr)_{N}+\alpha \bigl(q(x)u_{N}^{k+1},v_{N} \bigr) _{N}=F_{N}(v_{N}),$$
(31)

where

\begin{aligned} &F_{N}(v_{N}) \\ &\quad =\bigl(u_{N}^{k},v_{N}\bigr)_{N}+b_{k} \tau (\psi ,v_{N})_{N}-\alpha \bigl(p(x) \partial _{x} u_{N}^{k},\partial _{x}v_{N} \bigr)_{N}-\alpha \bigl(q(x) u_{N}^{k},v_{N} \bigr)_{N} \\ &\qquad {}+\sum_{j=0}^{k-1}(b_{j}-b_{j+1}) \bigl(u_{N}^{k-j}-u_{N}^{k-j-1},v_{N} \bigr)_{N}+2 \alpha \bigl(g^{k+\frac{1}{2}},v_{N} \bigr)_{N}. \end{aligned}

Since $$u_{N}^{k+1}(\pm 1)=0$$, by choosing $$v_{N}$$ to be $$h_{i}(x)$$, $$i=1,2, \ldots ,N-1$$, we have

$$\sum_{j=1}^{N-1} \bigl( ( h_{j},h_{i} )_{N}+\alpha (p\partial _{x} h_{j},\partial _{x}h_{i} )_{N}+\alpha (q h_{j},h_{i} )_{N} \bigr)\widetilde{u}_{j}^{k+1} =F_{N}(h_{i}).$$

Let

\begin{aligned} &\mathbf{U}^{k+1}=\bigl(\widetilde{u}_{1}^{k+1}, \widetilde{u}_{2}^{k+1}, \ldots ,\widetilde{u}_{N-1}^{k+1} \bigr)^{\mathrm{T}}, \\ &\mathbf{F}^{k+1}=\bigl(F_{N}^{k+1}(h_{1}),F_{N}^{k+1}(h_{2}), \ldots ,F _{N}^{k+1}(h_{N-1})\bigr)^{\mathrm{T}}. \end{aligned}

Introduce the matrices

\begin{aligned} & \mathbf{A}=(A_{ij})= \bigl((h_{i},h_{j})_{N} \bigr)_{i,j=1}^{N-1},\qquad \mathbf{B}=(B_{ij})= \bigl( (p \partial _{x} h_{i},\partial _{x}h _{j} )_{N} \bigr)_{i,j=1}^{N-1}, \\ & \mathbf{C}=(C_{ij})= \bigl( (q h_{i},h_{j} )_{N} \bigr)_{i,j=1} ^{N-1}. \end{aligned}

Then the matrix form of problem (31) is

$$(\mathbf{A}+\alpha \mathbf{B}+\alpha \mathbf{C} )\mathbf{U} ^{k+1}= \mathbf{F}^{k+1}.$$

By the definition of the discrete inner product we can get the elements of the matrices as

\begin{aligned} &A_{ij}=(h_{i},h_{j})_{N}=\omega _{i}\delta _{ij},\qquad B_{ij}=\sum _{l=0}^{N}p(x_{l})\partial _{x} h_{i}(x_{l})\partial _{x} h _{j}(x_{l})\omega _{l}, \\ &C_{ij}=q(x_{i})\omega _{i}\delta _{ij}. \end{aligned}

The implementation of the second scheme (23) is similar.

### 5.2 Numerical results

We carry out some numerical examples in this subsection to illustrate the theoretical statements.

### Example 1

We consider equations (1)–(3) with $$p(x)=3-\sin x$$, $$q(x)=1-\cos x$$, and the source term

\begin{aligned} g(x,t)&= \frac{24}{\varGamma (5-\gamma )}t^{4-\gamma }\sin (\pi x)+t^{4} \sin ( \pi x) \bigl(1-\cos x+\pi ^{2}(3-\sin x) \bigr) \\ &\quad {}+\pi t^{4}\cos x\cos (\pi x), \quad x\in \varLambda . \end{aligned}

The exact solution is

$$u(x,t)=t^{4}\sin (\pi x).$$

Let $$N=25$$, $$\tau =0.05$$, and $$\gamma =1.1$$. The exact solution of Example 1 is shown in Fig. 1, and numerical solutions by two schemes are shown in Figs. 2 and 3.

For $$T=1$$, the exact solution and the numerical solutions of Example 1 are depicted in Fig. 4. From Figs. 14 we can seen that the numerical solutions of two schemes are very similar to the exact solution.

To confirm the temporal accuracy, we choose N large enough such that the space discretization error is negligible compared with the temporal error. Here we take $$N=25$$ and $$T=1$$. Table 1 lists the errors $$\|u(T)-u_{N}^{M}\|_{1}$$ and temporal convergence orders of Scheme I, and Table 2 shows the errors $$\|u(T)-u_{N}^{M} \|$$ and temporal convergence orders of Scheme II, which are consistent with our theoretical analysis. The convergence order is given by the formula

$$\text{Order}= \frac{\log e_{1}-\log e_{2}}{\log \tau _{1}-\log \tau _{2}},$$

where $$e_{i}$$ is the error corresponding to $$\tau _{i}$$, $$i=1,2$$.

Next, we verify the spatial accuracy with respect to the polynomial degree N. By fixing the time step small enough to reduce the contamination of the temporal error, we illustrate the case of $$\tau =0.001$$ and $$\gamma =1.5$$. As we can see from Fig. 5, the errors of the numerical solutions decay exponentially in approximate lines as the polynomial degree N is increased. This is the so-called spectral accuracy.

### Example 2

(Finite regular solution)

We consider problem (1)–(3) with $$p(x)=2-\sin x$$, $$q(x)=1+\cos x$$, and the source term

\begin{aligned} &g(x,t) \\ &\quad =\frac{6}{\varGamma (4-\gamma )}t^{3-\gamma }(1-x) (1+x)^{2}x^{ \frac{16}{3}}+t^{3}(1+ \cos x) (1-x) (1+x)^{2}x^{\frac{16}{3}} \\ &\qquad {}-\frac{2}{9}t^{3}(2-\sin x) \bigl(104+152x-209x^{2}-275x^{3} \bigr)x^{ \frac{10}{3}} \\ &\qquad {}+ \frac{t^{3}}{3}\cos x \bigl(16+19x-22x^{2}-25x^{3} \bigr)x^{\frac{13}{3}}, \quad x\in \varLambda . \end{aligned}

The exact solution is

$$u(x,t)=t^{3}(1-x) (1+x)^{2}x^{\frac{16}{3}},$$

which has finite regularity (we can readily to verify that $$u\in H ^{5}(\varLambda )$$ but $$u\notin H^{6}(\varLambda )$$).

For comparison, we depict the exact and numerical solutions at different times T in Fig. 6. Here we choose $$N=50$$, $$\tau =0.05$$, and $$\gamma =1.1$$. The black curve denotes the exact solution, blue “O” represents the numerical solution of Scheme I and red “+” denotes the numerical solution of Scheme II. Different curves with symbols “O” and “+” represent the true solution and numerical solutions at different time T, respectively. The exact solution and numerical solutions match well at different times T as shown in Fig. 6, which illustrates that two numerical schemes effectively approximate the exact solution.

We take $$N=100$$, which is large enough such that the space discretization error is negligible compared with the temporal error. Table 3 lists the errors $$\|u(T)-u_{N}^{M}\|_{1}$$ and temporal convergence orders of Scheme I, and Table 4 shows the errors $$\|u(T)-u_{N}^{M}\|$$ and temporal convergence orders of Scheme II for Example 2, which are consistent with our theoretical analysis. Here we choose $$T=1$$.

Now we investigate the spatial accuracy with respect to the polynomial degree N. We fix the time step $$\tau =0.001$$ to avoid the contamination of the temporal error and illustrate the case $$\gamma =1.5$$.

In Fig. 7, we present the errors with respect to the polynomial degree N in a log-log scale for Example 2. Since its exact solution belongs to $$H^{5}(\varLambda )$$, but not to $$H^{6}(\varLambda )$$, we can see from Fig. 7 that the convergence rate is between $$N^{-4}$$ and $$N^{-5}$$, which conforms with our theoretical analysis.

## 6 Conclusions

In this paper, we presented and analyzed two fully discrete spectral schemes for the fractional diffusion-wave equation with variable coefficients in a bounded domain, one based on its original form and the other based on its equivalent fractional integro-differential form. The stability and convergence of two schemes were rigorously established. We carried out some numerical experiments to support the theoretical results. From numerical examples we can seen that two numerical schemes work well on time-fractional diffusion-wave equations, no matter the solution is sufficiently smooth or of finite regularity. The schemes presented in the paper can also be extended to solve two- or three-dimensional time fractional diffusion-wave equations on rectangular or cubical domains.

## References

1. Ross, B.: A brief history and exposition of the fundamental theory of fractional calculus. In: Ross, B. (ed.) Fractional Calculus and Its Applications, pp. 1–36. Springer, Berlin (1975)

2. Glöckle, W.G., Nonnenmacher, T.F.: A fractional calculus approach to self-similar protein dynamics. Biophys. J. 68, 46–53 (1995)

3. Kutner, R.: Coherent spatio-temporal coupling in fractional wanderings, renewed approach to continuous-time Lévy flights. In: Pȩkalski, A., Sznajd-Weron, K. (eds.) Anomalous Diffusion: From Basics to Applications, pp. 1–14. Springer, Berlin (1999)

4. Metzler, R., Klafter, J.: The random walk’s guide to anomalous diffusion: a fractional dynamics approach. Phys. Rep. 339, 1–77 (2000)

5. Scalas, E., Gorenflo, R., Mainardi, F.: Fractional calculus and continuous-time finance. Physica A 284, 376–384 (2000)

6. Magin, R.L.: Fractional Calculus in Bioengineering. Begell House Publishers Inc., Redding (2006)

7. Cuesta, E.: Some advances on image processing by means of fractional calculus. In: Machado, J.A.T., Luo, A.C.J., Barbosa, R.S., Silva, M.F., Figueiredo, L.B. (eds.) Nonlinear Science and Complexity, pp. 265–271. Springer, Dordrecht (2011)

8. Machado, J.T., Kiryakova, V., Mainardi, F.: Recent history of fractional calculus. Commun. Nonlinear Sci. Numer. Simul. 16, 1140–1153 (2011)

9. Baleanu, D., Agarwal, P.: Certain inequalities involving the fractional q-integral operators. Abstr. Appl. Anal. 2014, Article ID 371274 (2014)

10. Kıymaza, İ.O., Çetinkaya, A., Agarwal, P.: An extension of Caputo fractional derivative operator and its applications. J. Nonlinear Sci. Appl. 9, 3611–3621 (2016)

11. Agarwal, P., Jain, S., Mansour, T.: Further extended Caputo fractional derivative operator and its applications. Russ. J. Math. Phys. 24, 415–425 (2017)

12. Agarwal, P.: Fractional integration of the product of two H-functions and a general class of polynomials. In: Anastassiou, G.A., Duman, O. (eds.) Advances in Applied Mathematics and Approximation Theory, pp. 359–374. Springer, Berlin (2013)

13. Choi, J., Agarwal, P.: Certain integral transform and fractional integral formulas for the generalized Gauss hypergeometric functions. Abstr. Appl. Anal. 2014, Article ID 735946 (2014)

14. Stynes, M., Gracia, J.L.: A finite difference method for a two-point boundary value problem with a Caputo fractional derivative. IMA J. Numer. Anal. 35, 698–721 (2015)

15. Meerschaert, M., Tadjeran, C.: Finite difference approximations for fractional advection dispersion flow equations. J. Comput. Appl. Math. 172, 65–67 (2004)

16. Alikhanov, A.A.: A new difference scheme for the time fractional diffusion equation. J. Comput. Phys. 280, 424–438 (2015)

17. Alikhanov, A.A.: Stability and convergence of difference schemes approximating a two-parameter nonlocal boundary value problem for time-fractional diffusion equation. Comput. Math. Model. 26, 252–272 (2015)

18. Ervin, V.J., Heuer, N., Roop, J.P.: Numerical approximation of a time dependent, nonlinear, space-fractional diffusion equation. SIAM J. Numer. Anal. 45, 572–591 (2007)

19. Deng, W.H.: Finite element method for the space and time fractional Fokker–Planck equation. SIAM J. Numer. Anal. 47, 204–226 (2008)

20. Zhang, H.M., Liu, F.W., Anh, V.: Galerkin finite element approximation of symmetric space-fractional partial differential equations. Appl. Math. Comput. 217, 2534–2545 (2010)

21. Mustapha, K., McLean, W.: Superconvergence of a discontinuous Galerkin method for fractional diffusion and wave equations. SIAM J. Numer. Anal. 51, 491–515 (2013)

22. Xu, Q.W., Hesthaven, J.S.: Discontinuous Galerkin method for fractional convection–diffusion equations. SIAM J. Numer. Anal. 52, 405–423 (2014)

23. Zayernouri, M., Karniadakis, G.E.: Fractional spectral collocation method. SIAM J. Sci. Comput. 36, A40–A62 (2014)

24. Chen, F., Xu, Q.W., Hesthaven, J.S.: A multi-domain spectral method for time-fractional differential equations. J. Comput. Phys. 293, 157–172 (2015)

25. Bhrawy, A.H., Baleanu, D., Mallawi, F.: A new numerical technique for solving fractional sub-diffusion and reaction sub-diffusion equations with a non-linear source term. Therm. Sci. 19, S25–S34 (2015)

26. Bhrawy, A.H., Zaky, M.A., Baleanu, D.: New numerical approximations for space-time fractional Burgers’ equations via a Legendre spectral-collocation method. Rom. Rep. Phys. 67, 340–349 (2015)

27. Zhao, X., Zhang, Z.M.: Superconvergence points of fractional spectral interpolation. SIAM J. Sci. Comput. 38, A598–A613 (2016)

28. Doha, E.H., Abdelkawy, M.A., Amin, A.Z.M., Baleanu, D.: Spectral technique for solving variable-order fractional Volterra integro-differential equations. Numer. Methods Partial Differ. Equ. 34, 1659–1677 (2017)

29. Povstenko, Y.: Linear Fractional Diffusion-Wave Equation for Scientists and Engineers. Springer, Cham (2015)

30. Schneider, W.R., Wyss, W.: Fractional diffusion and wave equations. J. Math. Phys. 30, 134–144 (1989)

31. Agrawal, O.P.: Solution for a fractional diffusion-wave equation defined in a bounded domain. Nonlinear Dyn. 29, 145–155 (2002)

32. Pskhu, A.V.: The fundamental solution of a diffusion-wave equation of fractional order. Izv. Math. 73, 351–392 (2009)

33. Chen, J., Liu, F., Anh, V., Shen, S., Liu, Q., Liao, C.: The analytical solution and numerical solution of the fractional diffusion-wave equation with damping. Appl. Math. Comput. 219, 1737–1748 (2012)

34. Sun, Z.Z., Wu, X.N.: A fully discrete difference scheme for a diffusion-wave system. Appl. Numer. Math. 56, 193–209 (2006)

35. Huang, J., Tang, Y., Vázquez, L., Yang, J.: Two finite difference schemes for time fractional diffusion-wave equation. Numer. Algorithms 64, 707–720 (2013)

36. Wang, Z.B., Vong, S.: Compact difference schemes for the modified anomalous fractional sub-diffusion equation and the fractional diffusion-wave equation. J. Comput. Phys. 277, 1–15 (2014)

37. Wang, Y.M.: A compact finite difference method for a class of time fractional convection–diffusion-wave equations with variable coefficients. Numer. Algorithms 70, 625–651 (2015)

38. Diethelm, K.: The Analysis of Fractional Differential Equations: An Application-Oriented Exposition Using Differential Operators of Caputo Type. Springer, Berlin (2010)

39. Podlubny, I.: Fractional Differential Equations. Academic Press, San Diego (1999)

40. Canuto, C., Hussaini, M.Y., Quarteroni, A., Zang, T.A.: Spectral Methods: Fundamentals in Single Domains. Springer, Berlin (2006)

41. Sun, Z.Z.: The Method of Order Reduction and Its Application to the Numerical Solutions of Partial Differential Equations. Science Press, Beijing (2009)

42. Tian, W., Zhou, Z., Deng, W.: A class of second order difference approximations for solving space fractional diffusion equations. Math. Comput. 84, 1703–1727 (2015)

43. Heywood, J.G., Rannacher, R.: Finite-element approximation of the nonstationary Navier–Stokes problem. Part IV: error analysis for second-order time discretization. SIAM J. Numer. Anal. 27, 353–384 (1999)

44. Chen, H., Lü, S.J., Chen, W.P.: A unified numerical scheme for the multi-term time fractional diffusion and diffusion-wave equations with variable coefficients. J. Comput. Appl. Math. 330, 380–397 (2018)

45. Lin, Y., Li, X., Xu, C.: Finite difference/spectral approximations for the fractional cable equation. Math. Comput. 80, 1369–1396 (2011)

## Funding

The research is supported by the National Natural Science Foundation of China (Grants Nos. 11672011, 11272024, 11801026).

## Author information

Authors

### Contributions

All authors read and approved the final manuscript.

### Corresponding author

Correspondence to Wenping Chen.

## Ethics declarations

### Competing interests

The authors declare that they have no competing interests.

### Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Wenping Chen and Shujuan Lü contributed equally to this work.

## Rights and permissions

Reprints and permissions

Chen, W., Lü, S., Chen, H. et al. Analysis of two Legendre spectral approximations for the variable-coefficient fractional diffusion-wave equation. Adv Differ Equ 2019, 418 (2019). https://doi.org/10.1186/s13662-019-2347-2