- Research
- Open Access
- Published:

# Fractional spectral differentiation matrices based on Legendre approximation

*Advances in Difference Equations*
**volume 2020**, Article number: 138 (2020)

## Abstract

A simple scheme is proposed for computing \(N \times N\) spectral differentiation matrices of fractional order *α* for the case of Legendre approximation. The algorithm derived here is based upon a homogeneous three-term recurrence relation and is numerically stable. The matrices are then applied to numerically differentiate.

## Introduction

In the last few decades, applied scientists have outstretched new models that include fractional derivatives, fractional differential equations (FDEs). The classical and modern dynamical systems modeled by FDEs in physics, engineering, signal processing, fluid mechanics, and bioengineering, manufacturing, systems engineering, and project management can be observed in the recently published book [1]. They indicated that non-integer order derivatives are very appropriate for the explanation of properties of various real materials. Also, it has been exhibited that new order-fractional models are more sufficient than previously applied order-integer ones. In [2–6], the existence and uniqueness of solutions to FDEs have been given. Besides, the authors of [7–13] have published some new results of fractional operators and their applications. In general, it is impossible to gain analytic solutions of FDEs. Therefore, we have to trust in linearization/discretization and numerical integration to attain approximate solutions, see, e.g., [6, 14–17]. Moreover, the applications of series solutions for solving some types of FDEs can be observed in [18–20].

The differentiation matrices have been extended in the last few decades. It has been demonstrated that they are a useful tool in numerical integrations [21, 22]. Those could approximate derivatives by differentiating trial or cardinal basis functions through collocation points. It is noted that these matrices are both dense and very sensitive to rounding errors.

The explicit formulas for the order-integer derivatives of Legendre approximation already exist. Moreover, the authors of [17] proposed a fractional operational matrix based on the shifted Legendre polynomials on the interval \([0,1]\). In this article, we present a numerical algorithm for computing Legendre spectral differentiation matrices of order-fractional *α* (LFDMs) on the interval \([0,T]\). This algorithm is based on a homogeneous three-term recurrence relation similar to the Legendre recurrence formula and is numerically stable. The proposed LFDMs are then utilized to numerically differentiate.

## Preliminaries and definitions

First here we give some basic definitions and properties of the fractional calculus theory, the details of which can be found in [6, 23].

The Riemann–Liouville fractional integral operator of order \(\alpha\geq0\), of a function \(f(x)\) is defined as follows:

Properties of the fractional integral operator can be found in [6].

The fractional derivative of \(f(x)\) in the Caputo sense is defined as follows:

for \(m-1<\alpha\leq m\).

Also, we require here four of its main properties [6]:

where \(\lceil\alpha\rceil\) denotes the ceiling function, the smallest integer greater than or equal to *α*, and *λ* and *μ* are constants.

The standard Legendre polynomials (LPs) are determined by the following three-term recurrence formula:

where \(L_{0}(x)=1\) and \(L_{1}(x)=x\). Here we define the shifted Legendre polynomials \(P_{i}(x)=L_{i}(\frac{2}{T}x-1)\) on the interval \([0,T]\). Until further notice \(x\in[0,T]\) and \(x=\frac{2}{T}x-1\) (for simplicity of statements). The general form of the shifted LP of order *i* is given by the sum:

where \(\lfloor i/2\rfloor\) denotes the floor function, the largest integer less than or equal to \(i/2\).

Let \(\varLambda=(0,T)\). The set of shifted LPs is the \(L^{2}(\varLambda)\)-orthogonal system in *Λ*, i.e.,

where \(\delta_{ij}\) is the Kronecker symbol. Thus, for any \(v\in L^{2}(\varLambda)\), we have that

Here, the set of all algebraic polynomials of degree at most *N*, i.e., \(\pi_{N}(\varLambda)=\operatorname{span}\{P_{0},\ldots, P_{N}\}\), is denoted by \(\pi_{N}\). We consider the orthogonal projection \(\mathbf{P}_{N}:L^{2}(\varLambda)\rightarrow\pi_{N}\). For any \(v\in L^{2}(\varLambda)\), it is defined by [24]

