Skip to main content
Log in

Computation of Fractional Derivatives of Analytic Functions

  • Published:
Journal of Scientific Computing Aims and scope Submit manuscript

Abstract

It has recently been demonstrated that both regular derivatives and contour integrals of analytic functions can be numerically evaluated to very high orders of accuracy utilizing only grid-based function values in the complex plane. Using closely related techniques, we show here the same to be true for the task of evaluating fractional order derivatives of analytic functions across the complex plane. Several cases are illustrated.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

Data Availability

The code prepared during and analyzed during the current study is available on GitHub, as described in the text.

Notes

  1. Usually considered to have begun with Leibniz’ reply in 1695 to an inquiry by L’Hôpital “... This is an apparent paradox from which one day useful consequences will be drawn.”

  2. Another convenience with the Caputo version is that (2) implies that \(D^{\alpha }\{\text {constant}\}=0.\)

  3. Here and in the following, n denotes stencil size and not derivative ranges (as in (1), (2)).

  4. The infinite order accuracy (pseudospectral) \(n\rightarrow \infty \) limit is studied in [10].

  5. We do not assume that also the derivative \(f'(z)\) is numerically available.

  6. The TR part is exponentially accurate once interval end effects have been handled, and will not influence the order of accuracy.

  7. This changes the singularity at origin from \(O(1/z^{\alpha })\) to \(O(1/z^{\alpha +1})\).

  8. Including in the sum the right but not the left end point.

  9. The case when \(f(\tau )\) has a singularity at \(\tau =0\) is considered in Sect. 6.1.

  10. For deriving both this expansion and the corresponding one in (13), we can substitute \(z=e^{\xi }\) in [17], equation 25.12.12.

  11. The nodes are in the present application on an h-spaced grid in the complex plane, but can also be arbitrarily located.

  12. See also comments in the last paragraph of Appendix A.

  13. Euler-Maclaurin-based estimates suggest error levels of around \(O(\frac{h}{|z|})^{(2n+1)^{2}}\), indicating \(r\approx 60h\) (impractically large) for \(n=1\) and \(r\approx 3h\) for \(n=3\).

  14. Similar to the case for Gaussian quadrature methods.

  15. Extending on [5] in case data is available at grid points also outside the interval [0, t], and on [8] if it is available only at grid points within [0, t].

  16. As \(\alpha \rightarrow 0\), the divergence of \(\zeta (\alpha +1)\) is canceled by the factor \(\alpha \) in front of it; \(\lim _{\alpha \rightarrow 0}\alpha \,\zeta (\alpha +1)=1\).

References

  1. Ahlfors, L.V.: Complex Analysis. McGraw-Hill, New York (1966)

    MATH  Google Scholar 

  2. Caputo, M.: Linear model of dissipation whose Q is almost frequency independent - II. Geophys. J. R. Astr. Soc. 13(5), 529–539 (1967)

    Article  Google Scholar 

  3. Diethelm, K.: The Analysis of Fractional Differential Equations. Springer, Berlin, Heidelberg (2010)

    Book  MATH  Google Scholar 

  4. Djida, J.D., Atangana, A., Area, I.: Numerical computation of a fractional derivative with non-local and non-singular kernel. Math. Model. Nat. Phenom. 12(3), 4–13 (2017)

    Article  MathSciNet  MATH  Google Scholar 

  5. Fornberg, B.: Euler-Maclaurin expansions without analytic derivatives. Proc. Royal Soc. Lond. Ser. A 476, 20200441 (2020). https://doi.org/10.1098/rspa.2020.0441

    Article  MathSciNet  MATH  Google Scholar 

  6. Fornberg, B.: Contour integrals of analytic functions given on a grid in the complex plane. IMA J. Numer. Anal. 41(2), 814–825 (2021)

    Article  MathSciNet  MATH  Google Scholar 

  7. Fornberg, B.: Generalizing the trapezoidal rule in the complex plane. Numer. Algorithms 87(1), 187–202 (2021)

    Article  MathSciNet  MATH  Google Scholar 

  8. Fornberg, B.: Improving the accuracy of the trapezoidal rule. SIAM Rev. 63(1), 167–180 (2021)

    Article  MathSciNet  MATH  Google Scholar 

  9. Fornberg, B.: Finite difference formulas in the complex plane. Numer. Algorithms 90(3), 1305–1326 (2022)

    Article  MathSciNet  MATH  Google Scholar 

  10. Fornberg, B.: Infinite order accuracy limit of finite difference formulas in the complex plane. IMA J. Num. Anal. (2023). https://doi.org/10.1093/imanum/drac064

    Article  Google Scholar 

  11. Fornberg, B., Piret, C.: Complex Variables and Analytic Functions: An Illustrated Introduction. SIAM, Philadelphia (2020)

    MATH  Google Scholar 

  12. Hale, N., Olver, S.: A fast and spectrally convergent algorithm for rational-order fractional integral and differential equations. SIAM J. Sci. Comput. 80(4), A2456–A2491 (2018)

    Article  MathSciNet  MATH  Google Scholar 

  13. Higgins, A.: Numerical computations of fractional derivatives of analytic functions. SIAM Undergrad. Res. Online 15, 511–525 (2022). https://doi.org/10.1137/22S1520566

    Article  Google Scholar 

  14. Ishteva, M.K.: Properties and applications of the Caputo fractional operator, Master’s thesis, University of Karlsruhe, (2005)

  15. Lavoie, J.L., Osler, T.J., Tremblay, R.: Fractional derivatives and special functions. SIAM Rev. 18(2), 240–268 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  16. Li, C., Zeng, F.: Numerical Methods for Fractional Calculus. CRC Press, Abingdon (2015)

    Book  MATH  Google Scholar 

  17. Olver, F.W.J., Lozier, D.W., Boisvert, R.F., Clark, C.W.: NIST Handbook of Mathematical Functions. Cambridge University Press, Cambridge (2010)

    MATH  Google Scholar 

  18. Piret, C.: (2023). https://github.com/cmpiret/FractionalDerivatives

  19. Piret, C., Hanert, E.: A radial basis functions method for fractional diffusion equations. J. Comput. Phys. 238, 71–81 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  20. Podlubny, I.: Fractional Differential Equations. Academic Press, San Diego (1990)

    MATH  Google Scholar 

  21. Podlubny, I., Skovranek, T., Vinagre Jara, B.M., Petras, I., Verbitsky, V., Chen, Y.Q.: Matrix approach to discrete fractional calculus III: non-equidistant grids, variable step length and distributed orders. Phil. Trans. R. Soc. A 371, 21020153 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  22. Pooseh, S., Almeida, R., Torres, D.F.M.: Numerical approximations of fractional derivatives with applications. Asian J. Control 15(3), 698–712 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  23. Sun, H., Zhang, Y., Baleanu, D., Chen, W., Chen, Y.Q.: A new collection of real world applications of fractional calculus in science and engineering. Commun. Nonlinear Sci. Numer. Simul. 64, 213–231 (2018)

    Article  MATH  Google Scholar 

  24. Vargas, A.M.: Finite difference method for solving fractional differential equations at irregular meshes. Math. Comput. Simul. 193, 204–216 (2022)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Funding

The authors declare that no funds, grants, or other support were received during the preparation of this manuscript.

Author information

Authors and Affiliations

Authors

Contributions

Both authors contributed to the study conception and design, and performed material preparation and analysis. Both authors read and approved the final manuscript.

Corresponding author

Correspondence to Cécile Piret.

Ethics declarations

Conflict of interest

The authors have no relevant financial or non-financial interests to disclose.

Additional information

Publisher's Note

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

Appendices

Appendix A: Examples of End Correction Stencils at a Singular End Point

We give here some examples of correction stencils for TR evaluation of \(\int _{h}^{\infty }\frac{f(z)}{z^{\alpha +1}}dz\), to be applied to f(z)-values around \(z=0\) for some \(\alpha \) in the range \(0<\alpha <1\), and having omitted the factor \(h^{-\alpha }\) in the right hand side of (16). Below are first some examples of \(n=1\) (\(3\times 3\)) stencils.

$$\begin{aligned} \begin{array}{rrr} \underline{\alpha =0.01}\quad \\ 0.000127+0.000107i &{} 0.000191+0.001018i &{} -0.000128+0.000148i\\ 0.000866+0.000000i &{} 1.005706+0.000000i &{} -0.001172-0.000000i\\ 0.000127-0.000107i &{} 0.000191-0.001018i &{} -0.000128-0.000148i \end{array} \end{aligned}$$

This value of \(\alpha =0.01\) is close to \(\alpha =0\) in which case the fractional derivative reduces to the function value at the evaluation point. Therefore, this stencil is close to one at its center point, and to zero at all other entries. In this and all following cases, the values above and below the real axis are the complex conjugates of each other, in particular being real along the real axis.

$$\begin{aligned} \begin{array}{rrr} \underline{\alpha =0.25}\quad \\ 0.0051+0.0043i &{} 0.0072+0.0401i &{} -0.0051+0.0059i\\ 0.0349+0.0000i &{} 1.1468+0.0000i &{} -0.0474+0.0000i\\ 0.0051-0.0043i &{} 0.0072-0.0401i &{} -0.0051-0.0059i \end{array} \\ \begin{array}{rrr} \underline{\alpha =0.5}\quad \\ 0.0181+0.0159i &{} 0.0218+0.1433i &{} -0.0182+0.0210i\\ 0.1286+0.0000i &{} 1.3027+0.0000i &{} -0.1685+0.0000i\\ 0.0181-0.0159i &{} 0.0218-0.1433i &{} -0.0182-0.0210i \end{array} \\ \begin{array}{rrr} \underline{\alpha =0.75}\quad \\ 0.0642+0.0591i &{} 0.0491+0.5085i &{} -0.0643+0.0710i\\ 0.4762+0.0000i &{} 1.4682-0.0000i &{} -0.5706-0.0000i\\ 0.0642-0.0591i &{} 0.0491-0.5085i &{} -0.0643-0.0710i \end{array} \\ \begin{array}{rrr} \underline{\alpha =0.99}\quad \\ 2.4600+2.4498i &{} 0.0973+19.6691i &{} -2.4600+2.4740i\\ 19.6047+0.0000i &{} 1.6376+\,\;0.0000i &{} -19.7990+0.0000i\\ 2.4600-2.4498i &{} 0.0973-19.6691i &{} -2.4600-2.4740i \end{array} \end{aligned}$$

As \(\alpha \) approaches one, the weights diverge towards infinity (since the second term in the right hand side of (12) diverges).Footnote 16

In the (much more accurate) \(n=2\) case, the central weights differ very little from the \(n=1\) case, and the outer ones are numerically close to zero. For example for \(\alpha =0.5\):

$$\begin{aligned} \begin{array}{rrrrr} \underline{\alpha =0.5}\quad \\ -0.0000-0.0000i &{} 0.0001+0.0001i &{} -0.0000-0.0006i &{} -0.0001+0.0001i &{} 0.0000-0.0000i\\ 0.0001+0.0001i &{} 0.0165+0.0145i &{} 0.0222+0.1470i &{} -0.0166+0.0192i &{} -0.0001+0.0001i\\ -0.0005+0.0000i &{} 0.1318+0.0000i &{} 1.3030+0.0000i &{} -0.1729+0.0000i &{} 0.0006+0.0000i\\ 0.0001-0.0001i &{} 0.0165-0.0145i &{} 0.0222-0.1470i &{} -0.0166-0.0192i &{} -0.0001-0.0001i\\ -0.0000+0.0000i &{} 0.0001-0.0001i &{} -0.0000+0.0006i &{} -0.0001-0.0001i &{} 0.0000+0.0000i \end{array} \end{aligned}$$

If n is increased further, the stencil weights grow rapidly, with the central weight \(-19.04\) for \(n=3\) and around \(10^{12}\) for \(n=4\). If extremely high accuracy is desired, these larger stencils are nevertheless computationally cost-efficient, although their use requires extended precision arithmetic.

Appendix B: Illustrations of Fractional Derivatives and Numerical Convergence Rates

1.1 Illustrations of Some Computed Fractional Derivatives

The examples are all cases for which the analytic fractional derivatives are known, in order to allow straightforward verification that the numerical accuracy is consistently close to machine precision across the entire displayed regions. For more illustrations using this same numerical approach as developed here, see [13]. Examples of codes for the present algorithm can be found on GitHub [18].

For each function considered, we display the real and imaginary parts, the magnitude with phase angle, and the relative error of the approximation. Regarding the errors, the numbers by the colorbar correspond to \(\log _{10}\) of the error, i.e., -16 matches roughly the machine precision. The plots were produced using \(n=2\) (i.e., size \(5\times 5\) correction stencils) and only function values at the nodes of the displayed computational domain (padded with \(n=2\) layers of nodes). The end correction scheme is used in the entire domain except within the red circles shown in the error plots, where instead the Taylor expansion approaches described in Sect. 5 is used.

Fig. 13
figure 13

Plots of the real and imaginary parts for both Riemann sheets of \(D_{}^{\alpha }\frac{1}{1+z^{2}}\) with \(\alpha =0.5\) and \(h=1/20\)

Fig. 14
figure 14

Plots of the magnitudes and phase angles for both Riemann sheets in the same case as for Fig. 13

Fig. 15
figure 15

Plots of relative error vs. h for the test functions used for Figs. 5 and 7, respectively. The different curves are explained in Sect. 10.2

Fractional derivatives of analytic functions are, except on rare occasions (such as the one illustrated in Fig. 9) multi-valued functions. The method presented here can just as well compute values on any of its sheets, according to the formula \(D^{\alpha }f(z)=\frac{1}{e^{2\pi \,k\,\alpha \,i}}\left( \frac{1}{\Gamma (1-\alpha )}\int _{0}^{z}\frac{f'(\tau )}{(z-\tau )^{\alpha }}d\tau \right) \), where \(k\in \mathbb {{\mathbb {Z}}}\) and f(z) is assumed to be analytic at \(z=0\). Figures 13 and 14 illustrate both sheets in the case of of \(D^{1/2}\frac{1}{1+z^{2}}\).

1.2 Convergence Rates

Theoretically, with end correction stencils of size \(5\times 5\), we expect convergence to occur in the outer region at a rate better than \(O(h^{22})\). The computations in the inner regions (as described in Sect. 5) were implemented to give matching levels of accuracy. To verify these rates in a log-log plot of error vs. h, it is necessary to have a wide range of h-values that give results that are mostly free from the influence of rounding errors (which arise at the level \(O(10^{-15})\)). That can be achieved by using a much larger physical domain \([-20,20]\times [-20,20]\) than used in our previous displays. As seen in Fig. 15, this allows the high convergence rate to be confirmed for both outer and inner regions, although with the misleading impression that the error levels for the two regions are strongly different (rather than comparable, as seen in the previous Figs. 5, 6, 7, 8, 9, 10, 11 and 12). In Figs. 15a, b, the thin dashed and solid lines show the errors in the inner and outer regions, respectively, for the five choices of \(\alpha =0.1,\)0,3, 0.5, 0.7, 0.9 and the heavy solid lines indicates the slopes for \(O(h^{26})\) and for \(O(10^{-15}/h^{\alpha })\) in case of \(\alpha =1/2\), corresponding to theoretically expected error rates due to truncation and rounding errors, respectively.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Fornberg, B., Piret, C. Computation of Fractional Derivatives of Analytic Functions. J Sci Comput 96, 79 (2023). https://doi.org/10.1007/s10915-023-02293-4

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s10915-023-02293-4

Keywords

Mathematics Subject Classification

Navigation