1 Introduction

Because of their versatility in describing a broad spectrum of physical, chemical, biological, and other systems, fractional differential equations (DEs) have gained much attention in recent decades [1, 2]. These equations have become indispensable for modeling complicated phenomena with long-range interactions and memory effects [3, 4]. Recent articles have demonstrated an interest in solving fractional differential models encountered in various applied sciences. For instance, some fractional order epidemic models were examined in [5, 6]. In [7], the authors developed some solutions for a specific fractional financial model. An additional fractional differential equation that arises in fluid mechanics was examined in [8].

The novel results for approximating solutions are significant since analytic solutions for fractional DEs are typically not explicitly found. As a result, numerous numerical approaches for solving fractional DEs have been of great interest. Researchers used a variety of numerical algorithms to solve various fractional DEs. For example, two finite difference methods are followed in [9] for treating the time-fractional Fokker-Planck equation. The Galerkin approach is followed in [10] to solve a linear hyperbolic first-order partial DEs. The collocation method is applied in [11] to solve a specific fractional model. The homotopy analysis method treats partial fractional DEs in [12].

The time-fractional diffusion equation (TFDE), a basic modification of the classical diffusion equation that considers fractional derivatives in time, is at the core of this mathematical framework [13]. The importance of the TFDE extends beyond academic fields, providing essential insights into anomalous diffusion processes found in biological, physical, and engineering systems, including viscoelastic materials, subdiffusion phenomena, and porous media flow [1416].

One class of older polynomials defined by Pafnuty Chebyshev is the set of orthogonal polynomials known as Chebyshev polynomials (CPs), see [17]. Most CPs utilized in various applied science domains are of the first and second kinds. These polynomials are helpful in many fields. Their significance in electrohydrodynamics, optimum control, and signal processing has been noted [1820]. Many authors used the first- and second-kinds of CPs. For example, the authors of [21] handled some real-life problems via first-derivative CPs of the first kind. Lane–Emden equations are solved via CPs of the first kind in [22]. The authors in [23] used the second-kind CPs for higher-order DEs. The kinds of CPs are not restricted to the first- and second-kinds. Other contributions were presented, but other types of CPs were used. The third and fourth kinds of CPs are special non-symmetric Jacobi polynomials. The authors of [24] solved some variable-order fractional DEs by using the shifted CPs of the third kind; the authors in [25] treated some fractional DEs. Some singular Lane-Emden equations were treated using the third- and fourth-kinds in [26]. Several applications have recently been utilized by the other four types of CPs, classified as special ones of the generalized Gegenbauer polynomials ([27, 28]). For example, the authors in [29] solved some mixed-type fractional DEs using the fifth-kind CPs. The authors of [30] employed the sixth-kind CPs to treat some telegraph type-equations. More recently, the authors of [31] introduced and utilized the seventh-kind CPs to solve some fractional delay DEs. Furthermore, the polynomials, namely, the eighth-kind CPs, solve the generalized Kawahara DEs using two different approaches in [32, 33].

Due to their incredible accuracy and computing efficiency, spectral methods have become famous for solving DEs [34]. Many contributions employ the different versions of spectral methods; see, for example, [3540]. Among these techniques for fractional DEs is the spectral tau approach, which converts the original problems into algebraic systems that can be solved computationally effectively [41, 42]. In this study, we suggest a new use of the spectral tau approach for solving the time-fractional DEs, with basis functions being seventh-kind CPs.

Since CPs are a desirable option for spectral approximations because of their rapid convergence, numerical stability, and orthogonality, we create a strong basis expansion designed explicitly for solving TFDE. Our main goal is to provide accurate numerical estimates for TFDE using the spectral tau approach with seventh-kind CPs. We will investigate the theoretical and numerical aspects of our method. The suggested method’s accuracy and convergence behavior will be carefully studied. Moreover, we evaluate our methodology’s effectiveness and computational power using a set of numerical examples that demonstrate its faithful representation of the complex dynamics of TFDE solutions.

This paper is organized into the following sections: Sect. 2 presents some fundamentals and useful preliminaries. A tau approach for solving the TFDE is followed in Sect. 3. A thorough error analysis of our methodology is provided in Sect. 4. Three examples are provided in Sect. 5. Lastly, Sect. 6 reports a few conclusions.

2 Some key relations and formulas

This section is dedicated to reviewing the fundamentals of fractional calculus. Moreover, some relations and properties of the seventh-kind CPs and their corresponding shifted ones are exhibited.

2.1 An account on Caputo fractional derivative

Definition 1

In Caputo’s sense, the fractional-order derivative is [3]:

$$\begin{aligned}& D^{\nu}g(\xi )=\frac{1}{\Gamma (r-\nu )}\displaystyle \int _{0}^{\xi}(\xi -t)^{r- \nu -1}g^{(r)}(t)\, dt,\quad \nu >0 ,\quad \xi >0, \\& \,r-1< \nu \leq r,\quad r\in \mathbb{N}. \end{aligned}$$
(1)

In addition, the following properties apply

$$\begin{aligned} D^{\nu}C&=0,\ (\text{for a constant $C$}), \end{aligned}$$
(2)
$$\begin{aligned} D^{\nu}\,\xi ^{\ell}&= \textstyle\begin{cases} 0, & \text{if }\ell \in{\mathbb{N}}_{0} \quad and \quad \ell < \lceil \nu \rceil , \\ \frac{\ell \,!}{\Gamma (\ell +1-\nu )}\,\xi ^{\ell -\nu}, & \text{if } \ell \in{\mathbb{N}}_{0} \quad and \quad \ell \geq \lceil \nu \rceil , \end{cases}\displaystyle \end{aligned}$$
(3)

where \({\mathbb{N}}=\{1,2,\ldots \}\) and \({\mathbb{N}}_{0}=\{0,1,2, \ldots \}\).

2.2 A account on seventh-kind CPs

Consider the seventh-kind CPs \(\{\bar{Z}_{\ell}(\xi ),\ \ell \ge 0\}\) defined as [31]

$$ \bar{Z}_{\ell}(\xi )= \textstyle\begin{cases} \frac{(2)_{\frac{\ell}{2}} \, P_{\frac{\ell}{2}}^{\left (-\frac{1}{2},\frac{3}{2}\right )}\left (2 \xi ^{2}-1\right )}{\left (\frac{5}{2}\right )_{\frac{\ell}{2}}}, & \text{if $\ell $ even} , \\ \frac{x\, \Gamma \left (\frac{\ell +5}{2}\right ) \, P_{\frac{\ell -1}{2}}^{\left (-\frac{1}{2},\frac{5}{2}\right )}\left (2 \xi ^{2}-1\right )}{\left (\frac{5}{2}\right )_{\frac{\ell +1}{2}}}, & \text{if $\ell $ odd}, \end{cases} $$
(4)

where \((a)_{n}\) is the Pochhammer function defined as \((a)_{n}=\frac{\Gamma (a+n)}{\Gamma (a)}\), and \(P_{\ell}^{\left (a,b\right )}\left (\xi \right )\) is the classical Jacobi polynomial of degree .

\(\left \{\bar{Z}_{\ell}(\xi )\right \}_{\ell \ge 0}\) is an orthogonal set on \([-1,1]\) with the following orthogonality relation:

$$ \int _{-1}^{1}\displaystyle \frac{\xi ^{4}}{\sqrt{1-\xi ^{2}}}\, \bar{Z}_{\ell}( \xi )\, \, \bar{Z}_{s}(\xi )\,d\xi =\varrho _{\ell}\,\delta _{\ell ,s}, $$
(5)

where

$$ \varrho _{\ell}= \frac{9\, \pi }{8} \textstyle\begin{cases} \displaystyle \frac{1}{(\ell +1)\, (\ell +3)}, & \text{if $\ \ell $ even}, \\ \displaystyle \frac{(\ell +1)\, (\ell +3)}{\ell \, (\ell +2)^{2}\, (\ell +4)}, & \text{if $\ \ell $ odd}, \end{cases} $$
(6)

with

$$ \delta _{\ell ,s}= \textstyle\begin{cases} 1, & \text{if $\ell =s$} , \\ 0, & \text{if $\ell \neq s$}. \end{cases} $$
(7)

Lemma 1

[31] The following trigonometric expressions apply:

$$\begin{aligned} \bar{Z}_{2\ell}(\cos (\varphi ))=&\frac{3}{4} \left ( \frac{\cos ((2 \ell +1) \varphi )}{2 \ell +1}+ \frac{\cos ((2 \ell +3) \varphi )}{2 \ell +3}\right ) \sec ^{3}( \varphi ), \end{aligned}$$
(8)
$$\begin{aligned} \begin{aligned} \bar{Z}_{2\ell +1}(\cos (\varphi ))&= \frac{3\, \sec ^{4}(\varphi )}{8\, (2\ell +1)\, (2\ell +3)\, (2\ell +5)} \\ &\times \left ((2\ell +5)\, (2(\ell +2)\, \cos ((2\ell +1)\,\varphi )+2 \,(2\ell +1)\, \cos ((2\ell +3)\,\varphi ))\right . \\ &+\left .2(2\ell +1)\, (\ell +1) \,\cos ((2\ell +5)\,\varphi )\right ). \end{aligned} \end{aligned}$$
(9)

