1 Introduction

The subject of fractional calculus (theory of integration and differentiation of arbitrary order) can be considered as an old yet novel topic. It has been an ongoing topic for more than 300 years; however, since the 1970s, it has been gaining increasing attention [1]. Firstly, there were almost no practical applications of fractional calculus (FC), and it was considered by many as an abstract area containing only mathematical manipulations of little or no use [24]. Recently, FC has been widely used in various applications in almost every field of science, engineering, and mathematics, and it has gained considerable importance due to its frequent applications in fluid flow, polymer rheology, economics, biophysics, control theory, psychology, and so on [5, 6].

The main reason that fractional differential equations (FDEs) are being used to model real phenomena is that they are nonlocal in nature, that is, a realistic model of a physical phenomenon depends not only on the time instant but also on the previous time history [7]. In other words, fractional derivative (FD) provides a perfect tool when it is used to describe the memory and hereditary properties of various materials and processes [8, 9]. Some of the other main differences between fractional calculus and classical calculus are: (i) FDEs are, at least, as stable as their integer order counterparts [10, 11]; (ii) using FDEs can help to reduce the errors arising from the neglected parameters in modeling real-life phenomena [12, 13]; (iii) in some situations, the FDE models seem more consistent with the real phenomena than the integer order models [14, 15]; (iv) modeling of real-life processes with FD is more reliable and accurate than the classical derivative [16, 17]; (v) fractional order models are more general [18] and in the limit results obtained from FC coincide with those obtained from classical calculus [19], and so on.

The wide applicability of FC in the field of science and engineering motivates researchers to try to find out the analytical or numerical solutions for FDEs. It is well known that the analytical and closed solutions of FDEs cannot generally be obtained and if luckily obtained always contain some infinite series (such as Mittag-Leffler function), which makes evaluation very expensive [20, 21]. For this reason, necessarily, one may need an efficient approximate and numerical technique for the solution of FDEs [22].

Odibat et al. constructed a numerical scheme for the numerical solution of FDEs based on the modified trapezoidal rule and the fractional Euler method [23]. To present a numerical solution scheme for the fractional differential equations, authors of [24] divided total time into a set of small intervals and utilized quadratic interpolation polynomial between two successive intervals to approximate unknown functions. Cao and Xu applied quadratic interpolation polynomial to construct a high order scheme based on the so-called block-by-block approach for the fractional ordinary differential equations [25]. The convergence order of this scheme is \(3+ \alpha \) for \(0 < \alpha \leq 1 \) and 4 for \(\alpha > 1 \). Diethelm proposed an implicit numerical algorithm for solving FDEs by using piecewise linear interpolation polynomials to approximate the Hadamard finite-part integral [26]. Yan et al. designed a high order numerical scheme for solving a linear fractional differential equation defined in terms of the Riemann–Liouville fractional derivative [27]. This method is based on a direct discretisation of the fractional differential operator, and the order of convergence of the method is \(O (h^{3-\alpha })\). A high order fractional Adams-type method for solving nonlinear FDEs is also obtained in this paper. Asl et al. [28] applied the piecewise cubic interpolation polynomial to construct a numerical scheme for solving linear FDEs. The convergence order of this scheme is \(O (h^{4-\alpha })\) for \(0 < \alpha \leq 1 \).

In recent years a lot of attention has been paid to finding effective numerical methods to simulate the fractional partial differential equations, such as meshless methods [2931] and homotopy analysis method [32]. Dehghan et al. presented a fourth order numerical method for solving a fractional partial integro-differential equation [33]. Authors of [34] proposed a high accuracy numerical method to simulate a nonlinear fractional partial integro-differential equation.

The present study proposes to develop two numerical algorithms for the numerical approximation of a class of FDEs which are expressed in terms of Caputo-type fractional derivatives. In these algorithms the properties of the Caputo derivative are used to reduce the FDE into a Volterra-type integral equation of the second kind. The outline of the paper is as follows. Numerical algorithms are presented in Sect. 2 by using the piecewise Lagrange interpolation polynomial of degree three and degree four. Section 3 deals with the error analysis of the presented algorithms, and stability analysis of these algorithms is given on Sect. 4. Linear stability analysis of the presented schemes is given in Sect. 5 to achieve stability region of these methods. To demonstrate the effectiveness and high accuracy of the proposed methods, some numerical examples are provided in Sect. 6. The experimental orders of convergence are also investigated in this section. Finally, some concluding remarks are given in Sect. 7.

2 Numerical algorithms

The present paper further discusses numerical algorithms for the initial value problem for a FDE in the form

$$\begin{aligned} \textstyle\begin{cases} _{0}^{C}D^{\alpha }_{t} y(t)=f(t,y(t))=\beta y(t)+g(t), \quad 0 \leq t \leq T, \\ y^{(k)}(t_{0})=y_{0}^{(k)}, \quad k=0,1,\ldots,\lceil \alpha \rceil -1, \end{cases}\displaystyle \end{aligned}$$
(1)

where \(_{0}^{C}D^{\alpha }_{t} \) denotes the Caputo fractional derivative(FD). The reason for choosing Caputo derivative in (1) is partly due to the fact that the Caputo derivative of a constant is zero. More importantly, the Caputo FD determines an ordinary derivative followed by a fractional integral to obtain the preferred order of FDs. That means the Caputo FD allows us to couple FDEs with traditional (local) boundary and initial conditions. These conditions have clear physical interpretation and are familiar to us [8, 35, 36]. Motivated by these advantages, the Caputo FD has been applied to model various physical and real-life problems such as epidemic model for HIV transmission [8, 9], symbiosis system [16], multi-pulse splitting process [17], reaction–diffusion problems [37, 38], and tumor–host models [39]. Presented numerical algorithms are based on the analytical property that the initial value problem (1) is equivalent to the Volterra integral equation [40, 41]

$$\begin{aligned} y(t)=h(t) +\frac{1}{\Gamma (\alpha )} \int _{0}^{t} (t-\tau )^{\alpha -1} f\bigl(\tau,y( \tau )\bigr) \,d\tau, \end{aligned}$$
(2)

where \(h(t)=\sum_{j=0}^{\lceil \alpha \rceil -1}\frac{t^{j}}{j!}y^{(j)}(0) \), in the sense that a continuous function solves (2) if and only if it solves (1). The piecewise Lagrange interpolation polynomials of degree three and degree four are used to approximate the integral in (2). For an integer N and the given time T, the interval \([0, T ]\) is divided into \(t_{j}=jh, j=0,\ldots,N\), where \(h = T/N\) is the step length. The numerical solution of Eq. (1) at the point \(t_{j}\) is denoted by \(y_{j}\). For notational convenience, let \(F(\tau )=f(\tau,y(\tau ))\) and \(F_{j}=f(t_{j},y_{j})= \beta y_{j}+g(t_{j})\).

2.1 Numerical algorithm I

We start with computing the value of \(y(t)\) at \(t_{1}\), \(t_{2}\), and \(t_{3}\), simultaneously. Consider the following integral for the first three steps (\(k=0,1,2\)):

$$\begin{aligned} I_{k+1}={}& \int _{0}^{t_{k+1}} (t_{k+1}-\tau )^{\alpha -1} F(\tau ) \,d \tau =\sum_{j=0}^{k} \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{ \alpha -1} F(\tau ) \,d\tau \\ \approx {}& \sum_{j=0}^{k} \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{ \alpha -1} \tilde{F}(\tau ) \,d\tau = \sum_{j=0}^{3}d^{k+1}_{j} F(t_{j }), \end{aligned}$$
(3)

where \(\tilde{F}(\tau ) \) is chosen to be the piecewise Lagrange cubic interpolation polynomial of \(F(\tau )\) associated with the nodes \(t_{0}\), \(t_{1}\), \(t_{2}\), and \(t_{3}\). In this way, we have

$$\begin{aligned} \begin{aligned}&\hat{d}^{1}_{j}= \textstyle\begin{cases} 6 \alpha ^{3}+25 \alpha ^{2}+23 \alpha, & j=0, \\ 6 (3 \alpha ^{2}+10 \alpha +6), & j=1, \\ -9 \alpha ^{2}-21 \alpha, & j=2, \\ -2 \alpha ^{2}-4 \alpha, & j=3, \end{cases}\displaystyle ,\qquad \hat{d}^{2}_{j}= \textstyle\begin{cases} 2^{\alpha +1} \alpha (\alpha +2) (3 \alpha +1), & j=0, \\ 3\times 2^{\alpha +2} (3 \alpha ^{2}+5 \alpha ), & j=1, \\ 3 \times 2^{\alpha +1} (-3 \alpha ^{2}+\alpha +6 ), & j=2, \\ 2^{\alpha +2} \alpha ^{2}-\alpha & j= 3, \end{cases}\displaystyle \qquad \\ &\hat{d}^{3}_{j}=\textstyle\begin{cases} 3^{\alpha +1 } ( 2 \alpha ^{3}+\alpha ^{2}+3 \alpha ), & j=0, \\ 2 \times 3^{\alpha +3} \alpha ^{2}, & j=1, \\ -3^{\alpha +3} (\alpha ^{2}-3 \alpha ), & j=2, \\ 2 \times 3^{\alpha +1} ( \alpha ^{2}-4 \alpha +6 ) & j= 3, \end{cases}\displaystyle ,\qquad d^{k+1}_{j }= \frac{h^{\alpha }}{6\alpha (\alpha +1)(\alpha +2)(\alpha +3)}\hat{d}^{k+1}_{j}. \end{aligned} \end{aligned}$$
(4)

