• Research
• Open Access

# A shifted Legendre spectral method for fractional-order multi-point boundary value problems

https://doi.org/10.1186/1687-1847-2012-8

• Accepted: 9 February 2012
• Published:

## Abstract

In this article, a shifted Legendre tau method is introduced to get a direct solution technique for solving multi-order fractional differential equations (FDEs) with constant coefficients subject to multi-point boundary conditions. The fractional derivative is described in the Caputo sense. Also, this article reports a systematic quadrature tau method for numerically solving multi-point boundary value problems of fractional-order with variable coefficients. Here the approximation is based on shifted Legendre polynomials and the quadrature rule is treated on shifted Legendre Gauss-Lobatto points. We also present a Gauss-Lobatto shifted Legendre collocation method for solving nonlinear multi-order FDEs with multi-point boundary conditions. The main characteristic behind this approach is that it reduces such problem to those of solving a system of algebraic equations. Thus we can find directly the spectral solution of the proposed problem. Through several numerical examples, we evaluate the accuracy and performance of the proposed algorithms.

## Keywords

• multi-term FDEs
• multi-point boundary conditions
• tau method
• collocation method
• direct method
• shifted Legendre polynomials

## 1 Introduction

Fractional calculus, as generalization of integer order integration and differentiation to its non-integer (fractional) order counterpart, has proved to be a valuable tool in the modeling of many phenomena in the fields of physics, chemistry, engineering, aerodynamics, electrodynamics of complex medium, polymer rheology, etc. [19]. This mathematical phenomenon allows to describe a real object more accurately than the classical integer methods. The most important advantage of using FDEs in these and other applications is their non-local property. It is well known that the integer order differential operator is a local operator, but the fractional-order differential operator is non-local. This means that the next state of a system depends not only upon its current state but also upon all of its historical states. This makes studying fractional order systems an active area of research.

Spectral methods are a widely used tool in the solution of differential equations, function approximation, and variational problems (see, e.g., [10, 11] and the references therein). They involve representing the solution to a problem in terms of truncated series of smooth global functions. They give very accurate approximations for a smooth solution with relatively few degrees of freedom. This accuracy comes about because the spectral coefficients, a n , typically tend to zero faster than any algebraic power of their index n. According to different test functions in a variational formulation, there are three most common spectral schemes, namely, the collocation, Galerkin and tau methods. Spectral methods have been applied successfully to numerical simulations of many problems in science and engineering, see [1215].

Spectral tau method is similar to Galerkin methods in the way that the differential equation is enforced. However, none of the test functions need to satisfy the boundary conditions. Hence, a supplementary set of equations are needed to apply the boundary conditions (see, e.g., [10] and the references therein). In the collocation methods [16, 17], there are basically two steps to obtain a numerical approximation to a solution of differential equation. First, an appropriate finite or discrete representation of the solution must be chosen. This may be done by polynomials interpolation of the solution based on some suitable nodes such as the well known Gauss or Gauss-Lobatto nodes. The second step is to obtain a system of algebraic equations from discretization of the original equation.

Doha et al. [18] proposed an efficient spectral tau and collocation methods based on Chebyshev polynomials for solving multi-term linear and nonlinear FDEs subject to initial conditions. Furthermore, Bhrawy et al. [19] proved a new formula expressing explicitly any fractional-order derivatives of shifted Legendre polynomials of any degree in terms of shifted Legendre polynomials themselves, and the multi-order fractional differential equation with variable coefficients is treated using the shifted Legendre Gauss-Lobatto quadrature. Saa-datmandi and Dehghan [20] and Doha et al. [21] derived the shifted Legendre and shifted Chebyshev operational matrices of fractional derivatives and used together spectral methods for solving FDEs with initial and boundary conditions respectively. In [18, 22, 23], the authors have presented spectral tau method for numerical solution of some FDEs. Recently, Esmaeili and Shamsi [24] introduced a direct solution technique for obtaining the spectral solution of a special family of fractional initial value problems using a pseudo-spectral method, and Pedas and Tamme [25] developed the spline collocation method for solving FDEs subject to initial conditions.

Multi-point boundary value problems appear in wave propagation and in elastic stability. For examples, the vibrations of a guy wire of a uniform cross-section, composed of m sections of different densities can be molded as a multipoint boundary value problem. The multi-point boundary conditions can be understood in the sense that the controllers at the end points dissipate or add energy according to censors located at intermediate points. Rehman and Khan [26] introduced a numerical scheme, based on the Haar wavelet operational matrices of integration for solving linear multi-point boundary value problems for fractional differential equations with constant and variable coefficients. Moreover, Rehman and Khan [27] derived a Legendre wavelet operational matrix of fractional order integration and applied it to solve FDEs with initial and boundary value conditions. In fact, the numerical solutions of multi-point boundary value problems for FDEs have received much less attention. In this study, we focus on providing a numerical scheme, based on spectral methods, to solve multi-point boundary conditions for linear and nonlinear FDEs.

In this article, we are concerned with the direct solution technique for solving the multi-term FDEs subject to multi-point boundary conditions, using the shifted Legendre tau (SLT) approximation. This technique requires a formula for fractional-order derivatives of shifted Legendre polynomials of any degree in terms of shifted Legendre polynomials themselves which is proved in Bhrawy et al. [19]. Another aim of this article is to propose a suitable way to approximate the multi-term FDEs with variable coefficients subject to multi-point boundary conditions, using a quadrature shifted Legendre tau (Q-SLT) approximation, this approach extended the tau method for variable coefficients FDEs by approximating the weighted inner products in the tau method by using the shifted Legendre-Gauss-Lobatto quadrature.

Moreover the treatment of the nonlinear multi-order fractional multi-point value problems; with leading fractional-differential operator of order ν (m - 1 < νm), on the interval [0, t] is described, by shifted Legendre collocation (SLC) method to find the solution u N (x). More precisely, such a technique is performed in two successive steps, the first one to collocate the nonlinear FDE specified at (N - m + 1) points; we use the (N - m + 1) nodes of the shifted Legendre-Gauss-Lobatto interpolation on the interval [0, t], these equations together with m equations comes form m multi-point boundary conditions generate (N + 1) nonlinear algebraic equations, in general this step is cumbersome, and the second one to solve these nonlinear algebraic equations using Newton's iterative method. The structure of this technique is similar to that of the two-step procedure proposed in [18, 20] for the initial boundary value problem and in [21] for the two-point boundary value problem. To the best of the our knowledge, such approaches have not been employed for solving fractional differential equations with multi-point boundary conditions. Finally, the accuracy of the proposed algorithms are demonstrated by test problems.

The remainder of the article is organized as follows. In the following section, we introduce some notations and summarize a few mathematical facts used in the remainder of the article. In Section 3, we consider the SLT method for the multi-term FDEs subject to multi-point boundary conditions, and in Section 4, we construct an algorithm for solving linear multi-order FDEs with variable coefficients subject to multi-point boundary conditions by using the Q-SLT method. In Section 5, we study the general nonlinear FDEs subject to multi-point boundary conditions by SLC method. In Section 6, we present some numerical results. Finally, some concluding remarks are given in Section 7.