Lemma 2

[31] Let \(\ell \in{\mathbb{N}}_{0}\). \(\bar{Z}_{j}(\xi )\) may be expressed as:

$$\begin{aligned} \bar{Z}_{2\ell}(\xi )=&\sum _{m=0}^{\ell } \frac{(-1)^{m}\, (2 \ell -m+1)!}{(\ell -m)!\, m!\, \left (\frac{5}{2}\right )_{\ell -m}} \, \xi ^{2 \ell -2 m}, \end{aligned}$$
(10)
$$\begin{aligned} \bar{Z}_{2\ell +1}(\xi )=&\sum _{m=0}^{\ell } \frac{(-1)^{m}\, (2 \ell -m+2)!}{(\ell -m)!\, m!\, \left (\frac{5}{2}\right )_{\ell -m+1}} \, \xi ^{2 \ell -2 m+1}. \end{aligned}$$
(11)

Theorem 1

[31] Let \(\ell \in {\mathbb{N}}_{0}\). \(\xi ^{2\, \ell}\) and \(\xi ^{2\, \ell +1}\) can be expressed in terms of \(\bar{Z}_{j}(\xi )\) as follows:

$$\begin{aligned} \xi ^{2\ell}=& 2 \ell ! \sum _{m=0}^{\ell } \frac{(\ell -m+1) \left (\frac{5}{2}\right )_{\ell}}{m! (2 \ell -m+2)!} \, \bar{Z}_{2 \ell -2 m}(\xi ), \end{aligned}$$
(12)
$$\begin{aligned} \xi ^{2\ell +1}=& \ell ! \sum _{m=0}^{\ell } \frac{(3+2 \ell -2 m) \left (\frac{5}{2}\right )_{\ell +1}}{m! (2 \ell -m+3)!} \bar{Z}_{2 \ell -2 m+1}(\xi ). \end{aligned}$$
(13)

Theorem 2

[31] It is possible to express \(\bar{Z}_{j}(\xi )\) as a combination of the first-kind CPs \(T_{i}(\xi )\) as

$$\begin{aligned} &\bar{Z}_{2\,\ell}(\xi )=\frac{6 }{(2 \,\ell +1)\,(2\, \ell +3)}\sum _{s=0}^{ \ell }(-1)^{s+1} \,c_{\ell -s}\,(s+1)\, (-2 \ell +s-1)\, T_{2\, \ell -2 s}(\xi ), \end{aligned}$$
(14)
$$\begin{aligned} &\bar{Z}_{2\,\ell +1}(\xi )= \frac{6 }{(2 \,\ell +1)\, (2\, \ell +3) \,(2\, \ell +5)} \\ &\phantom{\bar{Z}_{2\,\ell +1}(\xi )=}{}\times \sum _{s=0}^{ \ell }(-1)^{s}\, (s+1)\, (-2\, \ell +s-2)\, (-2\, \ell +2\, s-1)\,T_{2 \, \ell -2\, s+1}(\xi ), \end{aligned}$$
(15)

and

$$ c_{\ell}= \textstyle\begin{cases} \frac{1}{2}, & \textit{if $\ell =0$}, \\ 1, & \textrm{otherwise}. \end{cases} $$
(16)

Theorem 3

The second derivative of \(\bar{Z}_{\ell}(\xi )\) can be expressed as

$$\begin{aligned} &\frac{d^{2} \,\bar{Z}_{2\, \ell}(\xi )}{d\,\xi ^{2}} \\ &\quad= \sum _{k=0}^{ \ell }8\, (k-\ell )\, \left ( \frac{2 (-1)^{k}\, \left (4\, (\ell -k)^{2}-1\right )}{4\, \ell \, (\ell +2)+3}-2 \, \ell \, (k+1)+k^{2}+1\right )\,\bar{Z}_{2\, \ell -2\, k-2}(\xi ), \end{aligned}$$
(17)
$$\begin{aligned} & \frac{d^{2} \,\bar{Z}_{2\, \ell +1}(\xi )}{d\,\xi ^{2}} \\ &\quad=\sum _{k=0}^{ \ell }4\, \left (-2 \,\ell \,(k+1)+ \frac{2\, (-1)^{k}\, (2\, \ell -2\, k-1)\, (2 \ell -2 k+1)\, (2 \,\ell -2\, k+3)}{(2\, \ell +1)\, (2\, \ell +3) \,(2\, \ell +5)}+k^{2}-k \right ) \\ & \qquad{} \times (-2\, \ell +2\, k-1)\,\bar{Z}_{2\, \ell -2\, k-1}( \xi ). \end{aligned}$$
(18)

Proof

First, we prove (17). The series expression of \(\bar{Z}_{i}(t)\) in (10) leads to the following expression for \(\frac{d^{2} \,\bar{Z}_{2\, \ell}(\xi )}{d\,\xi ^{2}}\)

$$ \frac{d^{2} \,\bar{Z}_{2\, \ell}(\xi )}{d\,\xi ^{2}}=\sum _{k=0}^{ \ell } \frac{(-1)^{k}\, (2\, \ell -2\, k)\, (2\, \ell -2\, k-1)\, \Gamma (2\, \ell -k+2)}{k!\, (\ell -k)!\, \left (\frac{5}{2}\right )_{\ell -k}} \,\xi ^{2\, \ell -2 \,k-2}, $$
(19)

which, by utilizing the inversion formula (1), can be expressed as

$$\begin{aligned} &\frac{d^{2} \,\bar{Z}_{2\, \ell}(\xi )}{d\,\xi ^{2}} \\ &\quad= \sum _{k=0}^{\ell }\sum _{s=0}^{\ell -k-1} \frac{8\, (-1)^{k} \,(-2 \,\ell +2\, k+1)\, (-\ell +k+s)\, (2\, \ell -k+1)!}{(2\, \ell -2\, k+3)\, k! \, s!\, (2\, \ell -2\, k-s)!} \,\bar{Z}_{2\, \ell -2\, k-2\, s-2}(\xi ). \end{aligned}$$
(20)

Upon expanding and rearranging the terms, the last relation can be transformed into

$$\begin{aligned} \frac{d^{2} \,\bar{Z}_{2\, \ell}(\xi )}{d\,\xi ^{2}}={}& \sum _{k=0}^{\ell }\sum _{s=0}^{k} \frac{8 (k-\ell ) (-1)^{k-s} (-2 \,\ell +2 k-2 s+1) \Gamma (2 \ell -k+s+2)}{\Gamma (s+1) (2 \ell -2 k+2 s+3) \Gamma (k-s+1) \Gamma (2 \ell -2 k+s+1)} \\ &{}\times \bar{Z}_{2\, \ell -2\, k-2}(\xi ). \end{aligned}$$
(21)

Now, setting

$$ G_{k,\ell}=\sum _{s=0}^{k} \frac{8\,(-1)^{k-s} \,(-2\, \ell +2\, k-2\, s+1) \,(2 \,\ell -k+s+1)!}{s!\, (2\, \ell -2\, k+2\, s+3)\, (k-s)!\, (2\, \ell -2 \,k+s)!}. $$
(22)

By directly applying Zeilberger’s algorithm [43], we can derive the subsequent recurrence relation:

$$\begin{aligned} &\left ( 4\,k\ell -2\,{k}^{2}+6\,\ell -2\,k-1 \right ) \left ( -1+2\,\ell -2\,k \right ) ^{2}G_{ k+2,\ell} \\ &\quad{} -4\, \left ( 2\,\ell +5 \right ) \left ( - 1+2\,\ell \right ) \left ( -1+\ell -k \right ) G_{ k+1,\ell} \\ &\quad{} - \left ( 4 \,k\ell -2\,{k}^{2}+10\,\ell -6\,k-5 \right ) \left ( -3+2 \,\ell -2\,k \right ) ^{2} G_{k,\ell} =0, \end{aligned}$$
(23)

with the initial values:

$$ G_{0,\ell}={\frac {-8\, \left (4\,{\ell}^{2}-1\right )}{2\,\ell +3}}, \quad G_{1,\ell}= \frac {-32\, \ell \, \left (4\,{\ell}^{2}+8\,\ell -5 \right )}{ \left ( 2\,\ell +1\right ) \left ( 2\,\ell +3 \right ) }. $$

The recursive formula (23) has the following exact solution

$$ G_{k,\ell}=8\, \left ( \frac{2\, (-1)^{k}\, \left (4 \,(\ell -k)^{2}-1\right )}{4 \,\ell \, (\ell +2)+3}-2 \, \ell \,(k+1)+k^{2}+1\right ). $$

Therefore, relation (17) may be obtained.

To prove formula (18), we use formula (11) to get