To explain further, for \(y_{1}\), we have

$$\begin{aligned} y_{1}= h(t_{1}) +\frac{1}{\Gamma (\alpha )} \sum _{j=0}^{3} \int _{t_{0}}^{t_{1}} (t_{1}-\tau )^{\alpha -1} L_{3,j}(\tau )F_{j} \,d\tau = h(t_{1}) + \frac{1}{\Gamma (\alpha )} \sum_{j=0}^{3} d_{j}^{1} F_{j}, \end{aligned}$$

where

$$\begin{aligned} L_{3,j}(\tau )=\prod_{\substack{i=0\\i \neq j}}^{3} \frac{\tau -t_{i}}{t_{j}-t_{i}},\qquad d_{j}^{1}= \int _{t_{0}}^{t_{1}} (t_{1}-\tau )^{\alpha -1} L_{3,j}(\tau ) \,d\tau,\quad j=0,1,2,3. \end{aligned}$$

For this reason, after some elementary calculations, \(y_{k+1}\) for the first three steps \(k=0,1,2 \) can be approximated as follows:

$$\begin{aligned} \begin{aligned}& y_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum _{j=0}^{3} d^{k+1}_{j} \bigl( \beta y_{j}+g(t_{j}) \bigr), \\ &\biggl( \frac{ \Gamma (\alpha ) - \beta d_{k+1}^{k+1} }{ \Gamma (\alpha ) } \biggr) y_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum_{\substack{j=0\\j \neq k+1}}^{3} d^{k+1}_{j} F_{j}+ \frac{ d^{k+1}_{k+1}}{ \Gamma (\alpha )} g(t_{k+1}), \quad k=0,1,2. \end{aligned} \end{aligned}$$
(5)

As it is mentioned above, the first three step solutions \(y_{1}, y_{2}\), and \(y_{3}\) are coupled in (5), thus need to be solved simultaneously. This procedure leads to a linear system of equations, which can be solved explicitly by means of back-substitution.

To construct the scheme for the next steps, \(I_{k+1}, k\geq 3 \), is discretized as follows:

$$\begin{aligned} I_{k+1}\approx \Biggl[ \sum_{j=0}^{2} \int _{t_{j}}^{t_{j+1}} \tilde{F}(\tau ) + \sum _{j=3}^{k} \int _{t_{j}}^{t_{j+1}} \tilde{F}_{j+1 }(\tau ) \Biggr] (t_{k+1}-\tau )^{\alpha -1} \,d\tau = \sum _{j=0}^{k+1}d^{k+1}_{j} F(t_{j }), \end{aligned}$$
(6)

in which, like in (3), for the first three integrals (\(j=0,1,2,3\)), is the piecewise Lagrange cubic interpolation polynomial of \(F(\tau )\) associated with the nodes \(t_{0}\), \(t_{1}\), \(t_{2}\), and \(t_{3}\). For the remaining integrals (\(j=3,4,\ldots,k+1\)), \(\tilde{F}_{j+1} \) is chosen to be the piecewise Lagrange cubic interpolation polynomial of \(F(\tau )\) associated with the nodes \(t_{j-2}\), \(t_{j-1}\), \(t_{j}\), and \(t_{j+1}\). In this way, for \(k\geq 3 \), we have

$$\begin{aligned} \hat{d}^{k+1}_{0}={}& (k+1)^{\alpha } \bigl[ 6 \alpha ^{3}+25 \alpha ^{2}+23 \alpha +12 \alpha k^{2} -k \bigl(11 \alpha ^{2}+31 \alpha +6 (k-2) (k-1) \bigr) \bigr] \\ &{} +2 P(1) (k-2)^{\alpha +1}, \\ \hat{d}^{k+1}_{1}={}& 6 (k+1)^{\alpha +1} \bigl[3 k (k-3) -5 k \alpha +3 \alpha ^{2}+10 \alpha +6 \bigr] +\frac{6}{3} P(2) (k-3)^{\alpha +1} \\ &{} -\frac{24}{3} P(1) (k-2)^{\alpha +1}, \\ \hat{d}^{k+1}_{2}={}& {-}3 (k+1)^{\alpha +1} \bigl[6 k (k-2) -8 k \alpha + 3 \alpha ^{2}+ 7\alpha \bigr] +2 P(3) (k-4)^{\alpha +1} \\ &{} -\frac{24}{3} P(2) (k-3)^{\alpha +1} +12 P(1) (k-2)^{\alpha +1}, \\ \hat{d}^{k+1}_{3}={}& 2 (k+1)^{\alpha +1} \bigl[\alpha ^{2}+2 \alpha +3 k^{2}-3 \alpha k-3 k \bigr] +2 P(4) (k-5)^{\alpha +1} -8 P(3) (k-4)^{\alpha +1} \\ &{} +12 P(2) (k-3)^{\alpha +1} -8 P(1) (k-2)^{\alpha +1}, \\ \hat{d}^{k+1}_{j}={}& 2 P(j-3) (k-j +2)^{\alpha +1} -8 P(j-2) (k-j+1)^{ \alpha +1} +12 P(j-1) (k-j)^{\alpha +1} \\ &{} -8 P(j) (k-j-1)^{\alpha +1} +2 P(j+1) (k-j -2)^{\alpha +1}, \quad 4 \leq j \leq k-2, \\ \hat{d}^{k+1}_{k-1}= {}&6\hat{d}^{k+1}_{k+1} -2^{\alpha +4} \varphi +2 \times 3^{\alpha +1} \bigl[ \alpha ^{2} +14\alpha +60 \bigr], \qquad \hat{d}^{k+1}_{k}= 2^{\alpha +2} \varphi -4\hat{d}^{k+1}_{k+1}, \\ \hat{d}^{k+1}_{k+1}={}& 2 \alpha ^{2} + 16 \alpha +36, \end{aligned}$$

in which \(d^{k+1}_{j }= \frac{h^{\alpha }}{6\alpha (\alpha +1)(\alpha +2)(\alpha +3)}\hat{d}^{k+1}_{j} \) and

$$\begin{aligned} \varphi =\alpha ^{2}+11 \alpha +36,\qquad P(j)=\alpha (\alpha +2)+3 j^{2}-3 j (\alpha +2 k+1)+3 k^{2}+3 (\alpha +1) k. \end{aligned}$$

The following special cases should be excluded:

$$\begin{aligned} & \textstyle\begin{cases} \hat{d}_{2}^{4}=-3 [ 4^{\alpha +1 } (3 \alpha ^{2}-17 \alpha +18 )- 2\hat{d}^{k+1}_{k+1} ], \\ \hat{d}_{3}^{4}=2 [ 4^{\alpha +1 } (\alpha ^{2}-7 \alpha +18 ) - 2 \hat{d}^{k+1}_{k+1} ], \end{cases}\displaystyle \end{aligned}$$
(7)
$$\begin{aligned} & \hat{d}_{3}^{5}=2 \bigl[ 5^{\alpha +1} \bigl(\alpha ^{2}-10 \alpha +36 \bigr) -2^{\alpha +3}\varphi +3 \hat{d}^{k+1}_{k+1} \bigr]. \end{aligned}$$
(8)

In this way, after some explicit calculations, \(y_{k+1}\) for \(k \geq 3\) can be approximated as follows:

$$\begin{aligned} \begin{aligned} &y_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum _{j=0}^{k+1} d^{k+1}_{j} \bigl( \beta y_{j}+g(t_{j}) \bigr), \\ &\biggl( \frac{ \Gamma (\alpha ) - \beta d_{k+1}^{k+1} }{ \Gamma (\alpha ) } \biggr) y_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \Biggl( \sum_{j=0}^{k} d^{k+1}_{j} F_{j}+ d^{k+1}_{k+1} g(t_{k+1}) \Biggr),\quad k \geq 3. \end{aligned} \end{aligned}$$
(9)

Summing up the above arguments, we have the following novel scheme:

$$\begin{aligned} \biggl( \frac{ \Gamma (\alpha ) - \beta d_{k+1}^{k+1} }{ \Gamma (\alpha ) } \biggr) y_{k+1}= \textstyle\begin{cases} h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum_{ \substack{j=0\\j \neq k+1}}^{3} d^{k+1}_{j} F_{j}+ \frac{d^{k+1}_{k+1}}{ \Gamma (\alpha )} g(t_{k+1}) & \text{if } k=0,1,2, \\ h(t_{k+1})+ \frac{1}{ \Gamma (\alpha )} ( \sum_{j=0}^{k} d^{k+1}_{j} F_{j}+ d^{k+1}_{k+1} g(t_{k+1}) ) &\text{if } k \geq 3. \end{cases}\displaystyle \end{aligned}$$
(10)

2.2 Numerical algorithm II

Consider the following integral for the first four steps (\(k=0,1,2,3\)):

$$\begin{aligned} I_{k+1}={}& \int _{0}^{t_{k+1}} (t_{k+1}-\tau )^{\alpha -1} F(\tau ) \,d \tau =\sum_{j=0}^{k} \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{ \alpha -1} F(\tau ) \,d\tau \\ ={}& \sum_{j=0}^{k} \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{\alpha -1} \tilde{F}(\tau ) \,d\tau = \sum_{j=0}^{4}b^{k+1}_{j} F(t_{j }), \end{aligned}$$
(11)

where \(\tilde{F}(\tau ) \) is the piecewise Lagrange interpolation polynomial of degree four associated with the nodes \(t_{0}\), \(t_{1}\), \(t_{2}\),, \(t_{3}\), and \(t_{4}\). Therefore, one can achieve the following weights:

$$\begin{aligned} \begin{aligned} & \textstyle\begin{cases} \hat{b}^{1}_{0}=\alpha [ 12 \alpha ^{3} +95 \alpha ^{2} +230 \alpha +165 ], \\ \hat{b}^{1}_{1}=4 [12 \alpha ^{3}+82 \alpha ^{2}+157 \alpha +72 ], \\ \hat{b}^{1}_{2}=-6 \alpha [ 6 \alpha ^{2} +35 \alpha +47 ], \\ \hat{b}^{1}_{3}=4 \alpha [ 4 \alpha ^{2}+22 \alpha +27 ], \\ \hat{b}^{1}_{4}=-\alpha [ 3 \alpha ^{2} +16\alpha +19 ], \end{cases}\displaystyle \\ &\textstyle\begin{cases} \hat{b}^{2}_{0}=2^{\alpha +1}\alpha [6 \alpha ^{3} +35 \alpha ^{2} +55 \alpha +20 ], \\ \hat{b}^{2}_{1}=2^{\alpha +5} \alpha [ 3 \alpha ^{2} +14\alpha +14 ], \\ \hat{b}^{2}_{2}=3\times 2^{\alpha +3} (\alpha +1) (\alpha +3) (4-3 \alpha ), \\ \hat{b}^{2}_{3}=2^{\alpha +5} \alpha [ \alpha ^{2} +2\alpha -2 ], \\ \hat{b}^{2}_{4}=2^{\alpha +1} \alpha [ - 3 \alpha ^{2} -5 \alpha +4 ], \end{cases}\displaystyle \\ & \textstyle\begin{cases} \hat{b}^{3}_{0}=3^{\alpha +1} \alpha [ 4 \alpha ^{3} +15 \alpha ^{2} +20\alpha +15 ], \\ \hat{b}^{3}_{1}=4\times 3^{\alpha +2} \alpha [ 4 \alpha ^{2}+10 \alpha +3 ], \\ \hat{b}^{3}_{2}=2\times 3^{\alpha +3} \alpha [ -2 \alpha ^{2}+ \alpha +9 ], \\ \hat{b}^{3}_{3}=4\times 3^{\alpha +1} [ 4 \alpha ^{3}-6 \alpha ^{2}- \alpha +24 ], \\ \hat{b}^{3}_{4}=-3^{\alpha +2} \alpha [ \alpha ^{2} -2\alpha +3 ], \end{cases}\displaystyle \\ &\textstyle\begin{cases} \hat{b}^{4}_{0}=4^{\alpha +1} \alpha ^{2} [ 3 \alpha ^{2} +5 \alpha +20 ], \\ \hat{b}^{4}_{1}=4^{\alpha +3} \alpha [ 3 \alpha ^{2}+\alpha +4 ], \\ \hat{b}^{4}_{2}=3\times 4^{\alpha +2} \alpha [ -3 \alpha ^{2} + 11 \alpha -4 ], \\ \hat{b}^{4}_{3}=4^{\alpha +3} \alpha [ \alpha ^{2} -5\alpha +12 ], \\ \hat{b}^{4}_{4}=- 4^{\alpha +1} (\alpha -2) ( 3 \alpha ^{2} -11 \alpha +36), \end{cases}\displaystyle \end{aligned} \end{aligned}$$
(12)

here \(b^{k+1}_{j}= \frac{h^{\alpha }}{12\alpha (\alpha +1)(\alpha +2)(\alpha +3) (\alpha +4) } \hat{b}^{k+1}_{j} \). Hence \(y_{k+1}\) for the first four steps \(k= 0,1,2,3\) can be determined as follows:

$$\begin{aligned} \begin{aligned}& y_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum _{j=0}^{4} b^{k+1}_{j} \bigl( Ay_{j}+g(t_{j}) \bigr), \\ &\biggl( \frac{ \Gamma (\alpha ) - \beta b_{k+1}^{k+1} }{ \Gamma (\alpha ) } \biggr) y_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum_{\substack{j=0\\j \neq k+1}}^{4} b^{k+1}_{j} F_{j}+ \frac{b^{k+1}_{k+1}}{ \Gamma (\alpha )} g(t_{k+1}),\quad 0 \leq k \leq 3. \end{aligned} \end{aligned}$$
(13)

It is obvious that the first four step solutions \(y_{1}, y_{2}, y_{3}\), and \(y_{4}\) are coupled in (13), thus need to be solved simultaneously. This procedure leads to a linear system of equations, which can be solved explicitly by means of back-substitution.

To design the scheme for the next steps, \(I_{k+1}, k\geq 4 \) is discretized as follows:

$$\begin{aligned} I_{k+1}= \Biggl[ \sum_{j=0}^{3} \int _{t_{j}}^{t_{j+1}} \tilde{F}( \tau ) + \sum _{j=4}^{k} \int _{t_{j}}^{t_{j+1}} \tilde{F}_{j+1 }( \tau ) \Biggr] (t_{k+1}-\tau )^{\alpha -1} \,d\tau = \sum _{j=0}^{k+1}b^{k+1}_{j} F(t_{j }), \end{aligned}$$
(14)

in which, as in (11), for the first four integrals (\(j=0,1,2,3\)), is a piecewise Lagrange interpolation polynomial of degree four associated with the nodes \(t_{0}\), \(t_{1}\), \(t_{2}\), \(t_{3}\), and \(t_{4}\). For the remaining integrals (\(j=4,5,\ldots,k+1\)), \(\tilde{F}_{j+1} \) is the piecewise Lagrange interpolation polynomial of degree four associated with the nodes \(t_{j-3}\), \(t_{j-2}\), \(t_{j-1}\), \(t_{j}\), and \(t_{j+1}\). In this way, for \(k\geq 4 \), we have the following weights:

$$\begin{aligned} \hat{b}^{k+1}_{0}= {}& (k+1)^{\alpha } \bigl[ 12 \alpha ^{4} +5 \alpha ^{2} \bigl(7 k^{2}-31 k+46 \bigr) -5 \alpha (k-3) \bigl(6 k^{2}-13 k+11 \bigr) \\ &{} +5 \alpha ^{3} (19-5 k) +12 k (k-3) (k-2) (k-1) \bigr] - P (2) (k-3)^{ \alpha +1}, \\ \hat{b}^{k+1}_{1}= {}& {-}4 (k+1)^{\alpha +1} \bigl[h_{2} (-2)-15 (\alpha +4) \bigl(\alpha ^{2}+4 \alpha +3 k^{2}-\alpha k+3 k+6 \bigr) \bigr] \\ &{} -P (3) (k-4)^{\alpha +1} +5 P (2) (k-3)^{\alpha +1}, \\ \hat{b}^{k+1}_{2}= {}& 6 (k+1)^{\alpha +1} \bigl[h_{2} (-2)-(\alpha +4) \bigl(9 \alpha ^{2}+37 \alpha +42 k^{2}-8 \alpha k+60 k+72 \bigr) \bigr] \\ &{}-P (4) (k-5)^{\alpha +1} +5 P (3) (k-4)^{\alpha +1} -10 P (2) (k-3)^{ \alpha +1}, \\ \hat{b}^{k+1}_{3}= {}& {-}4 (k+1)^{\alpha +1} \bigl[h_{2} (-2)-(\alpha +4) \bigl(7 \alpha ^{2}+32 \alpha +39 k^{2}-3 \alpha k+69 k+72 \bigr) \bigr] \\ &{} - P (5) (k-6)^{\alpha +1} +5 P (4) (k-5)^{\alpha +1} -10 P (3) (k-4)^{ \alpha +1} +10 P (2) (k-3)^{\alpha +1}, \\ \hat{b}^{k+1}_{4}={} & (k+1)^{\alpha +1} \bigl[ h_{2} (-2)-6 (\alpha +4) \bigl(\alpha ^{2}+5 \alpha +6 k^{2}+12 k+12 \bigr) \bigr] - P (6) (k-7)^{ \alpha +1} \\ &{} +5 P (5) (k-6)^{\alpha +1} -10 P (4) (k-5)^{\alpha +1} +10 P (3) (k-4)^{ \alpha +1} -5 P (2) (k-3)^{\alpha +1}, \\ \hat{b}^{k+1}_{j}= {}& - P (j+2) (-j+k-3)^{\alpha +1} + P (j-3) (-j+k+2)^{ \alpha +1} -5 P (j-2) (-j+k+1)^{\alpha +1} \\ & {}+10 P (j-1) (k-j)^{\alpha +1} +5 P (j+1) (-j+k-2)^{\alpha +1} -10 P (j) (-j+k-1)^{\alpha +1}, \\ & 5 \leq j \leq k-3, \\ \hat{b}^{k+1}_{k-2}={}& 2^{\alpha +2} \bigl[ 5 \psi _{2} +2^{\alpha } \bigl(3 \alpha ^{3}+71 \alpha ^{2}+674 \alpha +2520 \bigr) \bigr] -5 \times 3^{\alpha +2} \psi _{1} -10 \tilde{b}^{k+1}_{k+1}, \\ \hat{b}^{k+1}_{k-1}= {}&10 \bigl[ \hat{b}^{k+1}_{k+1} -2^{\alpha } \psi _{2} \bigr] +3^{\alpha +2} \psi _{1},\qquad \hat{b}^{k+1}_{k}= 2^{ \alpha +1} \psi _{2} -5 \hat{b}^{k+1}_{k+1}, \\ \hat{b}^{k+1}_{k+1}={}&3 \alpha ^{3}+38 \alpha ^{2}+173 \alpha +288, \end{aligned}$$

where \(b^{k+1}_{j }= \frac{h^{\alpha }}{12\alpha (\alpha +1)(\alpha +2)(\alpha +3) (\alpha +4) } \hat{b}^{k+1}_{j} \) and

$$\begin{aligned} &P (j) = 3 \alpha ^{3}+\alpha \bigl(18 j^{2}-36 j k-41 j+18 k^{2}+41 k+19 \bigr)+\alpha ^{2} (-11 j+11 k+16) \\ &\phantom{P (j) = }{} -12 (j-k-2) (j-k-1) (j-k), \\ &\psi _{1}=\alpha ^{3}+20 \alpha ^{2}+157 \alpha +480,\qquad \psi _{2}= 3 \alpha ^{3}+49 \alpha ^{2}+304 \alpha +720. \end{aligned}$$

The following special cases should be excluded:

$$\begin{aligned} &\textstyle\begin{cases} \hat{b}_{2}^{5}= -10 [ 3\times 5^{\alpha } (6 \alpha ^{3}-41 \alpha ^{2}+91 \alpha -96 ) + \hat{b}^{k+1}_{k+1} ], \\ \hat{b}_{3}^{5}= 10 [ 5^{\alpha } (8 \alpha ^{3}-68 \alpha ^{2}+278 \alpha -288 ) + \hat{b}^{k+1}_{k+1} ], \\ \hat{b}_{4}^{5}= -5 [ 5^{\alpha } ( 3 \alpha ^{3}-28 \alpha ^{2}+143 \alpha -288 ) +\hat{b}^{k+1}_{k+1} ], \end{cases}\displaystyle \end{aligned}$$
(15)
$$\begin{aligned} &\textstyle\begin{cases} \hat{b}_{3}^{6}= 10( 2^{\alpha +1} \psi _{2} -\hat{b}^{k+1}_{k+1}) +2^{ \alpha +5} 3^{\alpha +1} (\alpha ^{3}-12 \alpha ^{2}+68 \alpha -120 ), \\ \hat{b}_{4}^{6}= 10 ( -2^{\alpha } \psi _{2} + \hat{b}^{k+1}_{k+1} ) -2^{\alpha +1} 3^{\alpha +2} ( \alpha ^{3}-13 \alpha ^{2}+88 \alpha -240 ), \end{cases}\displaystyle \end{aligned}$$
(16)
$$\begin{aligned} &\hat{b}_{4}^{7}= 7^{\alpha +1} \bigl(-3 \alpha ^{3}+50 \alpha ^{2}-421 \alpha +1440 \bigr) -5\times 3^{\alpha +2} \psi _{1} +5\times 2^{ \alpha +2} \psi _{2} -10 \hat{b}^{k+1}_{k+1}. \end{aligned}$$
(17)

Therefore \(y_{k+1}\) for \(k \geq 4\) can be approximated as follows:

$$\begin{aligned} \begin{aligned}& y_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum _{j=0}^{k+1} b^{k+1}_{j} \bigl( \beta y_{j}+g(t_{j}) \bigr), \\ &\biggl( \frac{ \Gamma (\alpha ) - \beta b_{k+1}^{k+1} }{ \Gamma (\alpha ) } \biggr) y_{k+1}= h(t_{k+1})+ \frac{1}{ \Gamma (\alpha )} \Biggl( \sum_{j=0}^{k} b^{k+1}_{j} F_{j}+ b^{k+1}_{k+1} g(t_{k+1}) \Biggr),\quad k \geq 4. \end{aligned} \end{aligned}$$
(18)

Thus a new numerical algorithm II is described by (13) and (18) with the weights \(b^{k+1}_{j}\) defined as above.

3 Error analysis

For numerical algorithm I, the truncation error at step \(k+1\) is defined by [25]

$$\begin{aligned} r_{k+1}(h):=y(t_{k+1})-\tilde{y}_{k+1}, \end{aligned}$$
(19)

where \(\tilde{y}_{k+1}\) is an approximation to \(y(t_{k+1}) \), evaluated by using algorithm I (10) with exact previous solutions, i.e., for \(k\geq 3\),

$$\begin{aligned} \tilde{y}_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum_{j=0}^{k+1} d^{k+1}_{j} F(t_{j}). \end{aligned}$$
(20)

For numerical algorithm II (18), the definition of truncation error is the same as (19), where \(\tilde{y}_{k+1} \) for \(k\geq 4\) is as follows:

$$\begin{aligned} \tilde{y}_{k+1}= h(t_{k+1}) + \frac{1}{ \Gamma (\alpha )} \sum_{j=0}^{k+1} b^{k+1}_{j} F(t_{j}). \end{aligned}$$
(21)

Theorem 1

Let \(r_{k+1}(h) \) be the truncation error defined in (19). If \(F(\tau ) \in C^{4}[0,T]\) for some suitable chosen T, then for numerical algorithm I (10) there exists a positive constant \(C>0 \), independent of h, such that

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert \leq C h^{4}. \end{aligned}$$

Proof

By the definition of truncation error (19) we have

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert = \bigl\vert y(t_{k+1})-\tilde{y}_{k+1} \bigr\vert . \end{aligned}$$

We compute \(y(t_{k+1})\) and \(\tilde{y}_{k+1}\) from (2) and (20), respectively, which yields

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert ={}& \Biggl\vert h(t_{k+1}) + \frac{1}{\Gamma (\alpha )} \int _{0}^{t_{k+1}} (t_{k+1}-\tau )^{ \alpha -1} F(\tau ) \,d\tau \\ &{} - h(t_{k+1}) - \frac{1}{ \Gamma (\alpha )} \sum_{j=0}^{k+1} d^{k+1}_{j} F(t_{j}) \Biggr\vert . \end{aligned}$$