## 2 Preliminaries and notations

### 2.1 The fractional derivative in the Caputo sense

In this section, we first review the basic definitions and properties of fractional integral and derivative for the purpose of acquainting with sufficient fractional calculus theory. Many definitions and studies of fractional calculus have been proposed in the past two centuries (see, e.g., [8]). The two most commonly used definitions are the Riemann-Liouville operator and the Caputo operator. We give some definitions and properties of the fractional calculus.

Definition 2.1 The Riemann-Liouville fractional integral operator of order μ (μ ≥ 0) is defined as
$\begin{array}{c}{J}^{\mu }f\left(x\right)=\frac{1}{\mathrm{\Gamma }\left(\mu \right)}\underset{0}{\overset{x}{\int }}{\left(x-t\right)}^{\mu -1}f\left(t\right)dx,\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\mu >0,\phantom{\rule{1em}{0ex}}x>0,\\ {J}^{0}f\left(x\right)=f\left(x\right).\end{array}$
(1)
Definition 2.2 The Caputo fractional derivatives of order μ is defined as
$\begin{array}{ll}\hfill {D}^{\mu }f\left(x\right)& ={J}^{m-\mu }{D}^{m}f\left(x\right)\phantom{\rule{2em}{0ex}}\\ =\frac{1}{\mathrm{\Gamma }\left(m-\mu \right)}\underset{0}{\overset{x}{\int }}{\left(x-t\right)}^{m-\mu -1}\frac{{d}^{m}}{d{t}^{m}}f\left(t\right)dt,\phantom{\rule{1em}{0ex}}m-1<\mu \le m,\phantom{\rule{2.77695pt}{0ex}}\phantom{\rule{2.77695pt}{0ex}}x>0,\phantom{\rule{2em}{0ex}}\end{array}$
(2)

where D m is the classical differential operator of order m.

For the Caputo derivative we have
${D}^{\mu }{x}^{\beta }=\left\{\begin{array}{cc}0,\hfill & \text{for}\phantom{\rule{2.77695pt}{0ex}}\beta \in {N}_{0}\phantom{\rule{2.77695pt}{0ex}}\text{and}\phantom{\rule{2.77695pt}{0ex}}\beta <⌈\mu ⌉,\hfill \\ \frac{\mathrm{\Gamma }\left(\beta +1\right)}{\mathrm{\Gamma }\left(\beta +1-\mu \right)}{x}^{\beta -\mu },\hfill & \text{for}\phantom{\rule{2.77695pt}{0ex}}\beta \in {N}_{0}\phantom{\rule{2.77695pt}{0ex}}\text{and}\phantom{\rule{2.77695pt}{0ex}}\beta \ge ⌈\mu ⌉\phantom{\rule{2.77695pt}{0ex}}\text{or}\phantom{\rule{2.77695pt}{0ex}}\beta \notin N\phantom{\rule{2.77695pt}{0ex}}\text{and}\phantom{\rule{2.77695pt}{0ex}}\beta >⌊\mu ⌋.\hfill \end{array}\right\$
(3)

We use the ceiling function μ to denote the smallest integer greater than or equal to μ, and the floor function μ to denote the largest integer less than or equal to μ. Also N = {1,2,...} and N0 = {0,1,2,...}. Recall that for μ N, the Caputo differential operator coincides with the usual differential operator of an integer order.

### 2.2 Properties of shifted Legendre polynomials

Let L i (x) be the standard Legendre polynomial of degree i, then we have that
${L}_{i}\left(-x\right)={\left(-1\right)}^{i}{L}_{i}\left(x\right),\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{i}\left(-1\right)={\left(-1\right)}^{i},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{L}_{i}\left(1\right)=1.$
(4)
Let w(x) = 1, then we define the weighted space ${L}_{w}^{2}\left(-1,1\right)\equiv {L}^{2}\left(-1,1\right)$ as usual, equipped with the following inner product and norm
$\left(u,v\right)=\underset{-1}{\overset{1}{\int }}u\left(x\right)v\left(x\right)w\left(x\right)dx,\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}∥u∥={\left(u,u\right)}^{1/2}.$
The set of Legendre polynomials forms a complete L2(-1, 1)-orthogonal system, and
${∥{L}_{i}\left(x\right)∥}^{2}={h}_{i}=\frac{2}{2i+1}.$
(5)
If we define the shifted Legendre polynomial of degree i by ${L}_{t,i}\left(x\right)={L}_{i}\left(\frac{2x}{t}-1\right),\phantom{\rule{2.77695pt}{0ex}}t>0$, then the analytic form of the shifted Legendre polynomials Lt,i(x) of degree i is given by
${L}_{t,i}\left(x\right)=\sum _{k=0}^{i}{\left(-1\right)}^{i+k}\frac{\left(i+k\right)!{x}^{k}}{\left(i-k\right)!{\left(k!\right)}^{2}{t}^{k}}.$
(6)
Next, let w t (x) = w(x) = 1, then we define the weighted space ${L}_{{w}_{t}}^{2}\left[0,t\right]$ in the usual way, with the following inner product and norm
${\left(u,v\right)}_{{w}_{t}}=\underset{0}{\overset{t}{\int }}u\left(x\right)v\left(x\right){w}_{t}\left(x\right)dx,\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{∥u∥}_{{w}_{t}}={\left(u,u\right)}_{{w}_{t}}^{1/2}.$
(7)
The set of shifted Legendre polynomials forms a complete ${L}_{{w}_{t}}^{2}\left[0,t\right]$-orthogonal system. According to (5), we have
${∥{L}_{t,i}\left(x\right)∥}_{{w}_{t}}^{2}=\frac{t}{2}{h}_{i}={h}_{t,i}.$
(8)
The shifted Legendre expansion of a function $u\left(x\right)\in {L}_{{w}_{t}}^{2}\left[0,t\right]$ is
$u\left(x\right)=\sum _{j=0}^{\infty }{a}_{j}{L}_{t,j}\left(x\right),$
where the coefficients a j are given by
${a}_{j}=\frac{1}{{h}_{t,j}}\underset{0}{\overset{t}{\int }}u\left(x\right){L}_{t,j}\left(x\right)dx,\phantom{\rule{1em}{0ex}}j=0,1,2,\dots .$
(9)
In practice, only the first (N + 1)-terms shifted Legendre polynomials are considered. Hence we can write
${u}_{N}\left(x\right)\simeq \sum _{j=0}^{N}{a}_{j}{L}_{t,j}\left(x\right).$
(10)
Lemma 2.1 Let Lt,i(x) be a shifted Legendre polynomials then
${D}^{\mu }{L}_{t,i}\left(x\right)=0,\phantom{\rule{1em}{0ex}}i=0,1,\dots ,⌈\mu ⌉-1,\phantom{\rule{1em}{0ex}}\mu >0.$
(11)
where
${D}^{\mu }f\left(x\right)=\frac{1}{\mathrm{\Gamma }\left(⌈\mu ⌉-\mu \right)}\underset{0}{\overset{x}{\int }}{\left(x-t\right)}^{⌈\mu ⌉-\mu -1}{f}^{\left(⌈\mu ⌉\right)}\left(t\right)dt,\phantom{\rule{1em}{0ex}}\phantom{\rule{2.77695pt}{0ex}}⌈\mu ⌉-1<\mu \le ⌈\mu ⌉,$
(12)