$$ \frac{d^{2} \,\bar{Z}_{2\, \ell +1}(\xi )}{d\,\xi ^{2}}=\sum _{k=0}^{ \ell } \frac{(-1)^{k}\, (2\, \ell -2 \,k+1) \,(2\, \ell -2\, k)\, \Gamma (2\, \ell -k+3)}{k!\, (\ell -k)! \,\left (\frac{5}{2}\right )_{\ell -k+1}} \,\xi ^{2 \ell -2 k-1}. $$
(24)

Using (13), we get

$$\begin{aligned} \frac{d^{2} \,\bar{Z}_{2\, \ell +1}(\xi )}{d\,\xi ^{2}}={}& \sum _{k=0}^{\ell }\sum _{s=0}^{\ell -k-1} \frac{4\,(-1)^{k}\, (2\, \ell -2\, k+1)\, (2\, \ell -2\, k-2\, s+1)\, (2\, \ell -k+2)!}{(2\,\ \ell -2\, k+5)\, k!\, s!\, \, (2\, \ell -2\, k-s+1)!} \\ &{}\times \bar{Z}_{2\, \ell -2\, k-2\, s-1}(\xi ), \end{aligned}$$
(25)

that may be turned into

$$\begin{aligned} \frac{d^{2} \,\bar{Z}_{2\, \ell +1}(\xi )}{d\,\xi ^{2}}={}& \sum _{k=0}^{\ell }\sum _{s=0}^{k} \frac{4\,(-2\, \ell +2\, k-1)\, (-1)^{k-s}\, (-2\, \ell +2\, k-2\, s-1)\, (2\, \ell -k+s+2)!}{s!\, (2\, \ell -2\, k+2 \,s+5) \,(k-s)!\, (2\, \ell -2\, k+s+1)!} \\ &{}\times \bar{Z}_{2\, \ell -2\, k-1}(\xi ). \end{aligned}$$
(26)

Now, set

$$ \tilde{G}_{k,\ell}=\sum _{s=0}^{k} \frac{ 4\,(-1)^{k-s}\, (-2\, \ell +2\, k-2\, s-1)\, (2 \,\ell -k+s+2)!}{s!\, (2\, \ell -2\, k+2 \,s+5)\, (k-s)!\, (2\, \ell -2\, k+s+1)!}. $$
(27)

Apply Zeilberger’s algorithm to demonstrate that the function \(\tilde{G}_{k,\ell}\) fulfills the subsequent recurrence relation:

$$ \begin{aligned} &\left ( 1+2\,\ell -2\,k \right ) \left ( 4\,k\ell -2\,{k}^{2}+6 \,\ell +3 \right ) \left ( \ell -k \right ) \tilde{G}_{k+2,\ell} \\ & - \left ( -1+2\,\ell -2\,k\right ) \left ( 4\,{\ell}^{2}+4\,k\ell -2 \,{k}^{2}+20\,\ell -2\,k+3 \right ) \tilde{G}_{k+1,\ell} \\ & - \left ( -1+\ell -k \right ) \left ( 4\,k\ell -2\,{k}^{2}+ 10\, \ell -4\,k+1 \right ) \left ( -3+2\,\ell -2\,k \right )\, \tilde{G}_{k, \ell}=0, \end{aligned} $$
(28)

with:

$$ \tilde{G}_{0,\ell}={ \frac {-8\, \left (2\,{\ell}^{2}+3\,\ell +1\right )}{5+2\,\ell}}, \quad \tilde{G}_{1,\ell}={ \frac {-8\left (8\,{\ell}^{3}+36\,{\ell}^{2}+22\,\ell +3\right )}{4\,{\ell}^{2}+16\,\ell +15}}. $$

The solution of (28) is

$$ \tilde{G}_{k,\ell}=4\,\left (-2\, \ell \, (k+1)+ \frac{2\, (-1)^{k}\, (2\, \ell -2\, k-1)\, (2\, \ell -2 \,k+1)\, (2\, \ell -2 \,k+3)}{(2 \,\ell +1) \, (2\, \ell +3)\, (2\, \ell +5)}+k^{2}-k \right ). $$

Therefore, relation (18) may be obtained. □

2.3 A account on the shifted CPs of seventh kind

The shifted seventh-kind CPs: \(C_{n}(t)\) is defined on \([0,\tau ],\, \tau >0\) by

$$ C_{n}(t)= \bar{Z}_{n}\left (\frac{2\,t}{\tau}-1\right ). $$
(29)

According to (5), the polynomials \(C_{n}(t),n\ge 0\), are orthogonal on \([0,\tau ]\), with

$$ \displaystyle \int _{0}^{\tau }\,\displaystyle \frac{(\frac{2\,t}{\tau}-1)^{4}}{\sqrt{t\,(\tau -t)}}\, C_{n}(t)\,C_{m}(t) \, dt=\varrho _{n}\,\delta _{n,m}. $$
(30)

Theorem 4

[31] The analytic form of \(C_{i}(t)\) is given as follows:

$$ C_{i}(t)=\displaystyle \sum _{p=0}^{i}\lambda _{p,i}\, {\left (\frac{t}{\tau} \right )}^{p}, $$
(31)

where

$$ \lambda _{p,i}= \textstyle\begin{cases} \frac{3 \,(i+2)}{2\, (i+1)\, (i+3)}, & \textit{if $p=0$},\quad i \textit{ even,} \\ -\frac{3 \,(i+1) \,(i+3)}{2\, i \,(i+2)\, (i+4)}, & \textit{if $p=0$}, \quad i \textit{ odd}, \\ \sum _{j=\left \lfloor \frac{p+1}{2}\right \rfloor }^{\frac{i}{2}} \frac{3 \,(-1)^{i/2}\, j \,4^{p} \,(i-2 \,j+2)\, (i+2\, j+2) \,(-1)^{j+p} \, (2 \, j+p-1)!}{(i+1)\, (i+3)\, (2\, p)!\, (2\, j-p)!}, & \textit{if $p\neq 0$},\quad i\textit{ even} , \\ \sum _{j=\left \lfloor \frac{p}{2}\right \rfloor }^{\frac{i-1}{2}} \frac{3 \, (-1)^{\frac{i+1}{2}}\, (2 \,j+1)^{2}\, 2^{2\, p-1}\, (i-2\, j+1) \,(i+2\, j+3)\, (-1)^{j+p}\, (2\, j+p)!}{i\, (i+2)\, (i+4) \,(2\, p)!\, (2 \, j-p+1)!}, & \textit{if $p\neq 0$}, \quad i\textit{ odd.} \end{cases} $$
(32)

Theorem 5

[31] \(t^{m}\) can be expanded in terms of \(C_{i}(t)\) as

$$ t^{m}=\tau ^{m} \displaystyle \sum _{r=0}^{m}H_{r,m}\, C_{r}(t), $$
(33)

where

$$ H_{r,m}= \textstyle\begin{cases} \sum _{L=1}^{\left \lfloor \frac{m-r}{2}\right \rfloor } \frac{2^{3-2\, m}\, (r+2)\, (2\, L+r)\, (2\,m)!\,\Gamma \left (\frac{r+5}{2}\right ) \, (L+r-1)!}{3\, \Gamma (3-L) \,L!\, \Gamma \left (\frac{r+1}{2}\right )\, \Gamma (L+r+3) \,(-2\, L+m-r)! \,(2\, L+m+r)!}+ \frac{4^{-m} \,(r+3) \,\Gamma (2\, m+1)}{3\, (m-r)!\, (m+r)!}, \\ \quad\textit{if r even,} \\ \sum _{L=0}^{\left \lfloor \frac{1}{2} (m-r+1)\right \rfloor } \frac{4^{2-m}\, (r+2) (2\, m)!\, \Gamma \left (\frac{r}{2}+3\right )\, (L+r-1)!}{3 \,\Gamma (3-L)\, L!\, \Gamma \left (\frac{r}{2}\right )\, (L+r+2)!\, (-2\, L+m-r)!\, (2\, L+m+r)!}, \\ \quad\textit{if r odd}. \end{cases} $$
(34)

Corollary 1

It is possible to express \(C_{j}(t)\) as a combination of the shifted first-kind CPs \(T^{*}_{i}(t)\) as

$$\begin{aligned} &C_{2\,\ell}(t)=\frac{6 }{(2 \,\ell +1)\,(2\, \ell +3)}\sum _{s=0}^{ \ell }(-1)^{s+1} \,c_{\ell -s}\,(s+1)\, (-2 \ell +s-1)\, T^{*}_{2\, \ell -2 s}(t), \end{aligned}$$
(35)
$$\begin{aligned} &C_{2\,\ell +1}(t)= \frac{6 }{(2 \,\ell +1)\, (2\, \ell +3) \,(2\, \ell +5)}\sum _{s=0}^{ \ell }(-1)^{s}\, (s+1)\, (-2\, \ell +s-2)\, (-2\, \ell +2\, s-1) \\ &\phantom{C_{2\,\ell +1}(t)=}{}\times T^{*}_{2 \, \ell -2\, s+1}(t). \end{aligned}$$
(36)

Proof

The proof is easily obtained by replacing ξ with \((\frac{2\,t}{\tau}-1)\) in Theorem 2. □

Theorem 6

