1 Introduction

In recent years, the glorious developments have been envisaged in the field of fractional calculus and fractional differential equations. Differential equations involving fractional-order derivatives are used to model a variety of systems, whose important applications lie in the field of chemical physics, biomedical engineering (Magin 2004), viscoelasticity (Freed and Diethelm 2006), electricity (Vosika et al. 2013), finance (Gorenflo et al. 2001), control theory (Wang and Zhou 2011), fluid mechanics, and other sciences [see (Hilfer 2000; Miller and Ross 1974; Chen et al. 2014) and references therein]. In fact, it has been found that the fractional-order models are more adequate than the previously used integer-order models (Vyawahare and Nataraj 2013; Yu et al. 2013; Dehghan et al. 2010), because fractional-order derivatives and integrals enable the description of the memory and hereditary properties of different substances.

Due to its tremendous scope and applications in several disciplines, considerable attention has been given to exact and numerical solutions of fractional differential equations. The numerical approximation of fractional differentiation of rough functions is not easy as it is an ill-posed problem. In order to achieve the goal of highly accurate and reliable solutions, several methods have been proposed to solve the fractional-order differential equations. The most commonly used methods are Adomian decomposition (Odibat and Momani 2008; Momani and Odibat 2007), variational iteration (Sweilam et al. 2007; Das 2009), homotopy analysis (Pandey et al. 2011), convolution quadrature time descretization (Cuesta et al. 2006), operational CAS wavelets (Saeedi et al. 2011; Saeedi and Mohseni Moghadam 2011), fractional differential transform (Arikoglu and Ozkol 2007), predictor–corrector (Zhao and Deng 2014), finite difference method (Meerschaert and Tadjeran 2006), etc.

Spectral methods are powerful and widely used tools for solving several types of differential equations, function approximation, and variational problems (Canuto et al. 1988). Two main advantages of such methods are giving very accurate approximations for smooth solutions and ease of applying them, which encourage many authors to utilize them (Canuto et al. 1988; Doha and Bhrawy 2008; Doha et al. 2011). One of the ways of applying spectral methods is using operational matrices. The operational matrix of fractional derivative and integration have been determined for several types of orthogonal polynomials such as Jacobi (Doha et al. 2012), Chebyshev (Bhrawy et al. 2012; Bhrawy and Alofi 2013), Legendre (Bhrawy et al. 2015a, b), Laguerre (Bhrawy and Alghamdi 2013), and Bernestein polynomials (Saadatmandi 2014).

The motivation of the present work is to extend the application of linear B-spline scaling functions to provide approximate numerical solution of linear and nonlinear differential equations of fractional order in an operational matrix method.

The outline of this paper is as follows: In Sect. 2, we introduce some necessary definitions and mathematical preliminaries of fractional calculus and the basic formulation of linear cardinal B-splines and linear B-spline scaling functions. Section 3 is devoted to deriving the linear B-spline scaling function operational matrix of fractional integration. We discuss the error bound when using the linear B-spline scaling functions approximation, in Sect. 4. Finally, in Sect. 5, we apply the linear B-spline scaling function and its operational matrices to solve four examples.

2 Basic Definitions

2.1 Fractional Integral and Differential Operators

Fractional calculus is an almost 300 year-old topic. The first serious attempt to give logical definition is due to Liouville. Since then, several definitions of fractional derivatives and fractional integrals have been proposed. The definitions include the Riemann–Liouville, the Caputo, the Weil, the Hadmard, the Riesz, the Grunwald–Letnikov, and the Erdelyi–Kober. The Caputo fractional derivative allows the utilization of initial and boundary conditions involving integer-order derivatives, which have clear physical interpretations. Therefore, in the present work we use the Caputo derivative, proposed by Caputo in his work on the theory of viscoelasticity (Caputo 1967).

Definition 1

Let \(u \in L_{1}\), \(\alpha \ge 0\). The Riemman–Liouville fractional integral of order \(\alpha\) of \(u(t)\) is defined as:

$$I^{\alpha } u(t) = \left\{ {\begin{array}{*{20}l} {\frac{1}{\varGamma (\alpha )}\int_{0}^{t} (t - \tau )^{\alpha - 1} u(\tau ){\text{d}}\tau ,} \hfill & {{\kern 1pt} \alpha > 0;{\kern 1pt} } \hfill \\ {u(t),} \hfill & {{\kern 1pt} \alpha = 0.{\kern 1pt} } \hfill \\ \end{array} } \right. t > 0,$$
(1)

where \(\varGamma (.)\) is the gamma function.

Definition 2

The Caputo fractional derivative of order \(\alpha\) of \(u(t)\) is defined by:

$$D_{*}^{\alpha } u(t) = \left\{ {\begin{array}{*{20}l} {I^{n - \alpha } \frac{{{\text{d}}^{n} }}{{{\text{d}}t^{n} }}u(t),} \hfill & {{\kern 1pt} n - 1 < \alpha < n;{\kern 1pt} } \hfill \\ {\frac{{{\text{d}}^{n} }}{{{\text{d}}t^{n} }}u(t),} \hfill & {{\kern 1pt} \alpha = n.{\kern 1pt} } \hfill \\ \end{array} } \right.$$
(2)

Some properties of the fractional operator are pointed out in Podlubny (1999), as the following:

  1. 1.

    The fractional integral of \((t - a)^{\beta } , \beta > - 1\), is given as:

    $$I^{\alpha } (t - a)^{\beta } = \frac{\varGamma (\beta + 1)}{\varGamma (\alpha + \beta + 1)}(t - a)^{\alpha + \beta } , \;\; a \ge 0.$$
    (3)
  2. 2.

    The Riemann–Liouville fractional integral is a linear operation, namely:

    $$I^{\alpha } (\lambda u(t) + \mu v(t)) = \lambda I^{\alpha } u(t) + \mu I^{\alpha } v(t),$$
    (4)

    where \(\lambda\) and \(\mu\) are constants.

  3. 3.

    For \(\alpha , \beta > 0\), the fractional integral and derivatives satisfy the following semigroup and commutative properties, respectively:

    $$I^{\alpha } I^{\beta } u(t) = I^{\beta } I^{\alpha } u(t) = I^{\alpha + \beta } u(t),$$
    (5)
    $$D^{\alpha } D^{\beta } u(t) = D^{\beta } D^{\alpha } u(t) = D^{\alpha + \beta } u(t).$$
    (6)
  4. 4.

    The fractional integral and derivative operators do not commute in general, i.e.:

    $$I^{\alpha } D^{\alpha } f(t) = u(t) - \sum\limits_{k = 0}^{n - 1} u^{(k)} (0)\frac{{t^{k} }}{k!},$$
    (7)

    but in converse, we have:

    $$D^{\alpha } I^{\beta } u(t) = D^{\alpha - \beta } u(t).$$
    (8)

2.2 Linear Cardinal B-Spline Functions

The mth-order cardinal B-spline, \(N_{m} (t)\), whose knot sequence is \(\{ \ldots , - 1,0,1, \ldots \}\) consists of polynomials of order \(m\) (degree \(m - 1\)) between the knots. Let \(N_{1} (t) = \chi_{[0,1]} (t)\) be the characteristic function of \([0,1]\), then for each integer \(m \ge 2\), the mth-order cardinal B-spline is defined inductively by (Goswami and Chan 1999) as follows:

$$N_{m} (t) = (N_{m - 1} * N_{1} )(t) = \int_{ - \infty }^{\infty } N_{m - 1} (t - \tau )N_{1} (\tau ){\text{d}}\tau = \int_{0}^{1} N_{m - 1} (t - \tau ){\text{d}}\tau .$$
(9)

It can be shown that \(N_{m} (t)\) for \(m \ge 2\) may be achieved using the following recursive (de Boor 1978) formula:

$$N_{m} (t) = \frac{t}{m - 1}N_{m - 1} (t) + \frac{m - t}{m - 1}N_{m - 1} (t - 1),$$
(10)

Also, \({\text{supp}}[N_{m} (t)] = [0,m]\).

The explicit expression of \(N_{2} (t)\), which is called linear B-spline function, is (de Boor 1978):

$$N_{2} (t) = \left\{ {\begin{array}{*{20}l} {t,} \hfill & {{\kern 1pt} t\; \in \;[0,1];{\kern 1pt} } \hfill \\ {2 - t,} \hfill & {{\kern 1pt} t\; \in \;[1,2];{\kern 1pt} } \hfill \\ {0,} \hfill & {{\kern 1pt} {\text{elsewhere}} .{\kern 1pt} } \hfill \\ \end{array} } \right.$$
(11)

As in Lakestani et al. (2012), suppose that \(N_{j,k} (t): = N_{2} (2^{j} - k), j, k \in {\mathbf{Z}}\). The functions \(N_{j,k} (t)\) are called the linear B-spline scaling functions (LBSF). If we define \(B_{j,k} : = {\text{supp}}\{ N_{j,k} \} = \overline{{\{ t: N_{j,k} (t) \ne 0\} }}\), it is easy to see:

$$B_{j,k} = [2^{ - j} k,2^{ - j} (2 + k)],\quad j,k \in {\mathbf{Z}}.$$
(12)

Also, if the set of indices \(S_{j}\) is defined as:

$$S_{j} : = \{ k: B_{j,k} \cap (0,1) \ne \emptyset \},\quad j \in {\mathbf{Z}},$$
(13)

then, it can be easily seen that \({ \hbox{min} }_{j} \{ S_{j} \} = - 1\) and \({ \hbox{max} }_{j} \{ S_{j} \} = 2^{j} - 1\), \(j \in {\mathbf{Z}}\). Since the support of \(N_{j,k} (t)\) may be out of \([0,1]\), we need these functions to be intrinsically defined on \([0,1]\), so we put:

$$\varphi_{j,k} (t): = N_{j,k} (t)\chi_{[0,1]} (t),\quad j \in {\mathbf{Z}}, k \in S_{j} ,$$
(14)

which are called the LBSFs on \([0,1]\). For a fixed \(j = J\), define the vector \({\varvec{\Phi}}_{J}\) as the following:

$${\varvec{\Phi}}_{J} (t) = [\varphi_{J, - 1} ,\varphi_{J,0} , \ldots \varphi_{{J,2^{J} - 1}} ]^{T} .$$
(15)

It is easy to show that:

$$\varphi_{J,k} \left(\frac{i + 1}{{2^{J} }}\right) = \delta_{k,i},\quad i = - 1,0, \ldots ,2^{j} - 1,$$
(16)

where \(\delta_{k,i}\) is the Kroneker delta. An arbitrary function \(u(t) \in L^{2} [0,1]\) may be approximated in vector form as follows:

$$u(t);\sum\limits_{k = - 1}^{{2^{j} - 1}} c_{k} \varphi_{J,k} (t) = {\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t),$$
(17)

where:

$${\mathbf{C}}^{T} = [c_{ - 1} ,c_{0} , \ldots ,c_{{2^{J} - 1}} ].$$

By using Eq. (16), it is obvious that the coefficients \(c_{k}\) can be computed as:

$$c_{k} = u\left(\frac{k + 1}{{2^{J} }}\right),\quad k = - 1,0, \ldots ,2^{j} - 1.$$
(18)

3 Operational Matrix of Fractional Integration of LBSFs

If we define the q times repeated integration of LBSFs vector \({\varvec{\Phi}}_{J} (t)\) by \(I^{q} {\varvec{\Phi}}_{J} (t)\), then:

$$I^{q} {\varvec{\Phi}}_{J} (t) \cong P^{q} {\varvec{\Phi}}_{J} (t),$$
(19)

where \(q\) is an integer value and \(P^{q}\) is the operational matrix of integration of \({\varvec{\Phi}}_{J} (t)\).

The main objective of this section is generalizing the LBSFs of integration (19) to fractional calculus.

Definition 3

The fractional integration of LBSFs vector, \({\varvec{\Phi}}_{J} (t)\), can be expanded via themselves as follows:

$$I^{\alpha } {\varvec{\Phi}}_{J} (t) \cong {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t),$$
(20)

where \(P^{\alpha }\) is the \((2^{J} + 1) \times (2^{J} + 1)\) LBSF operational matrix of fractional integration of order \(\alpha\) in the Riemann–Liouville sense. \({\mathbf{P}}^{\alpha }\) is derived as the following process.

By using the definition of LBSFs (14), it is obvious that:

$$\varphi_{J,k} (t) = \left\{ {\begin{array}{*{20}l} {(1 - 2t^{J} )(u_{0} (t) - u_{{\frac{1}{{2^{J} }}}} (t)), {\kern 1pt} \quad{\text{if}} \;k = - 1;{\kern 1pt} } \hfill & {} \hfill \\ {(2^{J} t - k)(u_{{\frac{k}{{2^{J} }}}} (t) - u_{{\frac{k + 1}{{2^{J} }}}} (t)) + (2 - 2^{J} t + k)(u_{{\frac{k + 1}{{2^{J} }}}} (t) - u_{{\frac{k + 2}{{2^{J} }}}} (t)),} \hfill & {} \hfill \\ { {\kern 1pt} \quad\quad\quad\quad{\text{if}}\; k = 0,1, \ldots ,2^{J} - 2;{\kern 1pt} } \hfill & {} \hfill \\ {(2^{J} (t - 1) + 1)(u_{{\frac{{2^{J} - 1}}{{2^{J} }}}} (t) - u_{1} (t)), {\kern 1pt}\quad {\text{if}}\; k = 2^{J} - 1.{\kern 1pt} } \hfill & {} \hfill \\ \end{array} } \right.$$
(21)

where \(u_{a} (t)\) is the shifted unit step function. The fractional integration of order \(\alpha\) of \(\varphi_{J,k} (t)\) can be written as:

$$I^{\alpha } \varphi_{J,k} (t) = \frac{1}{\varGamma (\alpha )}\{ t^{\alpha - 1} *\varphi_{J,k} (t)\} ,$$
(22)

where * is the convolution operator of two functions. Laplace transform on (22) yields:

$$L\{ I^{\alpha } \varphi_{J,k} (t)\} = \left\{ {\begin{array}{*{20}l} {\frac{1}{{s^{\alpha + 1} }}\left[1 - \frac{{2^{J} }}{s}(1 - e^{{ - \frac{s}{{2^{J} }}}} )\right],} \hfill & {{\kern 1pt} {\text{if}}\; k = - 1;{\kern 1pt} } \hfill \\ {\frac{{2^{J} }}{{s^{\alpha + 2} }}\left[e^{{ - \frac{k}{{2^{J} }}s}} - 2e^{{ - \frac{k + 1}{{2^{J} }}s}} + e^{{ - \frac{k + 2}{{2^{J} }}s}} \right],} \hfill & {{\kern 1pt} {\text{if}}\; k = 0,1, \ldots ,2^{J} - 2;{\kern 1pt} } \hfill \\ {\frac{{2^{J} }}{{s^{\alpha + 2} }}\left[e^{{ - \frac{{2^{J} - 1}}{{2^{J} }}s}} - e^{ - s} \right] - \frac{{e^{ - s} }}{{s^{\alpha + 1} }},} \hfill & {{\kern 1pt} {\text{if}}\; k = 2^{J} - 1.{\kern 1pt} } \hfill \\ \end{array} } \right.$$
(23)

Now taking the inverse Laplace transform of the above equation, we get:

$$I^{\alpha } \varphi_{J, - 1} (t) = \frac{{t^{\alpha } }}{\varGamma (\alpha + 1)}\left[1 - \frac{{2^{J} t}}{\alpha + 1}\right] + \frac{{2^{J} }}{\varGamma (\alpha + 2)}(t - \frac{1}{{2^{J} }})^{\alpha + 1} u_{{\frac{1}{{2^{J} }}}} (t),$$
(24)
$$^{\alpha } \varphi _{{J,k}} (t) = \frac{{2^{J} }}{{\Gamma (\alpha + 2)}}\left[ {\left(t - \frac{k}{{2^{J} }}\right)^{{\alpha + 1}} u_{{\frac{k}{{2^{J} }}}} (t) - 2\left(t - \frac{{k + 1}}{{2^{J} }}\right)^{{\alpha + 1}} u_{{\frac{{k + 1}}{{2^{J} }}}} (t) + \left(t - \frac{{k + 2}}{{2^{J} }}\right)^{{\alpha + 1}} u_{{\frac{{k + 2}}{{2^{J} }}}} (t)} \right],$$
(25)

for \(k = 0,1, \ldots ,2^{J} - 2\), and:

$$I^{\alpha } \varphi_{{J,2^{J} - 1}} (t) = \frac{{2^{J} }}{\varGamma (\alpha + 2)}\left[(t - \frac{{2^{J} - 1}}{{2^{J} }})^{\alpha + 1} u_{{\frac{{2^{J} - 1}}{{2^{J} }}}} (t) - (t - 1)^{\alpha + 1} u_{1} (t)\right] - (t - 1)^{\alpha } u_{1} (t).$$
(26)

Expanding \(I^{\alpha } \varphi_{J,k} (t)\) via LBSFs, we have:

$$I^{\alpha } \varphi_{J,k} (t) \cong \sum\limits_{q = - 1}^{{2^{J} - 1}} P_{kq}^{\alpha } \varphi_{J,k} (t) = {\mathbf{P}}_{k}^{\alpha } {\varvec{\Phi}}_{J} (t),$$
(27)

where:

$$P_{kq}^{\alpha } = I^{\alpha } \varphi_{J,k} (\frac{q + 1}{{2^{J} }}), q,k = - 1,0,1, \ldots ,2^{J} - 1,$$
(28)

and \({\mathbf{P}}_{k}^{{\alpha^{T} }}\) is a \((2^{J} + 1)\)-vector. Therefore:

$$I^{\alpha } {\varvec{\Phi}}_{J} (t) \cong \left( {\begin{array}{*{20}c} {{\mathbf{P}}_{ - 1}^{\alpha } } \\ {{\mathbf{P}}_{0}^{\alpha } } \\ \vdots \\ {{\mathbf{P}}_{{2^{J} - 1}}^{\alpha } } \\ \end{array} } \right){\varvec{\Phi}}_{J} (t) = {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t).$$
(29)

By using Eqs. (24), (25), (26), and (28), it can be shown that \({\mathbf{P}}^{\alpha }\) is a \((2^{J} + 1) \times (2^{J} + 1)\) matrix as follows:

$${\mathbf{P}}^{\alpha } = \left( {\begin{array}{*{20}c} 0 & {\zeta_{1} } & {\zeta_{2} } & {\zeta_{3} } & \cdots & {\zeta_{{2^{J} }} } \\ 0 & {\eta_{1} } & {\eta_{2} } & {\eta_{3} } & \cdots & {\eta_{{2^{J} }} } \\ {} & {} & {\eta_{1} } & {\eta_{2} } & \cdots & {\eta_{{2^{J} - 1}} } \\ \vdots & {} & \ddots & \ddots & \ddots & \vdots \\ {} & {} & {} & {} & {\eta_{1} } & {\eta_{2} } \\ 0 & {} & \cdots & {} & 0 & {\eta_{1} } \\ {} & {} & {} & {} & {} & {} \\ \end{array} } \right),$$
(30)

where:

$$\zeta_{i} = \frac{1}{{2^{J\alpha } \varGamma (\alpha + 2)}}(i^{\alpha } (i + \alpha + 1) + (i - 1)^{\alpha - 1} ), i = 1,2, \ldots ,2^{J} ,$$
$$\eta_{1} = \frac{1}{{2^{J\alpha } \varGamma (\alpha + 2)}}, \;\eta_{i} = \frac{1}{{2^{J\alpha } \varGamma (\alpha + 2)}}(i^{\alpha + 1} - 2(i - 1)^{\alpha + 1} + (i - 2)^{\alpha + 1} ),\; i = 2, \ldots ,2^{J} .$$

Suppose that the arbitrary function \(u(t) \in L^{2} [0,1]\) is given. From Eq. (17), the linear B-spline scaling approximation of \(u(t)\) is given by \(u(t) \cong {\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t)\). Thus, the fractional-order integration of the function \(u(t)\) can be approximated as the following:

$$I^{\alpha } u(t) \cong {\mathbf{C}}^{T} I^{\alpha } {\varvec{\Phi}}_{J} (t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t).$$

The function \(u(t) = t\) was selected to verify the correctness of matrix \({\mathbf{P}}^{\alpha }\). The \(\alpha\)-order integration of the function \(f(t) = t\) is easily obtained as Eq. (3). When \(\alpha = \frac{1}{2}\) and \(J = 4,6,8,10\), the comparison results for the errors of fractional integration are shown in Fig. 1.

Fig. 1
figure 1

The comparison results for the errors of fractional integration for \(D^{{\frac{1}{2}}} t\)

4 Error Bound

In this section, an error bound for the linear B-spline scaling functions approximation will be found. To this end, let us define \(N: = 2^{J} + 1\) for a fixed \(J \in {\mathbf{N}}\) and according to (17) suppose that \(u_{N} (t)\) is the approximation of \(u(t)\).

Theorem 1

If we assume that \(u(t) \in C^{2} [0,1]\) is approximated by the linear B-spline scaling functions as:

$$u(t) \cong \sum\limits_{k = - 1}^{{2^{J} - 1}} c_{k} \varphi_{J,k} (t) = u_{N} (t),$$
(31)

then:

$$\left\| {u(t) - u_{N} (t)} \right\|_{2} \le \frac{1}{{2(2^{J} )^{2} }}M + O((\frac{1}{{2^{J} }})^{3} ), t \in [0,1],$$
(32)

where \(|u^{\prime \prime} (t)| \le M\), for \(t = \frac{k + 1}{{2^{J} }}, k = - 1,0,2^{j} - 2\).

Proof

For \(t = \frac{k + 1}{{2^{J} }}, k = - 1,0,2^{j} - 1\), the relation (32) is obviously obtained. If \(\frac{k + 1}{{2^{J} }} < t < \frac{k + 2}{{2^{J} }}\), by using the definition of linear B-spline scaling function (14) and (31), we have:

$$\begin{aligned} u_{N} (t) &= u\left( {\frac{{k + 1}}{{2^{J} }}} \right)\varphi _{{J,k}} (t) + u\left( {\frac{{k + 2}}{{2^{J} }}} \right)\varphi _{{J,k + 1}} (t)\\ &= u\left( {\frac{{k + 1}}{{2^{J} }}} \right)(2 - (2^{J} t - k)) + u\left( {\frac{{k + 2}}{{2^{J} }}} \right)(2^{j} t - k - 1)\\ &= u\left( {\frac{{k + 1}}{{2^{J} }}} \right) + t\left( {\frac{{u(\frac{{k + 2}}{{2^{J} }}{\text{)}} - u{\text{(}}\frac{{k + 1}}{{2^{J} }})}}{{\frac{1}{{2^{J} }}}}} \right) - \frac{{k + 1}}{{2^{J} }}\left( {\frac{{u(\frac{{k + 2}}{{2^{J} }}) - u(\frac{{k + 1}}{{2^{J} }})}}{{\frac{1}{{2^{J} }}}}} \right)\\ &= u\left( {\frac{{k + 1}}{{2^{J} }}} \right) + \left( {t - \frac{{k + 1}}{{2^{J} }}} \right)\left( {\frac{{u(\frac{{k + 2}}{{2^{J} }}) - u(\frac{{k + 1}}{{2^{J} }})}}{{\frac{1}{{2^{J} }}}}} \right). \end{aligned}$$
(33)

As \(J \to \infty\), from (33), we get:

$$u_{N} (t) \cong u\left(\frac{k + 1}{{2^{J} }}\right) + \left(t - \frac{k + 1}{{2^{J} }}\right)u^{'} \left(\frac{k + 1}{{2^{J} }}\right).$$
(34)

Considering the Taylor series of function \(u(t)\) at point \(t = \frac{k + 1}{{2^{J} }}\), we have:

$$u(t) = \sum\limits_{j = 0}^{\infty } \frac{{(t - \frac{k + 1}{{2^{J} }})^{j} }}{j!}u^{(j)} \left(\frac{k + 1}{{2^{J} }}\right).$$
(35)

By using Eqs. (34) and (35), we get:

$$\begin{aligned} &|u(t) - u_{N} (t)| \cong |\sum\limits_{j = 2}^{\infty } \frac{{(t - \frac{k + 1}{{2^{J} }})^{j} }}{j!}u^{(j)} \left(\frac{k + 1}{{2^{J} }}\right)| \hfill \\ &\le \frac{1}{2}(t - \frac{k + 1}{{2^{J} }})^{2} |u^{''} \left(\frac{k + 1}{{2^{J} }}\right)| + O\left(\left(t - \frac{k + 1}{{2^{J} }}\right)^{3} \right) \hfill \\ &\le \frac{1}{{2(2^{J} )^{2} }}M + O\left(\left(\frac{1}{{2^{J} }}\right)^{3} \right), \hfill \\ \end{aligned}$$
(36)

where the last inequality is derived from this fact that \(t - \frac{k + 1}{{2^{J} }} < \frac{1}{{2^{J} }}\) and the assumption \(|u^{''} (\frac{k + 1}{{2^{J} }})| \le M\). Finally, by using the definition of 2-norm and Eq. (36), we have:

$$\begin{aligned} \left\| {u(t) - u_{N} (t)} \right\|_{2}^{2} = \int_{0}^{1} |u(t) - u_{N} (t)|^{2} {\text{d}}t \hfill \\ = \sum\limits_{k = - 1}^{{2^{J} - 2}} \int_{{\frac{k + 1}{{2^{J} }}}}^{{\frac{k + 2}{{2^{J} }}}} |u(t) - u_{N} (t)|^{2} {\text{d}}t \hfill \\ \le \sum\limits_{k = - 1}^{{2^{J} - 2}} \int_{{\frac{k + 1}{{2^{J} }}}}^{{\frac{k + 2}{{2^{J} }}}} \left(\frac{1}{{2(2^{J} )^{2} }}M + O\left((\frac{1}{{2^{J} }})^{3} \right)\right)^{2} {\text{d}}t \hfill \\ = \left(\frac{1}{{2(2^{J} )^{2} }}M + O\left((\frac{1}{{2^{J} }})^{3} \right)\right)^{2} . \hfill \\ \end{aligned}$$
(37)

So, Eq. (37) yields:

$$\left\| {u(t) - u_{N} (t)} \right\|_{2} \le \frac{1}{{2(2^{J} )^{2} }}M + O((\frac{1}{{2^{J} }})^{3} ),$$
(38)

and this completes the proof of the theorem.

Also, the above theorem shows that when \(J\) increases, the absolute error tends to zero. This shows the convergency of the approximation introduced in Eq. (31) in \(L_{2}\)-norm.

5 Numerical Illustrations

In this section, the LBSFs and the operational matrices of fractional integration are used to solve the several kinds of fractional differential equations. This procedure is called the linear B-spline scaling function method (LBSFM).

Example 1

Consider the following linear fractional differential equation which has been considered before by Kumar and Agrawal (2006), Diethelm et al. (2002) and Rehmana and Khan (2011):

$$D^{\alpha } u(t) + u(t) = 0,\quad 0 < \alpha \le 2,$$
(39)

such that: \(u(0) = 1,\quad u^{'} (0) = 0\). The exact solution of Eq. (39) is given by:

$$u(t) = E_{\alpha } ( - t^{\alpha } ),$$
(40)

where \(E_{\alpha } (w) = \sum\nolimits_{k = 0}^{\infty } \frac{{w^{k} }}{\varGamma (\alpha k + 1)}\) is the Mittag–Leffler function of ordera \(\alpha\). The exact solutions of the problem for \(\alpha = 1\) and \(\alpha = 2\) are \(u(t) = e^{ - t}\) and \(y = { \cos }(t)\), respectively. Let:

$$D^{\alpha } (t) \cong {\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t),$$
(41)

by using relation (7) in the above equation, we have:

$$u(t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t) + 1.$$
(42)

Employing Eqs. (41) and (42) in Eq. (39), we get:

$${\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t) + {\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t) \cong - {\mathbf{1}}^{T} {\varvec{\Phi}}_{J} (t).$$
(43)

where \(- {\mathbf{1}}^{T}\) is a \((2^{J} + 1)\)-vector as: \(- {\mathbf{1}} = [ - 1, \ldots , - 1]^{T}\). By collocating Eq. (43) in points \(t_{i} = \frac{i + 1}{{2^{J} }}\) for \(i = - 1,0, \ldots ,2^{J} - 1\) and using the property (16), we get the following system of linear equations:

$${\mathbf{C}}^{T} + {\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } \cong - {\mathbf{1}}^{T} .$$
(44)

Vector \({\mathbf{C}}\) can be found by solving the system (44), thus the approximate solution of the main problem can be obtained by (42). Figure 2 shows the numerical results for \(J = 8\) and various \(1 \le \alpha \le 2\). The comparisons show that: when \(\alpha \to 1\) and \(\alpha \to 2\), then the approximate solutions tend to \(u(t) = e^{ - t}\) and \(u(t) = { \cos }x\), which are the exact solutions of the equation in the cases \(\alpha = 1\) and \(\alpha = 2\), respectively. A comparison between the absolute errors of the LBSFM and the Legendre wavelet method (LWM) (Rehmana and Khan 2011), for some points in \([0,1]\) is given in Fig. 3.

Fig. 2
figure 2

The numerical results for \(J = 8\) and various \(1 \le \alpha \le 2\) (Example 1)

Fig. 3
figure 3

The comparison between the absolute errors of the LBSFM and the (LWM) (Rehmana and Khan 2011) (Example 1)

Example 2

Consider the following composite multi-term fractional oscillation equation:

$$aD^{\alpha } u(t) + bD^{\beta } u(t) + cu(t) = g(t),\; t > 0, \;1 < \alpha \le 2,\; 0 < \alpha \le 2,$$
(45)

with \(u(0) = u_{0} , u^{'} (0) = u_{1}\), where \(a \ne 0\) and \(b, c \in {\mathbf{R}}\). Let:

$$D^{\alpha } u(t) \cong {\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t),$$
(46)

thus:

$$D^{\beta } u(t) \cong I^{\alpha - \beta } D^{\alpha } u(t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{\alpha - \beta } {\varvec{\Phi}}_{J} (t),$$
(47)

and:

$$u(t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t) + u_{1} t + u_{0} .$$
(48)

Substituting Eqs. (46)–(48) into Eq. (45), then collocating it in points \(t_{i} = \frac{i + 1}{{2^{J} }}\) for \(i = - 1,0, \ldots ,2^{J} - 1\) and using the property (16), we have the following system of linear equations:

$$a{\mathbf{C}}^{T} + b{\mathbf{C}}^{T} {\mathbf{P}}^{\alpha - \beta } + c{\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } = {\mathbf{H}}^{T} ,$$
(49)

where \({\mathbf{H}}\) is the coefficient vector of the function \(h(t) = g(t) - c(u_{1} t + u_{0} )\). The system of equations given in Eq. (49) is solved for the vector \({\mathbf{C}}\) and the output response \(u(t)\) is calculated by (48). For \(a = b = c = 1, \alpha = 2, \beta = 0.5, u_{0} = u_{1} = 0\), \(g(t) = 8\) and \(t \in [0,1]\), this problem has been solved in Arikoglu and Ozkol (2007), Rehmana and Khan (2011), Li and Sun (2011), Momani and Odibat (2007), Yi and Huang (2014), and Li and Zhao (2010). The comparisons between our results and the results given in Arikoglu and Ozkol (2007), Rehmana and Khan (2011), Li and Sun (2011), Momani and Odibat (2007), Yi and Huang (2014), and Li and Zhao (2010), at different node points, are shown in Tables 1 and 2, respectively. Also, the comparison of absolute errors for \(J = 4,6,8\) and \(10\) is shown in Fig. 4. Here, the absolute errors are obtained by the results of high-order methods mentioned in Bhrawy et al. (2012). Clearly, the results show the solutions obtained by LBSFM are in good agreement with other numerical methods.

Table 1 The approximate solution \(u(t)\) at different node points in comparison with some references (Example 2)
Table 2 The approximate solution \(u(t)\) at different node points for \(\alpha = 2, \beta = 0.5\) in comparison with some references (Example 2)
Fig. 4
figure 4

The comparison of absolute errors for \(J = 4,6,8\) and \(10\) (Example 2)

Example 3

Consider the following Riccati differential equation which is a nonlinear case (Abbasbandy 2007; Genga et al. 2009; Li 2010):

$$D^{\alpha } u(t) = 2u(t) - u^{2} (t) + 1, 0 \le t \le 1, 0 \le \alpha \le 1,$$
(50)

with \(u(0) = 0\). The exact solution of this problem is:

$$u(t) = 1 + \sqrt 2 tanh\left(\sqrt 2 t + \frac{1}{2}ln\left(\frac{\sqrt 2 - 1}{\sqrt 2 + 1}\right)\right).$$
(51)

To solve the problem by using the present method, let:

$$D^{\alpha } u(t) \cong {\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t),$$
(52)

so:

$$u(t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t).$$
(53)

Substituting Eqs. (52) and (53) in Eq. (50), we have:

$${\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t) \cong 2{\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t) - ({\mathbf{C}}^{T} {\mathbf{P}}^{\alpha } {\varvec{\Phi}}_{J} (t))^{2} + 1.$$
(54)

Now, if the Eq. (54) is collocated at \(t_{i} = \frac{i + 1}{{2^{J} }}\) for \(i = - 1,0, \ldots ,2^{J} - 1\), we have a system of nonlinear equations which can be solved for the unknown vector \(C\), using Newton’s iterative method. The numerical results for \(u(t)\) with \(J = 6\), and \(\alpha = 0.6, 0.7, 0.8, 0.9, 1\) are presented in Fig. 5. This figure shows that as \(\alpha\) approaches to 1, the corresponding solutions of the equation approach to the solutions of integer-order differential equation. Also, the comparison of absolute errors for \(J = 2,3,4,5\) and \(\alpha = 1\) is shown in Fig. 6.

Fig. 5
figure 5

The numerical results for \(u(t)\) with \(J = 6\), and some \(0.6 \le \alpha \le 1\) (Example 3)

Fig. 6
figure 6

The comparison of absolute error for \(J = 2,3,4,5\) and \(\alpha = 1\) (Example 4)

Example 4

Following Li and Zhao (2010), consider the following nonlinear multi-order fractional differential equation:

$$aD^{2.2} u(t) + bD^{{\alpha_{2} }} u(t) + cD^{{\alpha_{1} }} u(t) + e[u(t)]^{3} = f(t), 0 < \alpha_{1}\,\le\,1, 1 < \alpha_{2}\,\le\,2,$$
(55)

and:

$$f(t) = \frac{2a}{\varGamma (1.8)}t^{0.8} + \frac{2b}{{\varGamma (4 - \alpha_{2} )}}t^{{3 - \alpha_{2} }} + \frac{2c}{{\varGamma (4 - \alpha_{1} )}}t^{{3 - \alpha_{1} }} + e\left[\frac{{t^{3} }}{3}\right]^{3} ,$$
(56)

subject to \(u(0) = u^{\prime} (0) = u^{\prime\prime} (0) = 0\). The exact solution of this problem is \(u(t) = \frac{1}{3}t^{3}\). Suppose that:

$$D^{2.2} u(t) \cong {\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t).$$
(57)

By using the linear B-spline scaling function operational matrix of fractional integration and the initial conditions, we get:

$$D^{{\alpha_{1} }} u(t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{{2.2 - \alpha_{1} }} {\varvec{\Phi}}_{J} (t),$$
(58)
$$D^{{\alpha_{2} }} u(t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{{2.2 - \alpha_{2} }} {\varvec{\Phi}}_{J} (t),$$
(59)

and:

$$u(t) \cong {\mathbf{C}}^{T} {\mathbf{P}}^{2.2} {\varvec{\Phi}}_{J} (t).$$
(60)

Substituting Eqs. (57)–(60) into Eq. (55), we have:

$${\mathbf{C}}^{T} {\varvec{\Phi}}_{J} (t) + a{\mathbf{C}}^{T} {\mathbf{P}}^{{2.2 - \alpha_{1} }} {\varvec{\Phi}}_{J} (t) + b{\mathbf{C}}^{T} {\mathbf{P}}^{{2.2 - \alpha_{2} }} {\varvec{\Phi}}_{J} (t) + e[{\mathbf{C}}^{T} {\mathbf{P}}^{2.2} {\varvec{\Phi}}_{J} (t)]^{3} \cong f(t).$$
(61)

Now, if the Eq. (61) is collocated at \(t_{i} = \frac{i + 1}{{2^{J} }}\) for \(i = - 1,0, \ldots ,2^{J} - 1\), we have a system of nonlinear equations which can be solved for the unknown vector \(C\), using Newtons iterative method. For \(a = b = c = e = 1\), \(\alpha_{1} = 0.75\) and \(\alpha_{2} = 1.25\), the absolute errors with a comparison to the method in Li and Zhao (2010) are given in Table 3. From Table 3, we can see clearly that the numerical solutions are much closer to the exact solution when \(J\) increases. Compared with the method in Li and Zhao (2010), our method is more accurate.

Table 3 The approximate solution \(u(t)\) at different node points in comparison with Ref. (Li and Zhao 2010) (Example 6)

6 Conclusion

In the present work, we construct the fractional-order linear B-spline scaling functions operational matrices of integration and use them to solve fractional linear and nonlinear differential equations numerically. Also, when using the linear B-spline scaling functions approximation, an error bound is derived and used to show the convergency of the mentioned approximation. The obtained results are compared with exact solutions and with the solutions obtained by some other numerical methods mentioned in Examples 1–4. Our method gives almost the same results as these methods but is a little more accurate than them. The authors are very grateful to the editors and the referees for carefully reading the paper and for their comments and suggestions which have improved the paper.