is the usual Caputo fractional derivative of order μ of the function f(x) and μ denote the smallest integer greater than or equal to μ.

Proof. This lemma can be easily proved by using (6).

Next, the fractional derivative of order μ in the Caputo sense for the shifted Legendre polynomials expanded in terms of shifted Legendre polynomials can be represented formally in the following theorem.

Theorem 2.2 The fractional derivative of order μ in the Caputo sense for the shifted Legendre polynomials is given by
${D}^{\mu }{L}_{t,i}\left(x\right)=\sum _{l=0}^{\infty }{\Pi }_{\mu }\left(i,l\right){L}_{t,l}\left(x\right),\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}i=⌈\mu ⌉,⌈\mu ⌉+1,\dots ,$
(13)
where
${\Pi }_{\mu }\left(i,l\right)=\sum _{k=⌈\mu ⌉}^{i}\frac{{\left(-1\right)}^{i+k}\left(2l+1\right)\left(i+k\right)!{\left(k-l-\mu +1\right)}_{l}}{{t}^{\mu }\left(i-k\right)!k!\mathrm{\Gamma }\left(k-\mu +1\right){\left(k-\mu +1\right)}_{l+1}}.$
(14)

(For the proof, see, [19].)

## 3 A shifted Legendre tau method

Prompted by the application of multi-point boundary value problems to applied mathematics and physics, these problems have provoked a great deal of attention by many authors (see, for instance, [2834] and references therein). In pursuit of this, we use the shifted Legendre tau method to solve numerically the following FDE:
${D}^{\nu }u\left(x\right)+\sum _{i=1}^{r-1}{\gamma }_{i}{D}^{{\beta }_{i}}u\left(x\right)+{\gamma }_{r}u\left(x\right)=g\left(x\right),\phantom{\rule{1em}{0ex}}\text{in}\phantom{\rule{2.77695pt}{0ex}}x\in I=\left[0,t\right],$
(15)
subject to the multi-point boundary conditions
(16)

where 0 < β1 < β2 < < βr-1< ν, m - 1 < νm are constants. Moreover, D ν u(x) = u(ν)(x) denotes the Caputo fractional derivative of order ν for u(x), γ i , i = 1, 2,..., r are constant coefficients, s0,..., sm-1are given constants and g(x) is a given source function.

The existence and uniqueness of solutions of FDEs have been studied by the authors of [3336].