We have, by (6),

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert \leq {}& \frac{1}{ \Gamma (\alpha )} \Biggl\vert \sum_{j=0}^{k} \int _{t_{j}}^{t_{j+1}}(t_{k+1}-\tau )^{\alpha -1} F( \tau ) \,d\tau \\ &{} - \sum_{j=0}^{2} \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{\alpha -1} \tilde{F}(\tau ) \,d\tau - \sum_{j=3}^{k} \int _{t_{j}}^{t_{j+1}} (t_{k+1}- \tau )^{\alpha -1} \tilde{F}_{j+1 }(\tau ) \,d\tau \Biggr\vert \\ \leq{} & \frac{1}{ \Gamma (\alpha )} \Biggl[ \sum_{j=0}^{2} \int _{t_{j}}^{t_{j+1}}(t_{k+1}- \tau )^{\alpha -1} \bigl\vert F(\tau ) - \tilde{F}(\tau ) \bigr\vert \,d \tau \\ &{} + \sum_{j=3}^{k} \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{\alpha -1} \bigl\vert F(\tau ) - \tilde{F}_{j+1 } (\tau ) \bigr\vert \,d\tau \Biggr], \end{aligned}$$

where \(\tilde{F}(\tau ) \) and \(\tilde{F}_{j+1 } \) are defined by (6). Thus, according to the property of cubic interpolation polynomials,

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert \leq {}& \frac{1}{ \Gamma (\alpha )} \Biggl[ \sum_{j=0}^{2} \int _{t_{j}}^{t_{j+1}}(t_{k+1}-\tau )^{\alpha -1} \biggl\vert \frac{F^{(4)}(\xi _{1}(\tau ))}{4 !} (\tau -t_{0}) (\tau -t_{1}) (\tau -t_{2}) (\tau -t_{3}) \biggr\vert \,d\tau \\ &{}+ \sum_{j=3}^{k} \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{\alpha -1} \biggl\vert \frac{F^{(4)}(\xi _{j}(\tau ))}{4 !} (\tau -t_{j-2}) (\tau -t_{j-1}) (\tau -t_{j }) (\tau -t_{j+1}) \biggr\vert \,d\tau \Biggr], \end{aligned}$$

where \(\xi _{1}(\tau ) \in [t_{0},t_{3}] \) and \(\xi _{j}(\tau ) \in [t_{j-2},t_{j+1}] \).

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert \leq {}&\frac{1}{ \Gamma (\alpha )} \Biggl[ \sum_{j=0}^{2} \frac{ \Vert F^{(4)} \Vert _{\infty }}{4 !} \bigl\vert ( \tilde{\tau _{j}} -t_{0}) ( \tilde{\tau _{j}} -t_{1}) ( \tilde{\tau _{j}} -t_{2}) ( \tilde{\tau _{j}} -t_{3}) \bigr\vert \int _{t_{j}}^{t_{j+1}}(t_{k+1}- \tau )^{\alpha -1} \,d\tau \\ &{} + \sum_{j=3}^{k} \frac{ \Vert F^{(4)} \Vert _{\infty }}{4 !} \bigl\vert ( \tilde{\tau _{j}} -t_{j-2}) ( \tilde{\tau _{j}} -t_{j-1}) ( \tilde{\tau _{j}} -t_{j }) ( \tilde{\tau _{j}} -t_{j+1}) \bigr\vert \int _{t_{j}}^{t_{j+1}} (t_{k+1}-\tau )^{\alpha -1} \,d\tau \Biggr]. \end{aligned}$$

Here, \(\tilde{\tau _{j}} \in [t_{j},t_{j+1} ] \) and the second integral mean value theorem is used. By the definition of \(t_{j}=jh\) and after evaluating the integrals in the above inequality, we get

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert \leq {}& \frac{1}{ \Gamma (\alpha )} \Biggl[ \frac{ \Vert F^{(4)} \Vert _{\infty }}{4 !} (3h)^{4} \sum_{j=0}^{2} \frac{1}{\alpha } \bigl[ (t_{k+1}-t_{j})^{\alpha }-(t_{k+1}-t_{j+1})^{ \alpha } \bigr] \\ & {}+ \frac{ \Vert F^{(4)} \Vert _{\infty }}{4 !} (3h)^{4} \sum_{j=3}^{k} \frac{1}{\alpha } \bigl[ (t_{k+1}-t_{j})^{\alpha }-(t_{k+1}-t_{j+1})^{ \alpha } \bigr] \Biggr], \\ \bigl\vert r_{k+1}(h) \bigr\vert \leq {}& \frac{1}{ \Gamma (\alpha )} \frac{1}{\alpha } \frac{ \Vert F^{(4)} \Vert _{\infty }}{4 !} (3h)^{4} \sum _{j=0}^{k} \bigl[ (t_{k+1}-t_{j})^{\alpha }-(t_{k+1}-t_{j+1})^{\alpha } \bigr]. \end{aligned}$$

The series in the above expression can be easily summed up, which yields

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert \leq & \frac{3^{4} \Vert F^{(4)} \Vert _{\infty }}{4! \Gamma ( \alpha +1) } h^{4} (t_{k+1}-t_{0})^{ \alpha } = \biggl( \frac{3^{4} \Vert F^{(4)} \Vert _{\infty }T^{\alpha }}{4! \Gamma ( \alpha +1) } \biggr) h^{4}. \end{aligned}$$

 □

Theorem 2

Let \(r_{k+1}(h) \) be the truncation error defined in (19). If \(F(\tau ) \in C^{5}[0,T]\) for some suitable chosen T, then for numerical algorithm II (13) and (18) there exists a positive constant \(C>0 \), independent of h, such that

$$\begin{aligned} \bigl\vert r_{k+1}(h) \bigr\vert \leq C h^{5}. \end{aligned}$$

Proof

The proof is similar to the proof of Theorem 1. We omit the proof here. □

4 Stability analysis

The stability of a numerical scheme mainly refers to that if there is a perturbation in the initial condition, then the small change causes small errors in the numerical solution [40, 41]. Suppose that \(y_{k+1}\) and \(\tilde{y}_{k+1}\) are numerical solutions in (10), and the initial conditions are given by \(y^{(i)}_{0}\) and \(\tilde{y}^{(i)}_{0}\) respectively. If there exists a positive constant C independent of h such that

$$\begin{aligned} \vert y_{k+1} - \tilde{y}_{k+1} \vert \leq C_{\alpha,T} \Vert y_{0}- \tilde{y}_{0} \Vert _{\infty }, \end{aligned}$$
(22)

then we conclude that scheme (10) is stable [42]. It is similar to defining the numerical stability for numerical algorithm II (13) and (18). Assume that \(F(\tau ) \) is sufficiently smooth and \(C_{\alpha }>0\) is independent of all discretization parameters. Firstly, we introduce two lemmas which will be used in stability analysis.

Lemma 1

For the weights of novel scheme (10), we have

$$\begin{aligned} \sum_{j=0}^{k+1} \bigl\vert d^{k+1}_{j} \bigr\vert \leq C_{\alpha }T^{\alpha }, \end{aligned}$$
(23)

where \(C_{\alpha }\) only depends on α.

Proof

For \(d^{k+1}_{0}\), we have

$$\begin{aligned} \bigl\vert d^{k+1}_{0} \bigr\vert = {}& \Biggl\vert \sum _{j=0}^{2} \int _{t_{j}}^{t_{j+1}} (t_{k+1} - \tau )^{\alpha -1} \frac{\tau -t_{1}}{t_{0} -t_{1}} \frac{\tau -t_{2}}{t_{0} -t_{2}} \frac{\tau -t_{3}}{t_{0} -t_{3}} \,d \tau \Biggr\vert \\ \leq{}& \sum_{j=0}^{2} \int _{t_{j}}^{t_{j+1}} \bigl\vert (t_{k+1} - \tau )^{\alpha -1} \bigr\vert \biggl\vert \frac{\tau -t_{1}}{t_{0} -t_{1}} \frac{\tau -t_{2}}{t_{0} -t_{2}} \frac{\tau -t_{3}}{t_{0} -t_{3}} \biggr\vert \,d \tau \\ \leq{}& \sum_{j=0}^{2} \biggl\vert \frac{ \tilde{\tau }_{j} -t_{1}}{t_{0} -t_{1}} \frac{ \tilde{\tau }_{j} -t_{2}}{t_{0} -t_{2}} \frac{ \tilde{\tau }_{j} -t_{3}}{t_{0} -t_{3}} \biggr\vert \int _{t_{j}}^{t_{j+1}} (t_{k+1} - \tau )^{\alpha -1} \,d \tau,\quad \tilde{\tau }_{j} \in [ t_{j}, t_{j}+1], \\ \bigl\vert d^{k+1}_{0} \bigr\vert \leq {}& \frac{1}{6h^{3}} \bigl\vert (\xi _{1} h -h) ( \xi _{1} h -2h) (\xi _{1} h -3h) \bigr\vert \frac{1}{\alpha } \bigl[ (t_{k+1} )^{ \alpha } - (t_{k+1} - t_{1} )^{\alpha } \bigr] \\ &{}+ \frac{1}{6h^{3}} \bigl\vert (\xi _{2} h -h) (\xi _{2} h -2h) (\xi _{2} h -3h) \bigr\vert \frac{1}{\alpha } \bigl[ (t_{k+1}-t_{1} )^{\alpha } - (t_{k+1} - t_{2} )^{ \alpha } \bigr] \\ &{}+ \frac{1}{6h^{3}} \bigl\vert (\xi _{3} h -h) (\xi _{3} h -2h) (\xi _{3} h -3h) \bigr\vert \frac{1}{\alpha } \bigl[ (t_{k+1}-t_{2} )^{\alpha } - (t_{k+1} - t_{3} )^{ \alpha } \bigr], \end{aligned}$$