For \(0<\alpha <1\), we have

$$ D^{\alpha}C_{i}(t)=t^{-\alpha}\,\left ( \sum _{p=0}^{i} \eta _{p,i}^{ \alpha}\, C_{p}(t)-\frac{\lambda _{0,i}}{\Gamma (1-\alpha )}\right ), $$
(37)

where

$$ \eta _{p,i}^{\alpha}=\sum _{r=p}^{i} \frac{r!\, \lambda _{r,i}\, H_{p,r} }{\Gamma (r-\alpha +1)}. $$
(38)

Proof

From Eq. (31), we have

$$ C_{i}(t)=\displaystyle \sum _{p=0}^{i}\lambda _{p,i}\, {\left (\frac{1}{\tau} \right )}^{p} \,t^{p}, $$
(39)

using (3), the last equation can be rewritten as

$$ D^{\alpha}C_{i}(t)=\displaystyle \sum _{p=1}^{i}\lambda _{p,i}\, {\left ( \frac{1}{\tau}\right )}^{p} \,\frac{p!}{\Gamma (p-\alpha +1 )}\,t^{p- \alpha }. $$
(40)

In virtue of the inversion formula (33), Eq. (40) becomes

$$ D^{\alpha}C_{i}(t)=t^{-\alpha}\,\displaystyle \sum _{p=1}^{i}\lambda _{p,i} \, \frac{p!}{\Gamma (p-\alpha +1 )}\,\sum _{r=0}^{p} H_{r,p}\,C_{p}(t). $$
(41)

The arrangement of Eq. (41) leads to the following formula

$$ D^{\alpha}C_{i}(t)=t^{-\alpha}\,\left ( \sum _{p=0}^{i} \eta _{p,i}^{ \alpha}\, C_{p}(t)-\frac{\lambda _{0,i}\,H_{0,0}}{\Gamma (1-\alpha )} \,C_{0}(t)\right ), $$
(42)

which can be written in simple form as

$$ D^{\alpha}C_{i}(t)=t^{-\alpha}\,\left ( \sum _{p=0}^{i} \eta _{p,i}^{ \alpha}\, C_{p}(t)-\frac{\lambda _{0,i}}{\Gamma (1-\alpha )}\right ), $$

where

$$ \eta _{p,i}^{\alpha}=\sum _{r=p}^{i} \frac{r!\, \lambda _{r,i}\, H_{p,r} }{\Gamma (r-\alpha +1)}. $$

This completes the proof of the theorem. □

3 Tau approach for solving the TFDE

Our main objective in this section is to handle the following TFDE [44]

$$ \partial _{t}^{\alpha}u(\xi ,t)-\partial _{\xi}^{2}u(\xi ,t)=f(\xi ,t), \quad \forall \,(\xi ,t)\in \Omega , $$
(43)

governed by the following conditions:

$$\begin{aligned} u(\xi ,0)=&p_{1}(\xi ),\quad \forall \, \xi \in (-1,1), \end{aligned}$$
(44)
$$\begin{aligned} u(-1,t)=&p_{2}(t),\quad u(1,t)=p_{3}(t),\quad \forall \, t\in (0,\tau ), \end{aligned}$$
(45)

where \(\alpha \in (0,1),\, \Omega =(-1,1)\times (0,\tau )\). Moreover, \(p_{1}(\xi ),\,p_{2}(t),\,p_{3}(t)\) are continuous functions and \(f(\xi ,t)\) is a known continuous function.

Consider the space

$$ \begin{aligned} &L^{2}_{\omega (\xi ,t)}(\Omega )={\mathrm{{span}}}\{{\bar{Z}_{i}( \xi )}\,{C_{j}(t)}:i=0,1,2,\ldots \,\text{and}\,j=0,1,2,\ldots \}, \\ & \end{aligned} $$
(46)

and assume that \(u(\xi ,t)\in L^{2}_{\omega (\xi ,t)}(\Omega )\) is expanded as

$$ u(\xi ,t)=\sum _{i=0}^{\infty}\sum _{j=0}^{\infty}b_{ij}\,\bar{Z}_{i}( \xi )\,C_{j}(t), $$
(47)

where \({\omega}(\xi ,t)= \frac{\xi ^{4}\,(\frac{2\,t}{\tau}-1)^{4}}{\sqrt{1-\xi ^{2}}\,\sqrt{t\,(\tau -t)}}\). It is easy to see that \(b_{ij}\) are given by

$$ b_{ij}=\frac{1}{ \varrho _{i}\,\varrho _{j}}\,\displaystyle \int _{0}^{\tau} \int _{-1}^{1} \,\displaystyle \,u(\xi ,t)\, \bar{Z}_{i}(\xi )\,C_{j}(t)\,{ \omega}(\xi ,t)\,d\xi \, dt. $$
(48)

Therefore, \(u(\xi ,t)\) can be approximated in \(L^{2}_{\omega (\xi ,t)}(\Omega )\) as

$$ u_{\mathsf{M}}(\xi ,t)=\sum _{i=0}^{\mathsf{M}}\sum _{j=0}^{ \mathsf{M}}b_{ij}\,\bar{Z}_{i}(\xi )\,C_{j}(t)=\boldsymbol{\bar{Z}}( \xi )\,\mathbf{B}\,\boldsymbol{{C}^{T}}(t), $$
(49)

where

$$\begin{aligned}& \boldsymbol{\bar{Z}}(\xi )=[\bar{Z}_{0}(\xi ),\bar{Z}_{1}(\xi ), \ldots ,\bar{Z}_{\mathsf{M}}(\xi )],\\& \boldsymbol{C}(t)=[C_{0}(t),C_{1}(t),\ldots ,C_{\mathsf{M}}(t)], \end{aligned}$$

and \(\mathbf{B}=(b_{ij})_{0\leq i,j\leq \mathsf{M}}\) is a \((\mathsf{M}+1)\times (\mathsf{M}+1)\) matrix.

Now, the following residual \(\mathbf{R}(\xi ,t)\) of Eq. (43) can be obtained after replacing \(u(\xi ,t)\) with \(u_{\mathsf{M}}(\xi ,t)\)

$$ \mathbf{R}(\xi ,t)=\partial _{t}^{\alpha}u_{\mathsf{M}}(\xi ,t)- \partial _{\xi}^{2}u_{\mathsf{M}}(\xi ,t)-f(\xi ,t). $$
(50)

Let us define

$$\begin{aligned} (\,u(\xi ,t),v(\xi ,t)\,)_{\omega (\xi ,t)}=&\int _{0}^{\tau}\int _{-1}^{1}u( \xi ,t)\,v(\xi ,t)\,\omega (\xi ,t)\,d\xi \,dt, \end{aligned}$$
(51)
$$\begin{aligned} (\,u(\xi ),v(\xi )\,)_{\bar{\omega}(\xi )}=&\int _{-1}^{1}u(\xi )\,v( \xi )\,\bar{\omega}(\xi )\,d\xi , \end{aligned}$$
(52)
$$\begin{aligned} (\,u(t),v(t)\,)_{\hat{\omega}(t)}=&\int _{0}^{\tau}u(t)\,v(t)\, \hat{\omega}(t)\,dt, \end{aligned}$$
(53)

where \(\bar{\omega}(\xi )=\frac{\xi ^{4}}{\sqrt{1-\xi ^{2}}}\) and \(\hat{\omega}(t)= \frac{(\frac{2\,t}{\tau}-1)^{4}}{\sqrt{t\,(\tau -t)}}\).

The application of tau method [30] leads to

$$ (\,\mathbf{R}(\xi ,t),\bar{Z}_{r}(\xi )\,C_{s}(t) \,)_{\omega (\xi ,t)}=0, \quad r:0,1,\ldots,\mathsf{M}-2,\quad s:0,1,\ldots,\mathsf{M}-1, $$
(54)

which leads to the following matrix equation

$$ \mathbf{A^{T}}\,\mathbf{B}\,\mathbf{Y}-\mathbf{G^{T}}\,\mathbf{B}\, \mathbf{E}=\mathbf{F}, $$
(55)

where

A = ( a i , r ) ( M + 1 ) × ( M 1 ) , a i , r = ( Z ¯ r ( ξ ) , Z ¯ i ( ξ ) ) ω ¯ ( ξ ) , Y = ( y j , s ) ( M + 1 ) × M , y j , s = ( C s ( t ) , D α C j ( t ) ) ω ˆ ( t ) , G = ( g i , r ) ( M + 1 ) × ( M 1 ) , g i , r = ( Z ¯ r ( ξ ) , D 2 Z ¯ i ( ξ ) ) ω ¯ ( ξ ) , E = ( e j , s ) ( M + 1 ) × M , e j , s = ( C s ( t ) , C j ( t ) ) ω ˆ ( t ) , F = ( f r , s ) ( M 1 ) × M , f r , s = ( f ( ξ , t ) , Z ¯ r ( ξ ) C s ( t ) ) ω ( ξ , t ) .

Theorem 7

The elements of matrices A, E, G and Y are given by