or, equivalently,

A complete proof on estimating the difference between *v* and \(\mathbf{P}_{N}v\) is given by Guo [24]. Now from (12) we have

where the shifted Legendre coefficient vector *V* and the shifted LP vector \(\varPhi(x)\) are given by \([\widehat{v}_{0},\ldots,\widehat{v}_{N-1}]\) and \([P_{0}(x),\ldots,P_{N-1}(x)]\), respectively. We can express by \(\frac{\mathrm{d}\varPhi(x)}{\mathrm{d}x}=D\varPhi\) the derivative of the vector \(\varPhi(x)\), where *D* is the \(N\times N\) sparse first order Legendre spectral differentiation matrix. The coefficients of the matrix *D* are given by

## Legendre fractional differentiation matrices

First of all, we require a set of *N* collocation points \(x_{0},\ldots,x_{N-1}\in[0,T]\) for computing LFDMs. In this work, we consider the Legendre–Gauss–Lobbato nodes (LGL) \(x_{k}\), \(k=0,1,\ldots,N-1\). In this case, \(x_{0}=-1\), \(x_{N-1}=1\), and \(x_{k}\), \(1\leq k \leq N-2\) are the roots of the first derivative of the standard LP of \((N-1)\) order. Since any interval \([a,b]\) may be scaled into \([-1,1]\), therefore we can obtain the LGL nodes on the desired interval.

Assume that we have the value \(v=(v(x_{0}),\ldots,v(x_{N-1}))\) and we want to approximate derivatives of order *α* at those points, i.e., \(v^{(\alpha)}=(v^{(\alpha)}(x_{0}),\ldots,v^{(\alpha)}(x_{N-1}))\). One scheme is to use the polynomial interpolation at the grid points \(x_{k}\) and then analytically differentiate it and evaluate these derivatives at the same points. The other scheme is to replace polynomials by linear combinations of shifted LPs. In either case, then there is a matrix \(D^{\alpha}\) such that

The concept of a collocation derivative operator based on trial basis functions is associated with a finite expansion such as

where the functions \(\phi_{j}(x)\) form a complete set of the approximating space \(\pi_{N-1}\). Here we consider \(v:[0,T]\rightarrow\mathbb{R}\) and \(\phi_{j}(x)=P_{j}(x)\), \(j=0,1,\ldots,N-1\), i.e., the shifted LPs on the interval \([0,T]\). As a result, the function \(v(x)\) can be represented in the spectral form

Now, using Eqs. (3)–(6) in Eq. (8), we have

Also, applying the above-mentioned spectral differentiation matric *D*, we get

First, let us consider \(\alpha\in(0,1)\). Substituting (19) into (2), according to (6), we get

where

In a similar way to [25], substituting *N* values of \(x_{k}\), \(k=0,1,\ldots,N-1\), into (20), we can obtain the fractional derivative formulation as follows:

where *D* is as noted in (14) and *P* is the following matrix of the values of LPs \(P_{k}\), \(k=0,1,\ldots,N-1\), at the vector \(\mathbf{x}\in[0,T]\):

which can be easily calculated based upon the recurrence formula of the standard LPs.

The remaining problem is the estimation of \(J_{k}(x_{i})\) for \(i,k=0,1,\ldots,N-1\). This can be done using a homogeneous linear recurrence relation, as we shall illustrate in the following theorem. Deriving this recurrence relation is based on the properties of LPs.

### Theorem 1

*The sequence*\(J_{k}(x)\), \(k=0,1,\ldots,N-1\), *for*\(x\in[0,T]\)*satisfies the following linear*, *homogeneous*, *three*-*term recurrence relation*:

*with starting values*

*where*\(p=\frac{2}{T}\)*and*\(q=-1\).

### Proof

Let

Using the identity

we can write (27) in the form

On the other hand, by means of the following properties of the Legendre polynomials

and by integration by parts of equation (27), we gain