where \(j-1 \leq \xi _{j} \leq j\), \(j=1,2,3\). Therefore we have

$$\begin{aligned} \bigl\vert d^{k+1}_{0} \bigr\vert \leq \frac{1}{6h^{3}} \frac{1}{\alpha } t_{k+1}^{\alpha } \bigl( 6h^{3} +2 h^{3} +2 h^{3} \bigr) \leq \frac{5}{3\alpha }T^{\alpha }. \end{aligned}$$

Using similar analysis it can be shown that for \(j=1,2,3,k-1,k,k+1\) there exists \(C_{\alpha }\), which has dissimilar values at each case, such that the following inequality holds:

$$\begin{aligned} \bigl\vert d^{k+1}_{j} \bigr\vert \leq C_{\alpha }T^{\alpha },\quad j=1,2,3,k-1,k,k+1. \end{aligned}$$
(24)

For \(j=4,5,\ldots,k-2\), we have

$$\begin{aligned} \sum_{j=4}^{k-2} \bigl\vert d^{k+1}_{j} \bigr\vert \leq {}& \sum _{j=4}^{k-2} \biggl[ \int _{t_{j-1} }^{t_{j}} \bigl\vert (t_{k+1} - \tau )^{\alpha -1} \bigr\vert \biggl\vert \frac{\tau -t_{j-3}}{t_{j} -t_{j-3}} \frac{\tau -t_{j-2}}{t_{j} -t_{j-2}} \frac{\tau -t_{j-1}}{t_{j} -t_{j-1}} \biggr\vert \,d \tau \\ & {}+ \int _{t_{j}}^{t_{j+1}} \bigl\vert (t_{k+1} - \tau )^{\alpha -1} \bigr\vert \biggl\vert \frac{\tau -t_{j-2}}{t_{j} -t_{j-2}} \frac{\tau -t_{j-1}}{t_{j} -t_{j-1}} \frac{\tau -t_{j+1}}{t_{j} -t_{j+1}} \biggr\vert \,d \tau \\ &{}+ \int _{t_{j+1} }^{t_{j+2}} \bigl\vert (t_{k+1} - \tau )^{\alpha -1} \bigr\vert \biggl\vert \frac{\tau -t_{j-1}}{t_{j} -t_{j-1}} \frac{\tau -t_{j+1}}{t_{j} -t_{j+1}} \frac{\tau -t_{j+2}}{t_{j} -t_{j+2}} \biggr\vert \,d \tau \\ &{}+ \int _{t_{j+2} }^{t_{j+3}} \bigl\vert (t_{k+1} - \tau )^{\alpha -1} \bigr\vert \biggl\vert \frac{\tau -t_{j+1}}{t_{j} -t_{j+1}} \frac{\tau -t_{j+2}}{t_{j} -t_{j+2}} \frac{\tau -t_{j+3}}{t_{j} -t_{j+3}} \biggr\vert \,d \tau \biggr], \\ \sum_{j=4}^{k-2} \bigl\vert d^{k+1}_{j} \bigr\vert \leq {}& \sum _{j=4}^{k-2} \biggl[ \biggl\vert \frac{\tilde{\tau }_{1} -t_{j-3}}{ 3h } \frac{ \tilde{\tau }_{1} -t_{j-2}}{ 2h } \frac{ \tilde{\tau }_{1} -t_{j-1}}{ h } \biggr\vert \int _{t_{j-1} }^{t_{j}} (t_{k+1} - \tau )^{\alpha -1} \,d \tau \\ &{} + \biggl\vert \frac{ \tilde{\tau }_{2} -t_{j-2}}{ 2h } \frac{ \tilde{\tau }_{2} -t_{j-1}}{ h } \frac{ \tilde{\tau }_{2} -t_{j+1}}{ -h } \biggr\vert \int _{t_{j}}^{t_{j+1}} (t_{k+1} - \tau )^{\alpha -1} \,d \tau \\ &{}+ \biggl\vert \frac{ \tilde{\tau }_{3} -t_{j-1}}{ h } \frac{ \tilde{\tau }_{3} -t_{j+1}}{ -h } \frac{ \tilde{\tau }_{3} -t_{j+2}}{ -2h } \biggr\vert \int _{t_{j+1} }^{t_{j+2}} (t_{k+1} - \tau )^{\alpha -1} \,d \tau \\ &{}+ \biggl\vert \frac{ \tilde{\tau }_{4} -t_{j+1}}{ -h } \frac{ \tilde{\tau }_{4} -t_{j+2}}{ -2h } \frac{ \tilde{\tau }_{4} -t_{j+3}}{ -3h } \biggr\vert \int _{t_{j+2} }^{t_{j+3}} (t_{k+1} - \tau )^{\alpha -1} \,d \tau \biggr], \end{aligned}$$

where \(\tilde{\tau }_{1} \in [t_{j-1},t_{j}] \), \(\tilde{\tau }_{2} \in [t_{j },t_{j+1} ] \), \(\tilde{\tau }_{3} \in [t_{j +1 },t_{j+2} ] \), and \(\tilde{\tau }_{4} \in [t_{j +2 },t_{j+3} ] \). Hence, the above equation has the simplified form

$$\begin{aligned} \sum_{j=4}^{k-2} \bigl\vert d^{k+1}_{j} \bigr\vert \leq {}& \biggl\vert \frac{6h^{3}}{6h^{3}} \biggr\vert \frac{1}{\alpha } \sum _{j=4}^{k-2} \bigl[ (t_{k+1}-t_{j-1} )^{\alpha } - (t_{k+1} - t_{j} )^{\alpha } \bigr] + \sum_{j=4}^{k-2} \bigl[ (t_{k+1}-t_{j} )^{\alpha } - (t_{k+1} - t_{j+1} )^{\alpha } \bigr] \\ &{}+ \sum_{j=4}^{k-2} \bigl[ (t_{k+1}-t_{j+1} )^{\alpha } - (t_{k+1} - t_{j+2} )^{\alpha } \bigr] + \sum_{j=4}^{k-2} \bigl[ (t_{k+1}-t_{j+2} )^{ \alpha } - (t_{k+1} - t_{j+3} )^{\alpha } \bigr] \\ ={}& \frac{1}{\alpha } \bigl[ \bigl[ (t_{k+1}-t_{3} )^{\alpha } - (t_{k+1} - t_{k-2} )^{\alpha } \bigr] + \bigl[ (t_{k+1}-t_{4} )^{\alpha } - (t_{k+1} - t_{k-1} )^{\alpha } \bigr] \\ &{} + \bigl[ (t_{k+1}-t_{5} )^{\alpha } - (t_{k+1} - t_{k} )^{\alpha } \bigr] + (t_{k+1}-t_{6} )^{\alpha } \bigr], \\ \sum_{j=4}^{k-2} \bigl\vert d^{k+1}_{j} \bigr\vert \leq{} & \frac{1}{\alpha } (t_{k+1}-t_{3} )^{\alpha }+ (t_{k+1}-t_{4} )^{\alpha }+ (t_{k+1}-t_{5} )^{\alpha } + (t_{k+1}-t_{6} )^{\alpha } - \bigl[t_{3}^{\alpha }+t_{2}^{\alpha }+t_{1}^{\alpha } \bigr] \\ \leq {}&\frac{4}{\alpha } t_{k+1}^{\alpha }. \end{aligned}$$

Combining all the above results, by choosing sufficiently large \(C_{\alpha }\) and also sufficiently small T, one can get (23) to complete the proof of the lemma. □

Lemma 2

For the weights of the novel scheme (18), we have

$$\begin{aligned} \sum_{j=0}^{k+1} \bigl\vert d^{k+1}_{j} \bigr\vert \leq C_{\alpha }T^{\alpha }, \end{aligned}$$
(25)

where \(C_{\alpha }\) only depends on α.

Proof

The idea of the proof is similar to that of Lemma 1, so it is omitted. □

Theorem 3

Assume that \(y_{j}\) \((j = 1, 2, \ldots, k)\) are the solutions of scheme (10). Then the presented scheme (10) is stable.