$$\begin{aligned} &a_{i,r}=\varrho _{r}\,\delta _{r,i}, \end{aligned}$$
(56)
$$\begin{aligned} &e_{j,s}=\varrho _{s}\,\delta _{s,j}, \end{aligned}$$
(57)
$$\begin{aligned} &g_{2\,i,r}=\sum _{r=0}^{i} 8\, (r-i)\, \left ( \frac{2 (-1)^{r}\, \left (4\, (i-r)^{2}-1\right )}{4\, i\, (i+2)+3}-2 \, i\, (r+1)+r^{2}+1\right ) \\ &\phantom{g_{2\,i,r}=}{}\times\varrho _{2\, j-2\, r-2}\,\delta _{2\, j-2 \, r-2,r}, \end{aligned}$$
(58)
$$\begin{aligned} &g_{2\,i+1,r}=\sum _{r=0}^{i} 4\, \left (-2 \,i \,(r+1)+ \frac{2\, (-1)^{r}\, (2\, i-2\, r-1)\, (2 i-2 r+1)\, (2 \,i-2\, r+3)}{(2\, i+1)\, (2\, i+3) \,(2\, i+5)}+r^{2}-r \right ) \\ & \phantom{g_{2\,i+1,r}=}{} \times (-2\, i+2\, r-1)\,\varrho _{2\, i-2\, r-1}\,\delta _{2 \, i-2\, r-1,r}, \end{aligned}$$
(59)
$$\begin{aligned} & y_{j,s} =\sum _{p=0}^{s}\sum _{r=0}^{j}\lambda _{p,s}\, \lambda _{r,j}\,\tau ^{\alpha} \,\left [16\,\beta \left (\alpha +p+r+ \frac{9}{2},\frac{1}{2}\right )-32\,\beta \left (\alpha +p+r+ \frac{7}{2},\frac{1}{2}\right )\right . \\ &\phantom{y_{j,s} =}{}+24\,\beta \left (\alpha +p+r+\frac{5}{2},\frac{1}{2}\right ) \\ &\phantom{y_{j,s} =}{}\left .-8 \,\beta \left (\alpha +p+r+\frac{3}{2},\frac{1}{2}\right )+\beta \left (\alpha +p+r+\frac{1}{2},\frac{1}{2}\right )\right ]. \end{aligned}$$
(60)

Proof

By using the orthogonality relations (5), (30) and Theorem 3, the entries of A, E, and G may be easily found.

By virtue of Theorem 6, the elements \(y_{j,s}\) can be written as

$$ \begin{aligned} y_{j,s}=&(C_{s}(t),D^{\alpha}C_{j}(t))_{\hat{\omega}(t)} \\ & =\displaystyle \int _{0}^{\tau }\,\displaystyle \frac{(\frac{2\,t}{\tau}-1)^{4}}{\sqrt{t\,(\tau -t)}}\, C_{s}(t)\,D^{ \alpha}C_{j}(t)\, dt \\ & =\sum _{p=0}^{j} \eta _{p,j}^{\alpha}\,\displaystyle \int _{0}^{\tau }\,\displaystyle \frac{\left (\frac{16 t^{4}}{\tau ^{4}}-\frac{32 t^{3}}{\tau ^{3}}+\frac{24 t^{2}}{\tau ^{2}}-\frac{8 t}{\tau }+1\right )}{\sqrt{t\,(\tau -t)}} \, t^{-\alpha}\, C_{s}(t)\, C_{p}(t)\, dt \\ & -\frac{\lambda _{0,j}}{\Gamma (1-\alpha )}\displaystyle \int _{0}^{\tau }\, \displaystyle \frac{\left (\frac{16 t^{4}}{\tau ^{4}}-\frac{32 t^{3}}{\tau ^{3}}+\frac{24 t^{2}}{\tau ^{2}}-\frac{8 t}{\tau }+1\right )}{\sqrt{t\,(\tau -t)}} \,t^{-\alpha}\, C_{s}(t)\,dt. \end{aligned} $$
(61)

With the aid of formula (31), the last equation becomes

$$ \begin{aligned} y_{j,s} =&\sum _{p=0}^{j}\sum _{n=0}^{s}\sum _{r=0}^{p} \frac{\eta _{p,j}^{\alpha}\,\lambda _{n,s}\,\lambda _{r,p}}{\tau ^{n+r}} \\ & \times \int _{0}^{\tau }\left ( \frac{16 \, t^{n+r-\alpha +\frac{7}{2}}}{\tau ^{4}}- \frac{32\, t^{n+r-\alpha +\frac{5}{2}}}{\tau ^{3}}+ \frac{24\, t^{n+r-\alpha +\frac{3}{2}}}{\tau ^{2}}- \frac{8 \,t^{n+r-\alpha +\frac{1}{2}}}{\tau }+t^{n+r-\alpha - \frac{1}{2}}\right ) \\ &{}\times\frac{1}{\sqrt{\tau -t}}dt -\frac{\lambda _{0,j}}{\Gamma (1-\alpha )}\,\sum _{n=0}^{s} \frac{\lambda _{n,s}}{\tau ^{n}} \\ & \times \int _{0}^{\tau }\left ( \frac{16 \, t^{n-\alpha +\frac{7}{2}}}{\tau ^{4}}- \frac{32\, t^{n-\alpha +\frac{5}{2}}}{\tau ^{3}}+ \frac{24\, t^{n-\alpha +\frac{3}{2}}}{\tau ^{2}}- \frac{8 \,t^{n-\alpha +\frac{1}{2}}}{\tau }+t^{n-\alpha -\frac{1}{2}} \right ) \frac{1}{\sqrt{\tau -t}}dt. \end{aligned} $$
(62)

The integration in the right-hand side of Eq. (62) can be evaluated to give the following result

$$\begin{aligned} y_{j,s} =&\sum _{p=0}^{j}\sum _{n=0}^{s}\sum _{r=0}^{p} \frac{\eta _{p,j}^{\alpha}\,\lambda _{n,s}\,\lambda _{r,p}}{\tau ^{n+r}} \,\left [16\,\beta \left (n+r-\alpha +\frac{9}{2},\frac{1}{2}\right )-32 \,\beta \left (n+r-\alpha +\frac{7}{2},\frac{1}{2}\right )\right . \\ & \left .+24\,\beta \left (n+r-\alpha +\frac{5}{2},\frac{1}{2}\right )-8 \,\beta \left (n+r-\alpha +\frac{3}{2},\frac{1}{2}\right )+\beta \left (n+r-\alpha +\frac{1}{2},\frac{1}{2}\right )\right ] \\ & -\frac{\lambda _{0,j}}{\Gamma (1-\alpha )}\,\sum _{n=0}^{s} \frac{\lambda _{n,s}}{\tau ^{n}}\,\left [16\,\beta \left (n-\alpha + \frac{9}{2},\frac{1}{2}\right )-32\,\beta \left (n-\alpha + \frac{7}{2},\frac{1}{2}\right )\right . \\ & \left .+24\,\beta \left (n-\alpha +\frac{5}{2},\frac{1}{2}\right )-8 \,\beta \left (n-\alpha +\frac{3}{2},\frac{1}{2}\right )+\beta \left (n- \alpha +\frac{1}{2},\frac{1}{2}\right )\right ], \end{aligned}$$
(63)

where \(\beta (\xi ,y)\) is the beta function. □

Moreover, we get the following initial and boundary conditions

$$ \begin{aligned} &\sum _{i=0}^{\mathsf{M}}\sum _{j=0}^{\mathsf{M}}b_{ij} \,a_{i,r}\,C_{j}(0)=(p_{1}(\xi ),\,\bar{Z}_{r}(\xi ) )_{\bar{\omega}( \xi )},\quad r=0,1,\ldots \mathsf{M}, \\ & \sum _{i=0}^{\mathsf{M}}\sum _{j=0}^{\mathsf{M}}b_{ij}\,\bar{Z}_{i}(-1) \,e_{j,s}=(p_{2}(t),\,C_{s}(t) )_{\hat{\omega}(t)},\quad s=0,1,\ldots \mathsf{M}-1, \\ & \sum _{i=0}^{\mathsf{M}}\sum _{j=0}^{\mathsf{M}}b_{ij}\,\bar{Z}_{i}(1) \,e_{j,s}=(p_{3}(t),\,C_{s}(t) )_{\hat{\omega}(t)},\quad s=0,1,\ldots \mathsf{M}-1. \end{aligned} $$
(64)

Merging the \(\mathsf{M}^{2}-\mathsf{M}\) equations in (55) with the \((3\,\mathsf{M}+1)\) constraints in (64), a system of order \((\mathsf{M}+1)^{2}\) is obtained, and thus the approximate solution can be derived using the Gaussian elimination technique.

Remark 1

The Algorithm 1 specifies the necessary steps to obtain the desired approximate solution to the time-fractional diffusion equation.

Algorithm 1
figure a

Coding algorithm for our proposed technique

4 Error analysis

This section is confined to investigating the double expansion used in approximation. The following two lemmas are useful for what comes next.

Lemma 3

[31] The following inequality is satisfied in the interval \([0,1]\)