Now, equating (29) and (31) yields the desired recurrence relation (24). The starting values can be readily calculated directly. □

In view of (22), LFDM in a physical form is given by

and also, for a spectral form, we have

For the case \(\alpha>1\), LFDMs will be

where \(r=\lfloor\alpha\rfloor\) and \(\beta=\alpha-\lfloor\alpha\rfloor\).

Note that the Legendre fractional integration matrices can be derived in an analogous way. So, for \(\alpha\geq0\), the fractional integration matrices in physical and spectral forms will respectively be as follows:

where the matrix *J* can be computed from (24)–(26) with \(\alpha\rightarrow1-\alpha\).

## Application of LFDMs

Here the results of two numerical tests are given by using Matlab 7 in double precision.

The fractional differentiation of the functions \((x+1)^{3}\) and \(e^{x}\) was selected to verify the correctness of LFDMs. That is because the fractional differentiation of those functions is given by [15]

and

which is used to compare the outputs gained by the above-mentioned method. In the above expressions \(E_{n_{1},n_{2}}\) and \({}_{2}F_{1}\) are respectively the two-parameter Mittag-Leffler function and Gauss’s hypergeometric function. When \(\alpha=0.5, 1.5\) and \(T=1\), the absolute errors (\(\| \mathbf{D}_{p}^{\alpha}v(x)-D^{\alpha}v(x)\|_{\infty}\)) for the fractional differentiation are separately shown in Figs. 1 and 2.

Now we consider the following two examples of the fractional differentiation [26]:

and

where \(\alpha\in(0,1]\) and \(J_{\nu}(\cdot)\) is a Bessel function of the first kind. As before, the numerical results of the fractional differentiation for different values of *α* are reported in Table 1.

## Conclusion

Based on the shifted Legendre polynomials, we proposed an easy procedure for calculating spectral integration/differentiation matrices of the arbitrary order *α*. The developed algorithm is based on a three-term recurrence relation, which is numerically stable. In order to demonstrate the efficiency of the presented results, four examples of numerical differentiations were given, and the present method performed excellently. Besides, the promising results obtained in the present paper can further be used for solving fractional order problems.

## References

- 1.
Singh, H., Kumar, D., Baleanu, D.: Methods of Mathematical Modelling: Fractional Differential Equations. Taylor & Francis, London (2019)

- 2.
Baleanu, D., Mustafa, O.G.: On the global existence of solutions to a class of fractional differential equations. Comput. Math. Appl.

**59**, 1835–1841 (2010) - 3.
Darzi, R., Mohammadzadeh, B., Neamaty, A., Baleanu, D.: On the existence and uniqueness of solution of a nonlinear fractional differential equations. J. Comput. Anal. Appl.

**15**, 152–162 (2013) - 4.
Bai, Y., Baleanu, D., Wu, G.C.: Existence and discrete approximation for optimization problems governed by fractional differential equations. Commun. Nonlinear Sci. Numer. Simul.

**59**, 338–348 (2018) - 5.
Kilbas, A.A., Srivastava, H.M., Trujillo, J.J.: Theory and Applications of Fractional Differential Equations. Elsevier, Amsterdam (2006)

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

- 7.
Ruzhansky, M., Cho, Y.J., Agarwal, P., Area, I.: Advances in Real and Complex Analysis with Applications. Springer, Singapore (2017)

- 8.
Saoudi, K., Agarwal, P., Kumam, P., Ghanmi, A., Thounthong, P.: The Nehari manifold for a boundary value problem involving Riemann–Liouville fractional derivative. Adv. Differ. Equ.

**2018**, 263 (2018). https://doi.org/10.1186/s13662-018-1722-8 - 9.
Agarwal, P., Choi, J., Paris, R.B.: Extended Riemann–Liouville fractional derivative operator and its applications. J. Nonlinear Sci. Appl.

**8**, 451–466 (2015) - 10.
Srivastava, H.M., Agarwal, P.: Certain fractional integral operators and the generalized incomplete hypergeometric functions. Appl. Appl. Math.