Let us first introduce some basic notation that will be used in the sequel. We set
${S}_{N}\left[0,t\right]=s\text{pan}\left\{{L}_{t,0}\left(x\right),{L}_{t,1}\left(x\right),\dots ,{L}_{t,N}\left(x\right)\right\},$
(17)
then the shifted Legendre-tau approximation to (15) subject to (16) is to find u N S N [0,t] such that
$\begin{array}{ll}\hfill {\left({D}^{\nu }{u}_{N},{L}_{t,k}\left(x\right)\right)}_{{w}_{t}}& +\sum _{i=1}^{r-1}{\gamma }_{i}{\left({D}^{{\beta }_{i}}{u}_{N},{L}_{t,k}\left(x\right)\right)}_{{w}_{t}}+{\gamma }_{r}{\left({u}_{N},{L}_{t,k}\left(x\right)\right)}_{{w}_{t}}\phantom{\rule{2em}{0ex}}\\ ={\left(g,{L}_{t,k}\left(x\right)\right)}_{{w}_{t,}N},\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,\phantom{\rule{2em}{0ex}}\end{array}$
(18)
and
(19)
Here, the main idea is that we employ a truncated series of shifted Legendre polynomials to approximate the unknown function, and the fractional-differential operator of this truncated series is expanded by shifted Legendre polynomials themselves (see, Theorem 2.2), and then the coefficients of this series are taken to be equal to the coefficients of the right-hand side expansion. Let us denote
$\begin{array}{ll}\hfill {u}_{N}\left(x\right)& =\sum _{j=0}^{N}{a}_{j}{L}_{t,j}\left(x\right),\phantom{\rule{1em}{0ex}}a={\left({a}_{0},{a}_{1},\dots ,{a}_{N}\right)}^{T},\phantom{\rule{2em}{0ex}}\\ \hfill {g}_{k}& ={\left(g,{L}_{t,k}\right)}_{{w}_{t}},\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,\phantom{\rule{2em}{0ex}}\\ \hfill g& ={\left({g}_{0},{g}_{1},\dots ,{g}_{N-m},{s}_{0},{s}_{1},\dots ,{s}_{m-1}\right)}^{T},\phantom{\rule{2em}{0ex}}\end{array}$
then (18), (19) can be written as
(20)
(21)
We define the following square matrices
$\begin{array}{c}A={\left({a}_{kj}\right)}_{0\le k,j\le N},\phantom{\rule{1em}{0ex}}{B}^{i}={\left({b}_{kj}^{i}\right)}_{0
Therefore (20) and (21), are equivalent to the matrix equation
$\left(A+\sum _{i=1}^{r-1}{\gamma }_{i}{B}^{i}+{\gamma }_{r}C+D\right)\phantom{\rule{2.77695pt}{0ex}}\text{a}=\text{g}\text{.}$
(22)

where the nonzero elements of matrices A, B i , i = 1, 2,..., r - 1, C, and D are given explicitly in the following theorem.

Theorem 3.1 If we denote ${a}_{kj}={\left({D}^{\nu }{L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t}},\phantom{\rule{2.77695pt}{0ex}}\phantom{\rule{2.77695pt}{0ex}}{b}_{kj}^{i}={\left({D}^{{\beta }_{i}}{L}_{t,j}\left(x\right),{L}_{t,k}\left(k\right)\right)}_{{w}_{t}},\phantom{\rule{2.77695pt}{0ex}}\phantom{\rule{2.77695pt}{0ex}}{c}_{kj}={\left({L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t}}$, for 0 ≤ kN-m, 0 ≤ jN, then the nonzero elements of (a kj ), $\left({b}_{kj}^{i}\right)$, (c kj ) are given by
${a}_{kj}={h}_{t,k}\phantom{\rule{2.77695pt}{0ex}}{\mathrm{\Pi }}_{v}\left(j,k\right),\phantom{\rule{2.77695pt}{0ex}}k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=m,m+1,\dots ,N,$
(23)
$\begin{array}{ll}\hfill {b}_{kj}^{i}& ={h}_{t,k}\phantom{\rule{2.77695pt}{0ex}}{\mathrm{\Pi }}_{{\beta }_{i}}\left(j,k\right),\phantom{\rule{2.77695pt}{0ex}}\phantom{\rule{2.77695pt}{0ex}}k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=⌈{\beta }_{i}⌉,⌈{\beta }_{i}⌉+1,\dots ,N,\phantom{\rule{2em}{0ex}}\\ \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}i=1,2,\dots ,r-1,\phantom{\rule{2em}{0ex}}\end{array}$
(24)
${c}_{kk}={h}_{t,k},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m.$
(25)
Moreover, if we denote by d kj , 0 ≤ k, jN the elements of the square matrix corresponding to the multi-point boundary conditions, then the nonzero elements of d kj are given by
$\begin{array}{ll}\hfill {d}_{N-m+1,j}& =\frac{{\left(-1\right)}^{\left(j-{q}_{0}\right)}\mathrm{\Gamma }\left(j+{q}_{0}+1\right)}{{t}^{{q}_{0}}\mathrm{\Gamma }\left(j-{q}_{0}+1\right)\mathrm{\Gamma }\left({q}_{0}+1\right)},\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\phantom{\rule{2em}{0ex}}\\ \hfill {d}_{kj}& =\sum _{l={q}_{k-N+m-1}}^{j}{\left(-1\right)}^{j+l}\frac{\mathrm{\Gamma }\left(j+l+1\right){x}_{k-N+m-1}^{l-{q}_{k-N+m-1}}}{{t}^{l}\mathrm{\Gamma }\left(j-l+1\right)\mathrm{\Gamma }\left(l+1\right)\mathrm{\Gamma }\left(l-{q}_{k-N+m-1}+1\right)},\phantom{\rule{2em}{0ex}}\\ \phantom{\rule{1em}{0ex}}k=N-m+2,N-m+3,\dots ,N-1,\phantom{\rule{2em}{0ex}}\\ \hfill {d}_{N,j}& =\frac{\mathrm{\Gamma }\left(j+{q}_{m-1}+1\right)}{{t}^{{q}_{m-1}}\mathrm{\Gamma }\left(j-{q}_{m-1}+1\right)\mathrm{\Gamma }\left({q}_{m-1}+1\right)},\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\phantom{\rule{2em}{0ex}}\end{array}$
(26)
Proof. The square matrix A is defined from the bilinear form:
${a}_{kj}=\left\{\begin{array}{cc}{\left({D}^{\nu }{L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t}},\hfill & k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ 0,\hfill & k=N-m+1,\dots ,N,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \end{array}\right\$
and its nonzero elements are
$\begin{array}{c}{a}_{kj}={\left({D}^{\nu }{L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t}}=\underset{0}{\overset{t}{\int }}{D}^{\nu }{L}_{t,j}\left(x\right){L}_{t,k}\left(x\right){w}_{t}\left(x\right)dx,\\ \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\end{array}$
Immediately, if we set μ = ν in Theorem 2.2, and we consider the only the first (N + 1)-terms shifted Legendre polynomials in relation (13), then we obtain
$\begin{array}{c}{a}_{k,j}=\underset{0}{\overset{t}{\int }}\sum _{l=0}^{N}{\mathrm{\Pi }}_{\nu }\left(j,l\right){L}_{t,l}\left(x\right){L}_{t,k}\left(x\right){w}_{t}\left(x\right)dx,\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,\\ \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}j=⌈\nu ⌉,⌈\nu ⌉+1,\dots ,N,\end{array}$
where Π ν (j, l) is given in (14). By the orthogonality of the shifted Legendre polynomials (8), we immediately with direct calculation observe that the nonzero elements of a kj can be given as (23). The matrix B i for i = 1, 2,..., r - 1 and C defined by the bilinear forms:
${b}_{kj}^{i}=\left\{\begin{array}{cc}{\left({D}^{{\beta }_{i}}{L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t}},\hfill & k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ 0,\hfill & \text{otherwise},\hfill \end{array}\right\$
${c}_{kj}=\left\{\begin{array}{cc}{\left({L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t}},\hfill & k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ 0,\hfill & \text{otherwise},\hfill \end{array}\right\$

then due to (7) and making use of the orthogonality relation of shifted Legendre polynomials (8), and after some manipulation, one can show that the nonzero elements of ${b}_{kj}^{i};i=1,2,\dots ,m-1$, and c kj are given explicitly as (24) and (25), respectively.

The matrix D corresponding to the treatment of multi-point boundary conditions (21), its elements can be written as
${d}_{kj}=\left\{\begin{array}{cc}0,\hfill & k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ {D}^{\left({q}_{0}\right)}{L}_{L,j}\left(0\right),\hfill & k=N-m+1,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ {D}^{\left({q}_{i}\right)}{L}_{L,j}\left({x}_{i}\right),\hfill & k=N-m+2,N-m+3,\dots ,N-1,\phantom{\rule{1em}{0ex}}j=0,1,\dots ,N,\hfill \\ {D}^{\left({q}_{m-1}\right)}{L}_{L,j}\left(t\right),\hfill & k=N,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \end{array}\right\$
or in more convenient form
${d}_{kj}=\left\{\begin{array}{cc}0,\hfill & k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ {D}^{\left({q}_{k-N+m-1}\right)}{L}_{t,j}\left(0\right),\hfill & k=N-m+1,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ {D}^{\left({q}_{k-N+m-1}\right)}{L}_{t,j}\left({x}_{k-N+m-1}\right),\hfill & k=N-m+2,N-m+3,\dots ,N-1,\phantom{\rule{1em}{0ex}}j=0,1,\dots ,N,\hfill \\ {D}^{\left({q}_{k-N+m-1}\right)}{L}_{t,j}\left(L\right),\hfill & k=N,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \end{array}\right\$
(27)
If we use the analytical form of shifted Legendre polynomial of degree i (6) and in virtue of (4), then it can be easily shown that
${D}^{{q}_{0}}{L}_{t,j}\left(0\right)=\frac{{\left(-1\right)}^{j-{q}_{0}}\mathrm{\Gamma }\left(j+{q}_{0}+1\right)}{{t}^{{q}_{0}}\mathrm{\Gamma }\left(j-{q}_{0}+1\right)\mathrm{\Gamma }\left({q}_{0}+1\right)},$
(28)
${D}^{{q}_{i}}{L}_{t,j}\left({x}_{i}\right)=\sum _{l={q}_{i}}^{j}{\left(-1\right)}^{j+l}\frac{\mathrm{\Gamma }\left(j+l+1\right){x}_{i}^{l-{q}_{i}}}{{t}^{l}\mathrm{\Gamma }\left(j-l+1\right)\mathrm{\Gamma }\left(l+1\right)\mathrm{\Gamma }\left(l-{q}_{i}+1\right)},$
(29)
${D}^{{q}_{m-1}}{L}_{t,j}\left(t\right)=\frac{\mathrm{\Gamma }\left(j+{q}_{m-1}+1\right)}{{t}^{{q}_{m-1}}\mathrm{\Gamma }\left(j-{q}_{m-1}+1\right)\mathrm{\Gamma }\left({q}_{m-1}+1\right)}.$
(30)

The substitution by (28), (29), and (30) into (27), gives the nonzero elements of d kj as mentioned in (26).

## 4 A quadrature shifted Legendre tau method

In this section, we use the Q-SLT method to solve numerically the following FDE with variable coefficients
${D}^{\nu }u\left(x\right)+\sum _{i=1}^{r-1}{\gamma }_{i}\left(x\right){D}^{{\beta }_{i}}u\left(x\right)+{\gamma }_{r}\left(x\right)u\left(x\right)=g\left(x\right),\phantom{\rule{1em}{0ex}}x\text{in}\phantom{\rule{2.77695pt}{0ex}}I=\left[0,t\right],$
(31)

subject to the multi-point boundary conditions (16).

It is worthy to mention that the pure spectral-tau technique is rarely used in practice, since for variable coefficient terms and a general right-hand side function g one is unable to compute exactly its representation by Legendre polynomials. In fact, the so-called pseudospectral-tau (quadrature-tau) method is used to treat the variable coefficient terms and right-hand side, (see for instance, Funaro [17]. In fact, Doha et al. [37] used a quadrature Jacobi dual-Petrov-Galerkin method for solving some ordinary differential equations with variable coefficients but by considering their integrated forms. Moreover, Bhrawy et al. [19] introduced a quadrature shifted Legendre tau method for developing a direct solution technique for solving multi-order fractional differential equations with variable coefficients with respect to initial conditions.

If we denote by xN,j(xt,N,j), 0 ≤ jN, and ϖ N,j (ϖt,N,j), (0 ≤ jN), the nodes and Christoffel numbers of the standard (respectively shifted) Legendre-Gauss-Lobatto quadratures on the intervals [-1, 1] and [0, t], respectively. Then one can easily show that
$\begin{array}{c}{x}_{t,N,j}=\frac{t}{2}\left({x}_{N,j}+1\right),\hfill \\ {\varpi }_{t,N,j}=\frac{t}{2}{\varpi }_{N,j},\hfill \end{array}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}0\le j\le N,$
(32)
and if S N [0, t] denotes the set of all polynomials of degree at most N, then it follows that for any ϕ S2N+ 1[0, t],
$\begin{array}{ll}\hfill \underset{0}{\overset{t}{\int }}{w}_{t}\left(x\right)\varphi \left(x\right)dx& =\frac{t}{2}\underset{-1}{\overset{1}{\int }}w\left(x\right)\varphi \left(\frac{t}{2}\left(x+1\right)\right)dx\phantom{\rule{2em}{0ex}}\\ =\frac{t}{2}\sum _{j=0}^{N}{\varpi }_{N,j}\varphi \left(\frac{t}{2}\left({x}_{N,j}+1\right)\right)=\sum _{j=0}^{N}{\varpi }_{t,N,j}\varphi \left({x}_{t,N,j}\right).\phantom{\rule{2em}{0ex}}\end{array}$
(33)
According to Legendre-Gauss-Lobatto quadrature, x N,j are the zeros of (1 - x2)∂ x L N , and
${\varpi }_{N,j}=\frac{2}{N\left(N+1\right)}\frac{1}{{\left({L}_{N}\left({x}_{N,j}\right)\right)}^{2}},\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}0\le j\le N.$
We define the discrete inner product and norm as follows:
${\left(u,v\right)}_{{w}_{t},N}=\sum _{k=0}^{N}u\left({x}_{t,N,k}\right)v\left({x}_{t,N,k}\right){\varpi }_{t,N,k},\phantom{\rule{1em}{0ex}}{∥u∥}_{{w}_{t},N}=\sqrt{{\left(u,u\right)}_{{w}_{t},N}}.$
(34)
Obviously,
${\left(u,v\right)}_{{w}_{t},N}={\left(u,v\right)}_{{w}_{t}}\phantom{\rule{1em}{0ex}}\forall u,v\in {S}_{2N-1}.$
(35)

Thus, for any u S N [0, t], the norms ${∥u∥}_{{w}_{t},N}$ and ${∥u∥}_{{w}_{t}}$ coincide.

Associating with this quadrature rule, we denote by ${I}_{N}^{{L}_{t}}$ the shifted Legendre-Gauss-Lobatto interpolation,
${I}_{N}^{{L}_{t}}u\left({x}_{t,N,j}\right)=u\left({x}_{t,N,j}\right),\phantom{\rule{1em}{0ex}}0\le j\le N.$
The quadrature tau method for (31) subject to (16) is to find u N S N [0, t] such that
$\begin{array}{ll}\hfill {\left({D}^{\nu }{u}_{N},{L}_{t,k}\left(x\right)\right)}_{{w}_{t}}& +\sum _{i=1}^{r-1}{\left({\gamma }_{i}\left(x\right){D}^{{\beta }_{i}}{u}_{N},{L}_{t,k}\left(x\right)\right)}_{{w}_{t},N}+{\left({\gamma }_{r}\left(x\right){u}_{N},{L}_{t,k}\left(x\right)\right)}_{{w}_{t},N}\phantom{\rule{2em}{0ex}}\\ ={\left(g,{L}_{t,k}\left(x\right)\right)}_{{w}_{t},N},\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,\phantom{\rule{2em}{0ex}}\end{array}$
(36)
and
(37)
where (.,.) is the discrete inner product defined in (34). Let us denote
${u}_{N}\left(x\right)=\sum _{j=0}^{N}{a}_{j}{L}_{t,j}\left(x\right),\phantom{\rule{1em}{0ex}}a={\left({a}_{0},{a}_{1},\dots ,{a}_{N}\right)}^{T},$
then equation (36) can be written as
(38)
Now it is not difficult to show, by using (13), that the variational formulation (38) is equivalent to
(39)
subject to (37) which may be written in more convenient form (27). Let us denote
$\begin{array}{c}{g}_{k}={\left(g,{L}_{t,k}\right)}_{{w}_{t},N},\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,\\ \mathbf{g}={\left({g}_{0},{g}_{1},\dots ,{g}_{N-m},{s}_{0},\dots ,{s}_{m-1}\right)}^{T},\\ {E}^{i}={\left({e}_{kj}^{i}\right)}_{0
where
$\begin{array}{c}{e}_{kj}^{i}=\left\{\begin{array}{cc}{\left({\gamma }_{i}\left(x\right)\sum _{l=0}^{N}{\mathrm{\Pi }}_{{\beta }_{i}}\left(j,l\right){L}_{t,l}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t},N},\hfill & k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N\hfill \\ i=1,2,\dots ,r-1,\hfill \\ 0,\hfill & \text{otherwise},\hfill \end{array}\right\\\ {f}_{kj}=\left\{\begin{array}{cc}{\left({\gamma }_{r}\left(x\right){L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t},N},\hfill & k=0,1,\dots ,N-m,\phantom{\rule{2.77695pt}{0ex}}j=0,1,\dots ,N,\hfill \\ 0,\hfill & \text{otherwise}.\hfill \end{array}\right\\end{array}$
Thereby, we can write (39) and its multi-point boundary conditions in the following matrix algebraic system form
$\left(A+\sum _{i=1}^{r-1}{E}^{i}+F+D\right)\mathbf{a}=\mathbf{g},$
(40)

where A and D are given in Theorem 3.1, while E i ; i = 1, 2,..., r - 1, and F are given explicitly in the following theorem.

Theorem 4.1 If we denote ${e}_{kj}^{i}={\left({\gamma }_{i}\left(x\right){D}^{{\beta }_{i}}{L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t},N}$, k = 0, 1, ..., N - m, j = 0,1,..., N, i = 1,2,..., r - 1, and ${f}_{kj}={\left({\gamma }_{r}\left(x\right){L}_{t,j}\left(x\right),{L}_{t,k}\left(x\right)\right)}_{{w}_{t},N}$, k = 0,1,..., N - m, j = 0,1,..., N,, then the nonzero elements of $\left({e}_{kj}^{i}\right)$; i = 1, 2,..., r - 1 and (c kj ) are given by
$\begin{array}{c}{e}_{kj}^{i}=\sum _{p=0}^{N}{\varpi }_{t,N,p}\phantom{\rule{2.77695pt}{0ex}}{\gamma }_{i}\left({x}_{t,N,p}\right)\left(\sum _{l=0}^{N}{\mathrm{\Pi }}_{{\beta }_{i}}\left(j,l\right){L}_{t,l}\left({x}_{t,N,p}\right)\right){L}_{t,k}\left({x}_{t,N,p}\right),\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,\\ \phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\phantom{\rule{2.77695pt}{0ex}}j=⌈{\beta }_{i}⌉,⌈{\beta }_{i}⌉+1,\dots ,N,\phantom{\rule{1em}{0ex}}i=1,2,\dots ,r-1,\\ \phantom{\rule{1em}{0ex}}{f}_{kj}=\sum _{p=0}^{N}{\varpi }_{t,N,p}{\gamma }_{r}\left({x}_{t,N,p}\right){L}_{t,j}\left({x}_{t,N,p}\right){L}_{t,k}\left({x}_{t,N,p}\right),\phantom{\rule{1em}{0ex}}k=0,1,\dots ,N-m,j=0,1,\dots ,N.\end{array}$

Proof. The proof of this theorem can be accomplished by following the same procedure used in proving Theorem 3.1.

Remark 4.2 In the case of γ i (x) ≠ 0, i = 1, ..., r, the linear system (40), can be solved by forming explicitly the LU factorization; i.e., $A+\sum _{i=1}^{r-1}{E}^{i}+F+D=LU$. The expense of calculating LU factorization is O(N3) operations and the expense of solving the linear system (35), provided that the factorization is known, is O(N2).

## 5 A shifted Legendre collocation method for nonlinear multi-order FDE

Since the collocation methods approximate differential equations in physical space, it is very easy to implement and adaptable to various of problems, including variable coefficient and nonlinear differential equations (see, for instance [16]). In this section, we use the shifted Legendre collocation method to numerically solve the nonlinear multi-order FDE with multi-point boundary conditions, namely
${D}^{\nu }u\left(x\right)=F\left(x,u\left(x\right),{D}^{{\delta }_{1}}u\left(x\right),\dots ,{D}^{{\delta }_{k}}u\left(x\right)\right),\phantom{\rule{1em}{0ex}}x\in I,$
(41)

subject to (16), where m - 1 < ν ≤ m, 0 < δ1 < δ2 < ··· < δ k < ν.

We approximate the solution in the form ${u}_{N}\left(x\right)=\sum _{j=0}^{N}{a}_{j}{L}_{t,j}\left(x\right)$, then, making use of formula (13) enables us to express explicitly the derivatives ${D}^{\nu }u\left(x\right),{D}^{{\delta }_{1}}u\left(x\right),\dots ,{D}^{{\delta }_{k}}u\left(x\right)$ in terms of the expansion coefficients a j and the shifted Legendre polynomials.

The shifted Legendre collocation method for (41) is to find u N (x) S N [0, t] such that
(42)

The previous equation means (41) is satisfied exactly at the collocation points ${x}_{L,N-m+1,k}^{\left(\alpha ,\beta \right)}$, k = 0, 1,..., N - m. equation (42) constitutes a system of N - m + 1 nonlinear algebraic equations in the unknown expansion coefficients a j ; j = 0,1,..., N, also the treatment of the multi-point boundary condition (16) constitutes m linear algebraic equations in the unknown expansion coefficients a j ; j = 0,1,..., N (see, equation (21)), the combination of these two algebraic systems can be solved by using any standard iteration technique, like Newton's iteration method.

Remark 5.1 The algorithms introduced in this article can be well suited for handling general linear and nonlinear fractional-order differential equations with initial or two-point boundary conditions.

## 6 Numerical results

In this section, we give some numerical results obtained by using the algorithms presented in the previous sections.

We consider the following examples.

Example 1 Consider the linear fractional differential equation
$\begin{array}{c}{D}^{\nu }u\left(x\right)+a{D}^{{\nu }_{2}}u\left(x\right)+b{D}^{{\nu }_{1}}+cu\left(x\right)=f\left(x\right),\\ \phantom{\rule{1em}{0ex}}0<{\nu }_{1}\le 1,\phantom{\rule{1em}{0ex}}1<{\nu }_{2}\le 2,\phantom{\rule{1em}{0ex}}3<\nu \le 4,\end{array}$
(43)
and
$f\left(x\right)=\frac{2a}{\mathrm{\Gamma }\left(3-{\nu }_{2}\right)}{x}^{2-{\nu }_{2}}+\frac{2b}{\mathrm{\Gamma }\left(3-{\nu }_{1}\right)}{x}^{2-{v}_{1}}-\frac{b}{\mathrm{\Gamma }\left(2-{\nu }_{1}\right)}{x}^{1-{\nu }_{1}}+c\left({x}^{2}-x\right),$

subject to the following three types of four-point boundary conditions:

• The first type:
$u\left(0\right)=0,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.25\right)=-0.5,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.50\right)=2,\phantom{\rule{1em}{0ex}}u\left(1\right)=0.$
(44)
• The second type:
${u}^{″}\left(0\right)=2,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.35\right)=-0.3,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.75\right)=0.5,\phantom{\rule{1em}{0ex}}{u}^{″}\left(1\right)=2.$
(45)
• The third type:
$u\left(0\right)=0,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.35\right)=-0.3,\phantom{\rule{1em}{0ex}}{u}^{″}\left(0.75\right)=2,\phantom{\rule{1em}{0ex}}{u}^{‴}\left(1\right)=0.$
(46)

The analytic solution of this problem is u(x) = x2 - x. Regarding problem (43) subject to the three types of multi-point boundary conditions (44)-(46), we study two different cases of a, b, c, ν 1, ν 2 , and ν.

• Case I: a = 1, b = 1, c = 1, ν1 = 0.77, ν2 = 1.44, and ν = 3.91.

• Case II: a = 6, b = -3, c = -4, ν1 = 0.5, ν2 = 1.5, and ν = 3.5.

Table 1 lists the maximum absolute errors using SLT method, with various choices of N, for solving equation (43) subject to the first type of multi-point boundary conditions (44) and the two previous cases. While in Table 2, we present the maximum absolute errors using SLT method, with various choices of N, for equation (43) subject to the second type of multi-point boundary conditions (45). Moreover, the maximum absolute errors, using SLT method for equation (43) subject to the third type of multi-point boundary conditions (46) and the two cases of a, b, c, ν1, ν2, ν with various choices of N are presented in Table 3.
Example 2 Consider the initial value problem of fractional-order
${D}^{\nu }u\left(x\right)+u\left(x\right)={x}^{2}+\frac{2}{\mathrm{\Gamma }\left(3-\nu \right)}{x}^{2-\nu },\phantom{\rule{1em}{0ex}}u\left(0\right)=0,$
(47)

whose exact solution is given by u(x) = x2.

In the case of ν = 0.01, 0.10, 0.50, 0.99, the maximum absolute errors of u(x) - u N (x) for the initial value problem (47) by using the SLT method with various choices of N is shown in Figure 1.
Example 3 Consider the boundary value problem for fractional differential equation with variable coefficients
${D}^{‴}u\left(x\right)+\text{sin}\left(x\right){D}^{\frac{1}{2}}u\left(x\right)+{e}^{3x}u\left(x\right)=f\left(x\right),$
(48)

subject to the following two types of three-point boundary conditions:

• The first type:
${u}^{\prime }\left(0\right)=0,\phantom{\rule{1em}{0ex}}u\left(0.5\right)=-\frac{1}{256},\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(1\right)=1,$
(49)
• The second type:
$u\left(0\right)=0,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.5\right)=-\frac{3}{64},\phantom{\rule{1em}{0ex}}{u}^{″}\left(1\right)=14,$
(50)
and
$f\left(x\right)=336{x}^{6}-210{x}^{5}+{e}^{3x}\left({x}^{8}-{x}^{7}\right)+\frac{\text{sin}\left(x\right)}{\sqrt{\pi }}\left(\frac{32768}{6435}{x}^{\frac{15}{2}}-\frac{2048}{429}{x}^{\frac{13}{2}}\right).$

One can easily check that u(x) = x8 - x7 is the unique analytical solution.

In Table 4, we list the ${L}_{{w}_{L}}^{2},{L}_{{w}_{L}}^{\infty }$, and ${H}_{{w}_{L}}^{1}$ errors of (48) subject to the first type of boundary conditions, using the Q-SLT method with various choices of N. It is notice that only a small number of shifted Legendre polynomials is needed to obtain a satisfactory result. The results of ${L}_{{w}_{L}}^{2},{L}_{{w}_{L}}^{\infty }$, and ${H}_{{w}_{L}}^{1}$ errors of (48) subject to the second type of boundary conditions is given in Table 5. The approximate solution obtained by the Q-SLT method at N = 8 for (48) with the second type of boundary conditions is shown in Figure 2 to make it easier to compare with the analytic solution.
Example 4 In this example, we consider the following nonlinear differential equation
${D}^{2.2}u\left(x\right)+{D}^{\beta }u\left(x\right)+{D}^{\alpha }u\left(x\right)+u{\left(x\right)}^{3}=f\left(x\right),$
(51)
$0<\alpha \le 1,\phantom{\rule{1em}{0ex}}1<\beta \le 2,$
where
$f\left(x\right)=\frac{2{x}^{0.8}}{\mathrm{\Gamma }\left(1.8\right)}+\frac{2{x}^{3-\beta }}{\mathrm{\Gamma }\left(4-\beta \right)}+\frac{2{x}^{3-\alpha }}{\mathrm{\Gamma }\left(4-\alpha \right)}+\frac{{x}^{9}}{27},$

subject to the following three types of three point boundary conditions

• The first type:
$u\left(0\right)=0,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.6\right)=\frac{9}{25},\phantom{\rule{1em}{0ex}}u\left(1\right)=\frac{1}{3},$
(52)
• The second type:
${u}^{″}\left(0\right)=0,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.6\right)=\frac{9}{25},\phantom{\rule{1em}{0ex}}u\left(1\right)=\frac{1}{3},$
(53)
• The third type:
$u\left(0\right)=0,\phantom{\rule{1em}{0ex}}{u}^{\prime }\left(0.7\right)=\frac{49}{100},\phantom{\rule{1em}{0ex}}{u}^{″}\left(1\right)=2.$
(54)

The exact solution of (51) is $u\left(x\right)=\frac{{x}^{3}}{3}$.

In this example we take α = 1.25, and β = 0.75. The absolute errors of u(x) - u N (x) for (51) subject to (52) and (53) for N = 20 are shown in Figures 3 and 4, respectively. Absolute errors between exact and numerical solutions of (51) subject to (54), using the SLC method for various choices of N, are introduced in Table 6.

## 7 Conclusion

We have presented some accurate direct solvers for the multi-term linear fractional-order differential equations with multi-point boundary conditions by using shifted Legendre tau approximation. The fractional derivatives are described in the Caputo sense. Moreover, we developed a new approach implementing shifted Legendre tau method in combination with the shifted Legendre collocation technique for the numerical solution of fractional-order differential equations with variable coefficients. To our knowledge, this is the first study concerning the Legendre spectral methods for solving multi-term FDEs with multi-point boundary conditions.

In this article, we proposed a numerical algorithm to solve the general nonlinear high-order multi-point FDEs, using Gauss-collocation points and approximating directly the solution using the shifted Legendre polynomials. The numerical results given in the previous section demonstrate the good accuracy of these algorithms. Moreover, the algorithms introduced in this article can be well suited for handling general linear and nonlinear m th-order differential equations with m initial conditions. The solutions obtained using the suggested algorithms show that these algorithms with a small number of shifted Legendre polynomials are giving a satisfactory result. Illustrative examples presented to demonstrate the validity and applicability of the algorithms.

## Declarations

### Acknowledgements

This study was supported by the Deanship of Scientific Research of Northern Border University under grant 035/432. The authors would like to thank the editor and the reviewers for their constructive comments and suggestions to improve the quality of the article.

## Authors’ Affiliations

(1)
Department of Mathematics, Faculty of Science, King Abdulaziz University, Jeddah, 21589, Saudi Arabia
(2)
Department of Mathematics, Faculty of Science, Beni-Suef University, Beni-Suef, Egypt
(3)
Faculty Of Computer Science and Information Technology, Northern Border University, Saudi Arabia

## References

1. Agarwal RP, Andrade B, Cuevas C: Weighted pseudo-almost periodic solutions of a class of semilinear fractional differential equations. Nonlinear Anal Real World Appl 2010, 11: 3532–3554. 10.1016/j.nonrwa.2010.01.002
2. Agarwal RP, Lakshmikantham V, Nieto JJ: On the concept of solution for fractional differential equations with uncertainty. Nonlinear Anal 2010, 72: 2859–2862. 10.1016/j.na.2009.11.029
3. Garrappa R, Popolizio M: On the use of matrix functions for fractional partial differential equations. Math Comput Simul 2011, 81: 1045–1056. 10.1016/j.matcom.2010.10.009
4. Hilfer R: Applications of Fractional Calculus in Physics. World Scientific, New Jersey; 2000.Google Scholar
5. Khan Y, Faraz N, Yildirim A, Wu Q: Fractional variational iteration method for fractional initial-boundary value problems arising in the application of nonlinear science. Comput Math Appl 2011, 62: 2273–2278. 10.1016/j.camwa.2011.07.014
6. Odibat Z: On Legendre polynomial approximation with the VIM or HAM for numerical treatment of nonlinear fractional differential equations. J Comput Appl Math 2011, 235: 2956–2968. 10.1016/j.cam.2010.12.013
7. Petras I: A note on the fractional-order Chua's system. Chaos Solitons Fractals 2008, 38: 140–147. 10.1016/j.chaos.2006.10.054
8. Podlubny I: Fractional Differential Equations, vol. 198 of Mathematics in Science and Engineering. Academic Press Inc., San Diego, CA; 1999.Google Scholar
9. Samko SG, Kilbas AA, Marichev OI: Fractional Integrals and Derivatives: Theory and Applications. Gordon and Breach, Yverdon 1993.Google Scholar
10. Canuto C, Hussaini MY, Quarteroni A, Zang TA: Spectral Methods in Fluid Dynamics. Springer, New York; 1988.
11. Canuto C, Hussaini MY, Quarteroni A, Zang TA: Spectral Methods: Fundamentals in Single Domains. Springer-Verlag, New York; 2006.Google Scholar
12. Doha EH, Bhrawy AH, Hafez RM: A Jacobi-Jacobi dual-Petrov-Galerkin method for third- and fifth-order differential equations. Math Comput Model 2011, 53: 1820–1832. 10.1016/j.mcm.2011.01.002
13. Doha EH, Bhrawy AH, Saker MA: Integrals of Bernstein polynomials: an application for the solution of high even-order differential equations. Appl Math Lett 2011, 24: 559–565. 10.1016/j.aml.2010.11.013
14. Doha EH, Bhrawy AH, Saker MA: On the Derivatives of Bernstein Polynomials: An application for the solution of higher even-order differential equations. Boundary Value Problems 2011, 2011: 16. 10.1186/1687-2770-2011-16
15. Liu GR, Wu TY: Multiple boundary value problems by differential quadrature method. Math Comput Model 2002, 35: 215–227. 10.1016/S0895-7177(01)00160-1
16. Bhrawy AH, Alofi AS: A Jacobi-Gauss collocation method for solving nonlinear Lane-Emden type equations. Commun Nonlinear Sci Numer Simulat 2012, 17: 62–70. 10.1016/j.cnsns.2011.04.025
17. Funaro D: Polynomial approximation of differential equations. In Lecturer Notes in Physics. Springer-Verlag, Berlin; 1992.Google Scholar
18. Doha EH, Bhrawy AH, Ezz-Eldien SS: Efficient Chebyshev spectral methods for solving multi-term fractional orders differential equations. Appl Math Model 2011, 35: 5662–5672. 10.1016/j.apm.2011.05.011
19. Bhrawy AH, Alofi AS, Ezz-Eldien SS: A quadrature tau method for variable coefficients fractional differential equations. Appl Math Lett 2011, 24: 2146–2152. 10.1016/j.aml.2011.06.016
20. Saadatmandi A, Dehghan M: A new operational matrix for solving fractional-order differential equations. Comput Math Appl 2010, 59: 1326–1336. 10.1016/j.camwa.2009.07.006
21. Doha EH, Bhrawy AH, Ezz-Eldien SS: A Chebyshev spectral method based on operational matrix for initial and boundary value problems of fractional order. Comput Math Appl 2011, 62: 2364–2373. 10.1016/j.camwa.2011.07.024
22. Ghoreishi F, Yazdani S: An extension of the spectral Tau method for numerical solution of multi-order fractional differential equations with convergence analysis. Comput Math Appl 2011, 61: 30–43. 10.1016/j.camwa.2010.10.027
23. Vanani SK, Aminataei A: Tau approximate solution of fractional partial differential equations. Comput Math Appl 2011, 62: 1075–1083. 10.1016/j.camwa.2011.03.013
24. Esmaeili S, Shamsi M: A pseudo-spectral scheme for the approximate solution of a family of fractional differential equations. Commun Nonlinear Sci Numer Simulat 2011, 16: 3646–3654. 10.1016/j.cnsns.2010.12.008
25. Pedas AA, Tamme E: On the convergence of spline collocation methods for solving fractional differential equations. J Comput Appl Math 2011, 235: 3502–3514. 10.1016/j.cam.2010.10.054
26. Rehman M, Khan RA: A numerical method for solving boundary value problems for fractional differential equations. Appl Math Model 2012, 36: 894–907. 10.1016/j.apm.2011.07.045
27. Rehman M, Khan RA: The Legendre wavelet method for solving fractional differential equations. Commun Nonlinear Sci Numer Simulat 2011, 16: 4163–4173. 10.1016/j.cnsns.2011.01.014
28. Chen A, Chen Y: Existence of solutions to nonlinear Langevin equation involving two fractional orders with boundary value conditions. Boundary Value Problems 2011, 2011: 17. 10.1186/1687-2770-2011-17
29. Chen SH, Hu T, Chen L: Existence results for n-point boundary value problem of second order ordinary differential equations. J Comput Appl Math 2005, 180: 425–432. 10.1016/j.cam.2004.11.010
30. Gupta CP: A generalized multi-point boundary value problem for second kind for a Sturm-Liouville operator. Appl Math Comput 1998, 89: 133–146. 10.1016/S0096-3003(97)81653-0
31. Liu Y, Weiguo Z, Chunfang S: Monotone and convex positive solutions for fourth-order multi-point boundary value problems. Boundary Value Problems 2011, 2011: 21. 10.1186/1687-2770-2011-21
32. Ma R: Existence of solutions of nonlinear m-point boundary value problem. J Math Anal Appl 2001, 256: 556–567. 10.1006/jmaa.2000.7320
33. Salem HAH: On the fractional order m-point boundary value problem in reflexive Banach spaces and weak topologies. J Comput Appl Math 2009, 224: 565–572. 10.1016/j.cam.2008.05.033
34. Webb TRL: Positive solutions of some three-point value problem via fixed point index theory. Nonlinear Anal 2001, 47: 4319–4332. 10.1016/S0362-546X(01)00547-8
35. Bai Z, Zhang Y: The existence of solutions for a fractional multi-point boundary value problem. Comput Math Appl 2010, 60: 2364–2372. 10.1016/j.camwa.2010.08.030
36. Rehman M, Khan RA: Existence and uniqueness of solutions for multipoint boundary value problems for fractional differential equations. Appl Math Lett 2010, 23: 1038–1044. 10.1016/j.aml.2010.04.033
37. Doha EH, Bhrawy AH, Hafez RM: A Jacobi dual-Petrov-Galerkin method for solving some odd-order ordinary differential equations. Abs Appl Anal 2011, 2011: 21.