$$ |C_{k}(t)|< (k+3),\,\qquad \forall \ k\ge 0. $$
(65)

Lemma 4

The following inequality is satisfied in the interval \([0,\tau ]\)

$$ |C_{k}(t)|< (k+3),\,\qquad \forall \ k\ge 0. $$
(66)

Proof

The proof of Lemma 4 is similar to the proof of Lemma 3 after using \(|T^{*}_{\ell}(t)|\leq 1\). □

Lemma 5

Let \(\ell \ge 0\). The following inequality holds

$$ |\bar{Z}_{\ell}(\xi )|< (\ell +3),\,\qquad \forall \ \xi \in [-1,1]. $$
(67)

Proof

The proof of this lemma is similar to the proof of Lemma 3 after using Eqs. (14) and (15) along with \(|T_{m}(t)|\leq 1\). □

Theorem 8

Assume that a function \(u(\xi ,t)=\bar{h}(\xi )\,\bar{\bar{h}}(t)\in L^{2}_{\omega (\xi ,t)}( \Omega )\), with \(\bar{h}(\xi )\) and \(\bar{\bar{h}}(t)\) have bounded fourth derivative satisfy the expansion in (47). Then the series in (49) converges uniformly to \(u(\xi ,t)\). Moreover, the following bound on the expansion coefficients in (49) satisfy the inequality

$$ |b_{ij}|\lesssim \frac{1}{i^{3}\,j^{3}},\quad \forall \ i,j>3, $$
(68)

where \(n\lesssim \hat{n}\) means that there ia a constant c with \(n\leq c\,\hat{n}\).

Proof

From Eq. (48), we have

$$ b_{ij}=\frac{1}{ \varrho _{i}\,\varrho _{j}}\,\displaystyle \int _{0}^{\tau} \int _{-1}^{1} \,\displaystyle \,u(\xi ,t)\, \bar{Z}_{i}(\xi )\,C_{j}(t)\,{ \omega}(\xi ,t)\,d\xi \, dt. $$
(69)

The previous equation will be transformed after using the following substitutions

$$ t=\frac{\tau}{2}(1+\cos \varphi ),\quad \xi =\cos \psi , $$

and the assumption \(u(\xi ,t)=\bar{h}(\xi )\,\bar{\bar{h}}(t)\) along with the definition of \(C_{i}(t)\) (29) into

$$\begin{aligned} b_{ij}={}&\frac{1}{ \varrho _{i}\,\varrho _{j}}\,\displaystyle \int _{0}^{\pi} \int _{0}^{\pi} \,\displaystyle \bar{h}(\cos \psi )\,\bar{\bar{h}}\left ( \frac{\tau}{2}(1+\cos \varphi )\right ) \\ &{}\times \bar{Z}_{i}(\cos \psi )\, \bar{Z}_{i}(\cos \varphi )\,\cos ^{4}\psi \,\cos ^{4}\varphi \,d \varphi \,d\psi , \end{aligned}$$
(70)

which can be written as

$$ b_{ij}=I_{1}\times I_{2}, $$
(71)

where

$$ I_{1}=\frac{1}{ \varrho _{i}}\,\displaystyle \int _{0}^{\pi}\bar{h}(\cos \psi ) \bar{Z}_{i}(\cos \psi )\,\cos ^{4}\psi \,d\psi , $$
(72)

and

$$ I_{2}=\frac{1}{ \varrho _{j}}\,\int _{0}^{\pi}\bar{\bar{h}}\left ( \frac{\tau}{2}(1+\cos \varphi )\right )\, \bar{Z}_{i}(\cos \varphi ) \,\cos ^{4}\varphi \,d\varphi . $$
(73)

Now, we have four cases:

(i) If \(i,j\, \textrm{even}\).

Firstly, we will find \(I_{1}\).

Using Lemma 1, \(\varrho _{i}=\frac{9\, \pi }{8\,(i+1)\, (i+3)}\) in Eq. (6) along with the following property

$$ \cos a\,\cos b=\frac{1}{2}(\cos (a+b)+\cos (a-b)) $$

and simplifying the result yields

$$ \begin{aligned} I_{1}={}&\frac{2}{ 3\,\pi}\,\displaystyle \int _{0}^{\pi }\,\displaystyle \, \bar{h}(\cos \psi )\,\cos \psi \left [(i+3)\,\cos ((i+1)\,\psi )+(i+1) \,\cos ((i+3)\,\psi )\right ]\,d\psi \\ ={}&\frac{1}{ 3\,\pi}\,\displaystyle \int _{0}^{\pi }\,\displaystyle \,\bar{h}(\cos \psi ) \, \, [2\,(i+2)\,\cos ((i+2)\psi )\\ &{}+(i+3)\,\cos (i\psi )+(i+1)\, \cos ((i+4)\psi ) ]\,d\psi . \end{aligned} $$
(74)

If we integrate Eq. (74) by parts three times, we get the following relation

$$ I_{1}=\frac{1}{24\,\pi} \displaystyle \int _{0}^{\pi}\bar{h}'''(\cos \psi )\, \Delta _{i}(\psi )\,d\psi ,$$
(75)

where

$$ \begin{aligned} \Delta _{i}(\psi )={}&\frac{2}{(i+2)\,(i+3)}\,\left (\cos ((i+2) \psi )-\cos ((i+4)\psi )\right ) \\ &{}-\frac{2\,(i+1)}{(i+3)\,(i+4)\,(i+5} \,\left (\cos ((i+3)\psi )-\cos ((i+5)\psi )\right ) \\ &{} +\frac{(i+3)}{i\,(i-1)\,(i-2)}\,\left (\cos ((i-3)\psi )-\cos ((i-1) \psi )\right ) \\ &{}-\frac{8}{i\,(i-1)\,(i+1)}\,\left (\cos ((i-1)\psi )- \cos ((i+1)\psi )\right ) \\ &{} -\frac{2}{(i+1)\,(i+2)}\,\left (\cos (i\psi )-\cos ((i+2)\psi ) \right )\\ &{} +\frac{(i+1)}{(i+4)\,(i+5)\,(i+6}\,\left (\cos ((i+5)\psi )- \cos ((i+7)\psi )\right ) \\ &{} - \frac{2 \left (i^{2}-5\, i-18\right )}{i\, (i+1)\, (i+2)\, (i+3)\, (i+4)} \,\left (\cos ((i+1)\psi )-\cos ((i+3)\psi )\right ). \end{aligned} $$
(76)

Now, integrating Eq. (76) again by parts and taking into consideration that \(\bar{h}(\xi )\) and \(\bar{\bar{h}}(t)\) have bounded fourth derivative, then the following inequality is obtained

$$ |I_{1}|\lesssim \frac{1}{i^{3}},\quad \forall \ i>3. $$
(77)

In addition, after applying the trigonometric representations to \(I_{2}\), the integration by parts three times results in

$$ I_{2}=\frac{\tau ^{3}}{192\,\pi} \displaystyle \int _{0}^{\pi}\bar{\bar{h}}''' \left (\frac{\tau}{2}(1+\cos \varphi )\right )\,\hat{\Delta}_{i}( \varphi )\,d\varphi ,$$
(78)

where