**8**, 333–345 (2013) - 11.
Agarwal, P.: Further results on fractional calculus of Saigo operators. Appl. Appl. Math.

**7**, 585–594 (2012) - 12.
Agarwal, P.: Some inequalities involving Hadamard-type

*k*-fractional integral operators. Math. Methods Appl. Sci.**40**, 3882–3891 (2017) - 13.
Alderremy, A.A., Saad, K.M., Agarwal, P., Aly, S., Jain, S.: Certain new models of the multi space-fractional Gardner equation. Physica A

**545**, 123806 (2020) - 14.
Ghorbani, A.: Toward a new analytical method for solving nonlinear fractional differential equations. Comput. Methods Appl. Mech. Eng.

**197**, 4173–4179 (2008) - 15.
Diethelm, K.: The Analysis of Fractional Differential Equations: An Application-Oriented Exposition Using Differential Operators of Caputo Type. Springer, Berlin (2010)

- 16.
Cang, J., Tan, Y., Xu, H., Liao, S.J.: Series solutions of non-linear Riccati differential equations with fractional order. Chaos Solitons Fractals

**40**, 1–19 (2009) - 17.
Saadatmandi, A., Dehghan, M.: A new operational matrix for solving fractional-order differential equations. Comput. Math. Appl.

**59**, 1326–1336 (2010) - 18.
Hadid, S.B., Ibrahim, R.W., Kamaruddin, N.: A new method of human brain segmentation utilizing a class of power series solutions of fractional differential. J. Phys. Conf. Ser.

**1298**, 012012 (2019) - 19.
El-Ajou, A., Al-Zhour, Z., Oqielat, M., et al.: Series solutions of nonlinear conformable fractional KdV–Burgers equation with some applications. Eur. Phys. J. Plus

**134**, 402 (2019). https://doi.org/10.1140/epjp/i2019-12731-x - 20.
El-Ajou, A., Oqielat, M.N., Al-Zhour, Z., Kumar, S., Momani, S.: Solitary solutions for time-fractional nonlinear dispersive PDEs in the sense of conformable fractional derivative. Chaos

**29**, 093102 (2019). https://doi.org/10.1063/1.5100234 - 21.
Canuto, C., Hussaini, M.Y., Quarteroni, A., Zang, T.A.: Spectral Methods in Fluid Dynamics. Springer, New York (1988)

- 22.
Fornberg, B.: A Practical Guide to Pseudospectral Methods. Cambridge University Press, Cambridge (1996)

- 23.
Caputo, M.: Linear models of dissipation whose Q is almost frequency independent: part II. Geophys. J. R. Astron. Soc.

**13**, 529–539 (1967) (Reprinted in Fract. Calc. Appl. Anal.**11**, 4–14 (2008)) - 24.
Guo, B.Y.: Spectral Methods and Their Applications. World Scientific, River Edge (1998)

- 25.
Trif, D.: Matrix based operatorial approach to differential and integral problems. MATLAB—a ubiquitous tool for the practical engineer. Clara M. Ionescu, IntechOpen (2011). https://doi.org/10.5772/20075

- 26.
Sugiura, H., Hasegawa, T.: Quadrature rule for Abel’s equations: uniformly approximating fractional derivatives. J. Comput. Appl. Math.

**223**, 459–468 (2009)

### Acknowledgements

The authors would like to thank the editor and the anonymous referees for their helpful comments.

### Availability of data and materials

Not applicable.

## Funding

There is no funding for this work.

## Author information

### Affiliations

### Contributions

All authors jointly worked on the results and they read and approved the final manuscript.

### Corresponding author

## Ethics declarations

### Competing interests

The authors declare that they have no competing interests.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Ghorbani, A., Baleanu, D. Fractional spectral differentiation matrices based on Legendre approximation.
*Adv Differ Equ* **2020, **138 (2020). https://doi.org/10.1186/s13662-020-02590-4

Received:

Accepted:

Published:

### Keywords

- Fractional spectral differentiation matrices
- Fractional calculus
- Legendre polynomials
- Numerical differentiation