Proof

Suppose that \(y_{k+1}\) and \(\tilde{y}_{k+1}\) are numerical solutions in (10) and the initial conditions are given by \(y^{(i)}_{0}\) and \(\tilde{y}^{(i)}_{0}\) respectively. We shall use mathematical induction. Assume that

$$\begin{aligned} \vert y_{j} - \tilde{y}_{j} \vert \leq C_{\alpha,T} \Vert y_{0}- \tilde{y}_{0} \Vert _{\infty } \end{aligned}$$
(26)

is true for \((j=0,1,\ldots,k )\). We must prove that this also holds for \(j=k+1\). Note that, by assumptions of the given initial conditions, the induction basis \((j=0)\) is presupposed.

$$\begin{aligned} \vert y_{k+1}- \tilde{y}_{k+1} \vert \leq{}& \sum _{i=0}^{ \lceil \alpha \rceil -1}\frac{t_{k+1}^{i}}{i!} \bigl\vert y^{(i)}_{0} - \tilde{y}^{(i)}_{0} \bigr\vert + \frac{1}{\Gamma (\alpha )} \Biggl( \sum_{j=0}^{k} \bigl\vert d_{j}^{k+1} \bigr\vert \bigl\vert f(t_{j},y_{j} ) - f(t_{j}, \tilde{y}_{j} ) \bigr\vert \\ & {}+ \bigl\vert d_{k+1}^{k+1} \bigr\vert \bigl\vert f(t_{k+1},y_{k+1} ) - f(t_{k+1}, \tilde{y}_{k+1}) \bigr\vert \Biggr) \\ \leq{}& C_{1} \Vert y_{0}-\tilde{y}_{0} \Vert _{\infty }+ \frac{ \vert \beta \vert }{\Gamma (\alpha )} \Biggl( \sum _{j=0}^{k} \bigl\vert d_{j}^{k+1} \bigr\vert \vert y_{j}- \tilde{y}_{j} \vert + \bigl\vert d_{k+1}^{k+1} \bigr\vert \vert y_{k+1} - \tilde{y}_{k+1} \vert \Biggr). \end{aligned}$$

Utilizing Lemma 1, one can get

$$\begin{aligned} \vert y_{k+1}- \tilde{y}_{k+1} \vert & \leq C_{1} \Vert y_{0}-\tilde{y}_{0} \Vert _{\infty }+ \frac{ \vert \beta \vert }{\Gamma (\alpha )} \Bigl( C_{1,\alpha } T^{\alpha }\max _{0 \leq j \leq k } \vert y_{j}- \tilde{y}_{j} \vert + C_{k+1,\alpha } T^{\alpha } \vert y_{k+1} - \tilde{y}_{k+1} \vert \Bigr) \\ \leq & \frac{1}{1- ( \vert \beta \vert C_{k+1,\alpha } T^{\alpha } ) / \Gamma (\alpha )} \biggl( C_{1} \Vert y_{0}- \tilde{y}_{0} \Vert _{\infty }+ \frac{ \vert \beta \vert }{\Gamma (\alpha )} C_{1,\alpha } T^{\alpha }\max_{0\leq j \leq k } \vert y_{j}- \tilde{y}_{j} \vert \biggr). \end{aligned}$$

Now, for sufficiently small T, one can end the proof using mathematical induction (26) and by choosing constant \(C_{\alpha,T}\) sufficiently large. □

Theorem 4

Assume that \(y_{j}\) \((j = 1, 2, \ldots, k)\) are the solutions of algorithm II (13) and (18). Then the presented algorithm II is stable.

Proof

The proof is similar to Theorem 3. □

5 Linear stability analysis

Following the ideas of [43, 44], consider the following test problem to investigate stability region of the presented methods:

$$\begin{aligned} _{0}^{C}D^{\alpha }_{t} y(t)= \lambda y(t), \qquad y(t_{0})=y_{0},\quad 0 < \alpha < 1, \end{aligned}$$
(27)

where \(\lambda \in \mathbb{C}\) is a complex number. The new method (13) and (18) gives the following iteration formula for solving (27):

$$\begin{aligned} y_{k+1}= y_{0} + \frac{1}{\Gamma (\alpha )} \sum _{i=0}^{k+1} \frac{h^{\alpha }}{12\alpha (\alpha +1)(\alpha +2)(\alpha +3) (\alpha +4) } \hat{b}^{k+1}_{j} \lambda y_{j}. \end{aligned}$$
(28)

Denoting \(z=\lambda h^{\alpha }\), we get

$$\begin{aligned} z=12 \Gamma (\alpha +5) \frac{y_{k+1}-y_{0}}{\sum_{i=0}^{k+1} \hat{b}^{k+1}_{j} y_{j} }. \end{aligned}$$
(29)

Let \(y_{j} = \xi ^{j} \), then by assuming \(\xi =e^{i \theta }\) with \(0 \leq \theta \leq 2 \pi \) we get the following stability region for scheme (10):

$$\begin{aligned} S= \biggl\{ z: z=12 \Gamma (\alpha +5) \frac{\xi ^{k+1}-\xi ^{0}}{\sum_{j=0}^{k+1} \hat{b}^{k+1}_{k+1-j} \xi ^{j} } \biggr\} . \end{aligned}$$
(30)

The stability region of algorithm I (10) can be achieved in a quite similar way. The stability region of numerical algorithm I is obtained in Figs. 1 and 2 by choosing \(k= 2000\), and that of numerical algorithm II is shown in Figs. 3 and 4 by choosing \(k= 500\). The stability region in Figs. 1 and 3 is inside of the boundary, and it is outside of the boundary in Figs. 2 and 4.

Figure 1
figure 1

Stability region of numerical algorithm I

Figure 2
figure 2

Stability region of numerical algorithm I

Figure 3
figure 3

Stability region of numerical algorithm II

Figure 4
figure 4

Stability region of numerical algorithm II

6 Numerical results

To check the numerical errors between the exact and the numerical solution, numerical experiments are carried out in this section. The presented examples have exact solutions and also have been solved by other numerical methods from literature. This allows one to compare the numerical results obtained by the presented schemes with the analytical solutions or those obtained by other methods. We also aim to graphically investigate the convergence order of the presented algorithms using the idea of [27] and [28]. The experimental orders of convergence (EOC) of the algorithms are measured by

$$\begin{aligned} EOC= \log _{2} \biggl( \frac{E(h)}{E(h/2)} \biggr), \end{aligned}$$

where \(E(h)\) is the absolute error \(| y(t_{j}) - y_{j} | \) at \(t=1\) for the step size h. By the results of Theorems 1 and 2, we have

$$\begin{aligned} \bigl\vert E (h) \bigr\vert = \bigl\vert y(t_{j}) - y_{j} \bigr\vert \leq C h^{\mathrm{order}} \quad\Rightarrow\quad \log _{2} \bigl( \bigl\vert E (h) \bigr\vert \bigr) = \log _{2} ( C ) + (\mathrm{order}) \times \log _{2} ( h ), \end{aligned}$$

where \((order)\) is 4 for the presented algorithm (10) and is 5 for the presented algorithm (13) and (18). Before proceeding, we first define some notations. Let \(Y= \log _{2} ( \vert E (h) \vert ) \) and \(X= \log _{2} ( h ) \), also we use algorithm I to denote the presented algorithm (10) and algorithm II to denote the presented algorithm (13) and (18). We use \(E_{I}\) and \(E_{II}\) to denote the absolute error of algorithm I and algorithm II respectively. To graphically examine the order of convergence, we shall plot the straight line \(y= (order) \times x \) and also the function \(Y=Y(X)\). The parallelism of these two lines can confirm the results of Theorems 1 and 2. Numerical computations are carried out with the help of MATLAB R2014a on an Intel(R) Core(TM)2 Duo CPU (2.67 GHz, 4 GB RAM) Windows 7 system.

Example 1

Consider the following fractional differential equation:

$$\begin{aligned} _{0}^{C}D^{\alpha }_{t} y(t) = \beta y(t)+g(t),\qquad y(0)=0, \end{aligned}$$
(31)

where

$$\begin{aligned} \beta =-1, g(t) = \frac{\Gamma (\nu +1)}{\Gamma ( \nu +1 -\alpha )} t^{\nu -\alpha } + t^{ \nu }, \quad\nu >0. \end{aligned}$$

The exact solution is \(y(t)=t^{\nu }\). At the time \(t = 1\), for different step sizes h and different α, the approximate solutions for equation (31) are obtained for two values of \(\nu =4\) and \(\nu =3.45\) by using the presented algorithms.