$$\begin{aligned} \hat{\Delta}_{i}(\varphi )={}& \frac{(i+3)}{i\,(i-1)\,(i-2)}\,\left (\cos ((i-3)\varphi )-\cos ((i-1) \varphi )\right ) \\ &{}-\frac{2\,(i+1)}{(i+3)\,(i+4)\,(i+5}\,\left (\cos ((i+3) \varphi )-\cos ((i+5)\varphi )\right ) \\ &{} -\frac{2}{(i+1)\,(i+2)}\,\left (\cos (i\varphi )-\cos ((i+2) \varphi )\right ) \\ &{} +\frac{(i+1)}{(i+4)\,(i+5)\,(i+6}\,\left (\cos ((i+5) \varphi )-\cos ((i+7)\varphi )\right ) \\ &{} -\frac{8}{i\,(i-1)\,(i+1)}\,\left (\cos ((i-1)\varphi )-\cos ((i+1) \varphi )\right ) \\ &{}+\frac{2}{(i+2)\,(i+3)}\,\left (\cos ((i+2)\varphi )- \cos ((i+4)\varphi )\right ) \\ &{} - \frac{2 \left (i^{2}-5\, i-18\right )}{i\, (i+1)\, (i+2)\, (i+3)\, (i+4)} \,\left (\cos ((i+1)\varphi )-\cos ((i+3)\varphi )\right ). \end{aligned}$$
(79)

And hence, we get the following inequality

$$ |I_{2}|\lesssim \frac{1}{j^{3}},\quad \forall \ j>3, $$
(80)

after integrating Eq. (79) by parts and using the hypothesis of the theorem.

Finally, we have from Eqs. (71), (77) and (80)

$$ |b_{ij}|=|I_{1}|\times |I_{2}|\lesssim \frac{1}{i^{3}\,j^{3}},\quad \forall \ i,j>3. $$
(81)

To prove the following three cases

(ii) \(i,j\, \textrm{odd}\).

(iii) \(i\, \textrm{even},\,j \,\textrm{odd}\).

(iiii) \(i\, \textrm{odd},\,j\, \textrm{even}\).

Imitating similar steps to those given in case (i), we get the following inequality

$$ |b_{ij}|\lesssim \frac{1}{i^{3}\,j^{3}},\quad \forall \ i,j>3. $$

This completes the proof of this theorem. □

Remark 2

The following inequalities will be obtained if we follow similar steps to those given in Theorem 8

$$ |b_{0j}|\lesssim \frac{1}{j^{3}},\quad |b_{1j}|\lesssim \frac{1}{j^{3}}, \quad |b_{2j}|\lesssim \frac{1}{j^{3}},\quad |b_{3j}|\lesssim \frac{1}{j^{3}},\quad \forall j>3, $$
(82)

and

$$ |b_{i0}|\lesssim \frac{1}{i^{3}},\quad |b_{i1}|\lesssim \frac{1}{i^{3}}, \quad |b_{i2}|\lesssim \frac{1}{i^{3}},\quad |b_{i3}|\lesssim \frac{1}{i^{3}},\quad \forall \ i>3. $$
(83)

Lemma 6

[45] Consider a positive, decreasing, continuous function \(f(\xi )\). If \(\xi \geq n\) with \(f(k)=a_{k}\) such that \(\sum{a_{n}}\) is convergent and \(R_{n}=\sum _{k=n+1}^{\infty}a_{k}\), then \(R_{n}\leq \int _{n}^{\infty}f(\xi )d\,\xi \).

Theorem 9

If \(u(\xi ,t)\) satisfies the hypothesis of Theorem 8, then the following estimate of truncation error is fulfilled:

$$ {\|u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)\|}_{L^{2}_{\omega (\xi ,t)}( \Omega )}\lesssim \frac{1}{\mathsf{M}^{3}}. $$
(84)

Proof

We can write

$$ \begin{aligned}& {\|u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)\|}_{L^{2}_{\omega ( \xi ,t)}(\Omega )} \\ &\quad\leq \left \|\sum _{i=0}^{\mathsf{M}}\sum _{j=\mathsf{M}+1}^{\infty}b_{ij} \,\bar{Z}_{i}(\xi )\,C_{j}(t)\right \|_{L^{2}_{\omega (\xi ,t)}( \Omega )}+\left \|\sum _{i=\mathsf{M}+1}^{\infty}\sum _{j=0}^{\infty}b_{ij} \,\bar{Z}_{i}(\xi )\,C_{j}(t)\right \|_{L^{2}_{\omega (\xi ,t)}( \Omega )} \\ &\quad =\sum _{i=0}^{\mathsf{M}}\sum _{j=\mathsf{M}+1}^{\infty}|b_{ij}|\, \sqrt{\varrho _{i}\,\varrho _{j}}+\sum _{i=\mathsf{M}+1}^{\infty} \sum _{j=0}^{\infty}|b_{ij}|\,\sqrt{\varrho _{i}\,\varrho _{j}} \\ &\quad =\sum _{j=\mathsf{M}+1}^{\infty}\left (\,|b_{0j}|\,\sqrt{\varrho _{0}}+|b_{1j}| \,\sqrt{\varrho _{1}}+|b_{2j}|\,\sqrt{\varrho _{2}}+|b_{3j}|\,\sqrt{ \varrho _{3}}\,\right )\,\sqrt{\varrho _{j}} \\ &\qquad{}+\sum _{i=4}^{\mathsf{M}} \sum _{j=\mathsf{M}+1}^{\infty}|b_{ij}|\,\sqrt{\varrho _{i}\,\varrho _{j}} \\ &\qquad{} +\sum _{i=\mathsf{M}+1}^{\infty}\left (\,|b_{i0}|\,\sqrt{\varrho _{0}}+|b_{i1}| \,\sqrt{\varrho _{1}}+|b_{i2}|\,\sqrt{\varrho _{2}}+|b_{i3}|\,\sqrt{ \varrho _{3}}\,\right )\,\sqrt{\varrho _{i}}\\ &\qquad{} +\sum _{i=\mathsf{M}+1}^{ \infty}\sum _{j=4}^{\infty}|b_{ij}|\,\sqrt{\varrho _{i}\,\varrho _{j}}, \end{aligned} $$
(85)

Inserting Eqs. (82) and (83) into Eq. (85) and using the inequality \(|\varrho _{i}|\lesssim \frac{1}{i^{2}},\quad \forall i>0\), one has

$$ \begin{aligned} {\|u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)\|}_{L^{2}_{\omega ( \xi ,t)}(\Omega )}\lesssim \sum _{j=\mathsf{M}+1}^{\infty} \frac{1}{j^{4}}+\sum _{i=4}^{\mathsf{M}}\sum _{j=\mathsf{M}+1}^{ \infty}\frac{1}{i^{4}\,j^{4}} +\sum _{i=\mathsf{M}+1}^{\infty} \frac{1}{i^{4}}+\sum _{i=\mathsf{M}+1}^{\infty}\sum _{j=4}^{\infty} \frac{1}{i^{4}\,j^{4}}. \end{aligned} $$
(86)

Using Lemma 6 together with the inequality

$$ \sum _{j=n+1}^{b}f(j)\leq \int _{x=n}^{b}f(\xi )\,d\xi , $$

where f is decreasing function, we get

$$ {\|u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)\|}_{L^{2}_{\omega (\xi ,t)}( \Omega )}\lesssim \frac{1}{\mathsf{M}^{3}}. $$

This completes the proof of Theorem 9. □

Theorem 10

The truncation error estimate can be estimated as

$$ |u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)|\lesssim \frac{1}{\mathsf{M}}. $$
(87)

Proof

First, we can write

$$\begin{aligned} |u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)|&\leq \left |\sum _{j= \mathsf{M}+1}^{\infty}(\,b_{0j}\,\bar{Z}_{0}(\xi )+b_{1j}\,\bar{Z}_{1}( \xi )+b_{2j}\,\bar{Z}_{2}(\xi )+b_{3j}\,\bar{Z}_{3}(\xi )\,)\,C_{j}(t) \right | \\ & +\left |\sum _{i=\mathsf{M}+1}^{\infty}(\,b_{i0}\,C_{0}(t)+b_{i1}\,C_{1}(t)+b_{i2} \,C_{2}(t)+b_{i3}\,C_{3}(t)\,)\,\bar{Z}_{i}(\xi )\right | \\ & +\left |\sum _{i=4}^{\mathsf{M}}\sum _{j=\mathsf{M}+1}^{\infty}b_{ij} \,\bar{Z}_{i}(\xi )\,C_{j}(t)\right |+\left |\sum _{i=\mathsf{M}+1}^{ \infty}\sum _{j=4}^{\infty}b_{ij}\,\bar{Z}_{i}(\xi )\,C_{j}(t)\right |. \end{aligned}$$
(88)

With the aid of Lemmas 4, 5, Theorem 8 and Eqs. (82), (83), the last equation becomes

$$ \begin{aligned} |u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)|\lesssim & \sum _{i= \mathsf{M}+1}^{\infty}\sum _{j=4}^{\infty} \frac{(i+3)\,(j+3)}{i^{3}\,j^{3}}+\sum _{j=\mathsf{M}+1}^{\infty} \frac{j+3}{j^{3}} \\ & +\sum _{i=4}^{\mathsf{M}}\sum _{j=\mathsf{M}+1}^{\infty} \frac{(i+3)\,(j+3)}{i^{3}\,j^{3}}+\sum _{i=\mathsf{M}+1}^{\infty} \frac{i+3}{i^{3}}. \\ & \end{aligned} $$
(89)

Now, noting the inequality:

$$ \frac{i+3}{i^{3}}< \frac{i+3}{i(i^{2}-1)},\quad \forall \ i>1, $$

we get

$$ \begin{aligned} &\sum _{i=\mathsf{M}+1}^{\infty } \frac{i+3}{i \left (i^{2}-1\right )}= \frac{\mathsf{M}+2}{\mathsf{M}^{2}+\mathsf{M}}< \frac{2}{\mathsf{M}}, \quad \forall \ \mathsf{M}>0, \\ & \sum _{i=4}^{\mathsf{M}} \frac{i+3}{i \left (i^{2}-1\right )}= \frac{1}{\mathsf{M}+1}-\frac{2}{\mathsf{M}}+\frac{5}{12}< 1, \\ & \sum _{i=4}^{\infty } \frac{i+3}{i \left (i^{2}-1\right )}= \frac{5}{12}< 1. \end{aligned} $$
(90)

Inserting Eqs. (90) into Eq. (89), we get

$$ |u(\xi ,t)-u_{\mathsf{M}}(\xi ,t)|\lesssim \frac{1}{\mathsf{M}}. $$

 □

Theorem 11

(Stability) Under the assumptions of Theorem 8, we have

$$ {\|u_{\mathsf{M}+1}(\xi ,t)-u_{\mathsf{M}}(\xi ,t)\|}_{L^{2}_{\omega ( \xi ,t)}(\Omega )}\lesssim \frac{1}{\mathsf{M}^{3}}. $$

Proof

We have

$$\begin{aligned} &{\|u_{\mathsf{M}+1}(\xi ,t)-u_{\mathsf{M}}(\xi ,t)\|}_{L^{2}_{ \omega (\xi ,t)}(\Omega )} \\ \begin{aligned} &\quad =\Biggl\| \displaystyle \sum _{i=0}^{\mathsf{M}} b_{i,\mathsf{M}+1}\,\bar{Z}_{i}( \xi )\,C_{\mathsf{M}+1}(t)\\ &\qquad{}+\displaystyle \sum _{j=0}^{\mathsf{M}} b_{\mathsf{M}+1,j} \,\bar{Z}_{\mathsf{M}+1}(\xi )\,C_{j}(t)+b_{\mathsf{M}+1,\mathsf{M}+1} \,\bar{Z}_{\mathsf{M}+1}(\xi )\,C_{\mathsf{M}+1}(t)\Biggr\| _{L^{2}_{ \omega (\xi ,t)}(\Omega )} \end{aligned} \\ &\quad \leq \displaystyle \sum _{i=0}^{\mathsf{M}} |b_{i,\mathsf{M}+1}|\,\sqrt{ \varrho _{i}}\,\sqrt{\varrho _{\mathsf{M}+1}}+\displaystyle \sum _{j=0}^{ \mathsf{M}} |b_{\mathsf{M}+1,j}|\,\sqrt{\varrho _{j}}\,\sqrt{\varrho _{ \mathsf{M}+1}}+|b_{\mathsf{M}+1,\mathsf{M}+1}|\,|\varrho _{\mathsf{M}+1}|. \end{aligned}$$
(91)

Now, with the aid of Theorem 8, Eqs. (82) and (83) and using similar steps to those followed in the proof of Theorem 9, we get the desired result. □

5 Illustrative examples

The following section presents three examples to ensure the validity and accuracy of our presented algorithm.

Example 1

Consider the following equation

$$ \partial _{t}^{\alpha}u(\xi ,t)-\partial _{\xi}^{2}u(\xi ,t)=12\, t^{4} \, \xi ^{2} \,\left ( \frac{2\, \xi ^{2}\, t^{-\alpha}}{\Gamma (5-\alpha )}-1\right ), $$
(92)

governed by

$$\begin{aligned} &u(\xi ,0)=0,\quad \forall \, \xi \in (-1,1), \end{aligned}$$
(93)
$$\begin{aligned} & u(-1,t)=u(1,t)=t^{4},\quad \forall \, t\in (0,1), \end{aligned}$$
(94)

with the exact solution: \(u(\xi ,t)=t^{4} \,\xi ^{4}\).

Figure 1 shows the absolute errors (AE) at different values of α at \(\mathsf{M}=4\). Table 1 shows the AE at \(\alpha =0.5\) and \(\mathsf{M}=4\). In addition, Table 2 shows the \(L_{\infty}\) and \(L_{2}\) errors for \(\alpha =0.6\) at \(\mathsf{M}=4\) and \(\mathsf{M}=5\). The approximation of the exact solution is seen to be close.

Figure 1
figure 1

The \(L_{\infty}\) error of Example 1

Table 1 AE of Example 1
Table 2 \(L_{\infty}\) and \(L_{2}\) errors of Example 1

Example 2

Consider the following equation

$$ \partial _{t}^{\alpha}u(\xi ,t)-\partial _{\xi}^{2}u(\xi ,t)=\xi ^{3} \, \alpha \, t^{1 -\alpha } E_{1,2-\alpha}(\alpha \, t)-6\, \xi \, e^{ \alpha t}, $$
(95)

governed by

$$\begin{aligned} &u(\xi ,0)=\xi ^{3},\quad \forall \, \xi \in (-1,1), \end{aligned}$$
(96)
$$\begin{aligned} & u(-1,t)=-e^{\alpha \, t}, \quad u(1,t)=e^{\alpha \, t},\quad \forall \, t \in (0,1), \end{aligned}$$
(97)

where \(E_{p,q}(t)\) is the Mittag–Leffler function and the exact solution of this problem is \(u(\xi ,t)=\xi ^{3}\, e^{\alpha \, t}\).

In Fig. 2, we plot the AE at different values of α when \(\mathsf{M}=18\). These figures show the fast reduction of AE at small values of M to achieve very high accuracy. Table 3 shows the \(L_{\infty}\) and \(L_{2}\) errors for \(\alpha =0.5\) at \(\mathsf{M}=18\) and \(\mathsf{M}=19\). These results show the accuracy of our method.

Figure 2
figure 2

AE of Example 2

Table 3 \(L_{\infty}\) and \(L_{2}\) errors of Example 2

Example 3

Consider the following equation

$$ \partial _{t}^{\alpha}u(\xi ,t)-\partial _{\xi}^{2}u(\xi ,t)=-2\, \sin (\pi \, t)+\frac{1}{2}\, \pi \, \xi ^{2}\, t^{1-\alpha }\, (E_{1,2- \alpha }(-i\, \pi \, t)+E_{1,2-\alpha }(i\, \pi \, t)), $$
(98)

governed by

$$\begin{aligned} &u(\xi ,0)=0,\quad \forall \, \xi \in (-1,1), \end{aligned}$$
(99)
$$\begin{aligned} & u(-1,t)=u(1,t)=\sin (\pi \, t),\quad \forall \, t\in (0,1), \end{aligned}$$
(100)

where \(E_{p,q}(t)\) is the Mittag–Leffler function, and the exact solution of this problem is \(u(\xi ,t)=\xi ^{2}\, \sin (\pi \, t)\).

In Fig. 3, we sketch the AE (left) and Approximate solution (right) for \(\alpha =0.5\) at \(\mathsf{M}=18\). In Tables 4 and 5, we list the \(L_{\infty}\) and \(L_{2}\) errors for different values of α at \(\mathsf{M}=18\). Table 6 presents the maximum AE at \(\alpha =0.3\) and different values of M. These findings demonstrate how closely the approximate solution approaches the exact solution.

Figure 3
figure 3

The AE (left) and Approximate solution (right) of Example 3

Table 4 \(L_{\infty}\) of Example 3
Table 5 \(L_{2}\) errors of Example 3
Table 6 The maximum AE of Example 3

Example 4

Consider the following equation [44]

$$ \begin{aligned} &\partial _{t}^{\alpha}u(\xi ,t)-\partial _{\xi}^{2}u(\xi ,t)\\ &\quad=\pi ^{2} \,\sin (\pi \, t) \sin (\pi \, \xi )+\frac{1}{2}\, \pi \, \sin (\pi \, \xi )\, t^{1-\alpha }\, (E_{1,2-\alpha }(-i\, \pi \, t)+E_{1,2- \alpha }(i\, \pi \, t)), \end{aligned}$$
(101)

governed by

$$\begin{aligned} &u(\xi ,0)=0,\quad \forall \, \xi \in (-1,1), \end{aligned}$$
(102)
$$\begin{aligned} & u(-1,t)=u(1,t)=0,\quad \forall \, t\in (0,1), \end{aligned}$$
(103)

where \(E_{p,q}(t)\) is the Mittag–Leffler function and the exact solution of this problem is \(u(\xi ,t)=\sin (\pi \, \xi )\, \sin (\pi \, t)\).

Table 7 shows a comparison of the best \(L_{2}\) errors between our at \(\mathsf{M}=18\) method and method in [44] at \(M=11,\,N=15\) when \(\alpha =0.9\). Moreover, Fig. 4, illustrates the AE (left) and approximate solution (right) for \(\alpha =0.1\) at \(\mathsf{M}=18\). Table 8 presents the maximum AE for \(\alpha =0.3\) and different values of M. These results prove that the approximate solution is very close to the exact solution.

Figure 4
figure 4

The AE (left) and Approximate solution (right) of Example 4

Table 7 Comparison of the best \(L_{2}\) errors of Example 4
Table 8 The maximum AE of Example 4

Remark 3

In light of Figs. 14, we can conclude the following benefit:

Excellently precise approximations can be obtained by selecting modified sets of seventh-kind CPs as basis functions and taking specific terms of the retained modes.

6 Concluding remarks

In conclusion, our study introduces a novel application of the spectral tau methodology tailored to tackle the TFDE by leveraging seventh-kind CPs as basis functions. The choice of CPs stems from their rapid convergence, numerical stability, and orthogonality properties, allowing for constructing a robust basis expansion explicitly designed for solving TFDE. Through a comprehensive error analysis and numerical validation, we have demonstrated our proposed method’s efficacy and computational prowess in accurately capturing the complex dynamics of TFDE solutions. Moving forward, our work opens avenues for further exploration and refinement of spectral techniques for solving TFDE, offering a promising approach with diverse applications across scientific and engineering domains. Continued efforts in advancing numerical methods and innovative algorithmic developments can significantly enhance our understanding and computational capabilities in modeling complex dynamical systems governed by fractional differential equations.