First, we choose \(\nu =4\), which for this case \(y(t)\) is a sufficiently smooth function. The absolute errors of the presented algorithms and of the method reported in Ref. [45] are shown in Table 1. This table shows that novel schemes are valid methods in solving a fractional differential equation. Although the convergence ratios in Table 1 are a bit slower, they are not too far from our analytical results. This can be mainly due to some round-off errors during the computations of the algorithms. In Figs. 56, we plot the experimentally determined orders of convergence (EOC) for different values of α at the time \(t=1\). Figure 5 shows the straight line \(y=4x \) and the function \(Y=Y(X)\), where \(E(h)\) is computed by algorithm I. One can see that these two lines are exactly parallel for different values of α, which implies that the EOC of algorithm I indeed is \(O(h^{4})\). Figure 6 shows the straight line \(y=5x \) and the function \(Y=Y(X)\), where \(E(h)\) is computed by algorithm II. One can see that these two lines are parallel for different values of α, which implies that the EOC of algorithm II indeed is \(O(h^{5})\).

Figure 5
figure 5

The experimentally determined orders of convergence for algorithm I at \(t=1\) for (31) with \(\nu =4\)

Figure 6
figure 6

The experimentally determined orders of convergence for algorithm II at \(t=1\) for (31) with \(\nu =4\)

Table 1 The absolute errors of the presented algorithm I (\(E_{I}\)), algorithm II (\(E_{II}\)), and the numerical method of [45] for (31) with \(\alpha =0.1\), \(\nu =4\)

Second, we choose \(\nu =3.45\), which for this case \(y(t) \in C^{3} [0, 1] \), so it is not a sufficiently smooth function. This case enables us to check the efficiency of the presented algorithms when the solution is not sufficiently smooth, namely \(y(t) \notin C^{4} [0, 1] \) for algorithm I and \(y(t) \notin C^{5} [0, 1] \) for algorithm II. The absolute errors of the presented algorithms for \(\alpha =0.2\) are presented in Table 2. From Table 2 we see that for this case the method has still high accuracy and has acceptable convergence ratios. Figures 78 show the EOC of the algorithms for different values of α at the time \(t=1\). As explained in the later case (\(\nu =4\)), from Figs. 78, again we can confirm the results of Theorems 1 and 2.

Figure 7
figure 7

The experimentally determined orders of convergence for algorithm I at \(t=1\) for (31) with \(\nu =3.45\) (\(y(t)\) is not sufficiently smooth)

Figure 8
figure 8

The experimentally determined orders of convergence for algorithm II at \(t=1\) for (31) with \(\nu =3.45\) (\(y(t)\) is not sufficiently smooth)

Table 2 The absolute errors of the presented algorithm I (\(E_{I}\)) and algorithm II (\(E_{II}\)) for (31) with \(\alpha =0.2\), \(\nu =3.45\)

Example 2

Consider the following fractional differential equation:

$$\begin{aligned} {}_{0}^{C} D ^{\alpha }_{t} y(t) = \frac{24}{\Gamma (5-\alpha )}t^{4- \alpha } -\frac{3}{\Gamma (4-\alpha )}t^{3-\alpha } - \frac{1}{2} t^{3} - y(t) + t^{4},\quad y(0)=0. \end{aligned}$$
(32)

The exact solution is \(y(t)= t^{4}-\frac{1}{2} t^{3}\). Table 3 shows the absolute errors of the presented schemes and the method reported in Ref. [46] at the time \(t=1\). From this table it is observed that the error of the presented method has decreased significantly. In Figs. 910, we plot the EOC for different values of α at the time \(t=1\). Figure 9 examines the EOC of algorithm I. The details of this figure are explained in Example 1 (Figure 5). We can see that the lines \(y=4x \) and \(Y=Y(X)\) are exactly parallel, which verifies the results of Theorem 1. Figure 10 examines the EOC of algorithm II. The details of this figure are explained in Example 1 (Figure 6). We can see that the lines \(y=5x \) and \(Y=Y(X)\) are parallel, which verifies the results of Theorem 2.

Figure 9
figure 9

The experimentally determined orders of convergence for algorithm I at \(t=1\) for (32)

Figure 10
figure 10

The experimentally determined orders of convergence for algorithm II at \(t=1\) for (32)

Table 3 Absolute errors of the present presented algorithm I (\(E_{I}\)), algorithm II (\(E_{II}\)), and the numerical methods of [46], with \(\alpha = 0.3\) for (32)

Example 3

In this example we aim to examine the validity and efficiency of the presented methods when they are applied to solve a fractional order system of differential equations. Consider the following initial value problem:

$$\begin{aligned} \textstyle\begin{cases} {}_{0}^{C} D ^{\alpha }_{t} x(t) =-x(t), \\ {}_{0}^{C} D ^{\alpha }_{t} y(t) =2x(t)+y(t)-9z(t), \\ {}_{0}^{C} D ^{\alpha }_{t} z(t)=3x(t)+6y(t)+z(t). \end{cases}\displaystyle \end{aligned}$$
(33)

The exact solution of this system is [47]

$$\begin{aligned} \begin{pmatrix} x(t) \\ y(t) \\ z(t) \end{pmatrix}={}& c_{1} \begin{pmatrix} 58 \\ -31 \\ 6 \end{pmatrix} E_{\alpha } \bigl(-t^{\alpha }\bigr) \\ & + \frac{c_{2}}{2} \begin{pmatrix} 0 \\ 0 \\ 2 \end{pmatrix} \bigl( E_{\alpha } \bigl((1+3 \sqrt{6})t^{\alpha } \bigr)+E_{\alpha } \bigl((1-3\sqrt{6})t^{\alpha } \bigr) \bigr) \\ &{} - \frac{c_{2}}{2i} \begin{pmatrix} 0 \\ \sqrt{6} \\ 0 \end{pmatrix} \bigl( E_{\alpha } \bigl((1+3 \sqrt{6})t^{\alpha } \bigr)-E_{\alpha } \bigl((1-3\sqrt{6})t^{\alpha } \bigr) \bigr) \\ &{} + \frac{c_{3}}{2} \begin{pmatrix} 0 \\ \sqrt{6} \\ 0 \end{pmatrix} \bigl( E_{\alpha } \bigl((1+3 \sqrt{6})t^{\alpha } \bigr)+E_{\alpha } \bigl((1-3\sqrt{6})t^{\alpha } \bigr) \bigr) \\ &{} + \frac{c_{3}}{2i} \begin{pmatrix} 0 \\ 2 \\ 0 \end{pmatrix} \bigl( E_{\alpha } \bigl((1+3 \sqrt{6})t^{\alpha } \bigr)-E_{\alpha } \bigl((1-3\sqrt{6})t^{\alpha } \bigr) \bigr). \end{aligned}$$

Under the initial conditions \((x(0),y(0),z(0) )=(-3,5,0)\), we have

$$\begin{aligned} (c_{1},c_{2},c_{3})=(-0.05172,0.15517,1.38664). \end{aligned}$$

We solve system (33) using the presented algorithms numerically. Figure 11 shows the difference between the curves of exact and approximate solutions for \(\alpha =0.925\) with \(h=1/80\). It is observed that the numerical solutions obtained by algorithm I and algorithm II are in excellent agreement with the exact solution. Figure 12(a) shows the exact and approximate solutions of system (33) obtained by algorithm I for \(t=50\) with \(\alpha =0.95\), \(h=1/40\). Figure 12(b) shows the exact and approximate solutions of system (33) obtained by algorithm II for \(t=50\) with \(\alpha =0.975\), \(h=1/40\). From Fig. 12 it is observed that the numerical solutions are at very good agreement with the exact solution and the presented algorithms are still valid and capable of solving problems in a large scale computational domain.

Figure 11
figure 11

Comparison of solutions for IVP (33) (\(\alpha =0.925\), \(h=1/80\))

Figure 12
figure 12

Comparison of solutions for IVP (33) (\(t=50\), \(h=1/40\))

7 Conclusion

This paper provides two high order numerical schemes with theoretically proved convergence order of 4 and 5 for solving FDEs. The properties of the Caputo derivative are used to reduce FDEs into a Volterra integral equation. After dividing the total domain into a set of grid points, the piecewise Lagrange interpolation polynomials of degree three and degree four are utilized to approximate unknown functions. The stability and error estimate of the methods are investigated. Moreover, graphical illustrations for the stability region of the schemes are derived. In the numerical results, the accuracy and convergence orders of the developed algorithms have been studied. Numerical results confirm the theoretical results of the algorithms. Furthermore, we extended the presented algorithms to solve a 3D fractional order system of equations. It is shown that the algorithms are valid and efficient for solving a linear fractional system, and it is observed that the algorithms are capable of solving large domain problems. In the future, we shall try to follow this idea to construct higher order schemes for solving nonlinear FDEs.