*3.2. Approximation in Space Direction*

We apply the collocation method to approximate the spatial domain of Equation (1) with Jacobi polynomials. We consider the approximate solution *<sup>v</sup>*<sup>N</sup> (*x*, *<sup>t</sup>*) of the form,

$$w\_{\mathcal{N}}(\mathbf{x},t) = \sum\_{s\_1=0}^{\mathcal{N}} c\_{s\_1}(t) \mathcal{J}\_{s\_1}^{a,\beta}(\mathbf{x}).\tag{22}$$

From Equations (22) and (1), we obtain

$$\*\mathcal{D}\_t^\gamma v\_N(\mathbf{x}, t) = \frac{\partial^2 v\_N(\mathbf{x}, t)}{\partial \mathbf{x}^2} + \mathcal{g}(\mathbf{x}, t), \ t \in [0, \pi], \tag{23}$$

with the initial and boundary conditions of Equation (1),

$$w\_{\mathcal{N}}(\mathbf{x}\_0, t) = \sum\_{s\_1=0}^{\mathcal{N}} c\_{s\_1}(t) \mathcal{J}\_{s\_1}^{\alpha, \beta}(\mathbf{x}\_0), \tag{24}$$

$$w\_{\mathcal{N}}(\mathbf{x}\_{\mathcal{N}}, t) = \sum\_{s\_1=0}^{\mathcal{N}} c\_{s\_1}(t) \mathcal{I}\_{s\_1}^{a, \emptyset}(\mathbf{x}\_{\mathcal{N}}).\tag{25}$$

From Equations (1), (19), and (22), we have the semi-discretized scheme as follows

$$\sum\_{s\_1=0}^{N} \left[ \frac{[w(t\_r)]^{-1}}{\Gamma(2-\gamma)} \sum\_{l=1}^{r} q\_l [w(t\_l)c\_{s\_1}(t\_l) - w(t\_{l-1})c\_{s\_1}(t\_{l-1})] \right] \mathcal{J}\_{s\_1}^{a, \emptyset}(\mathbf{x})$$

$$= \sum\_{s\_1=0}^{N} c\_{s\_1}(t\_r) \frac{\Gamma(a+\beta+s\_1+3)}{\Gamma(a+\beta+s\_1+1)} \mathcal{J}\_{s\_1-2}^{(a+2, \emptyset+2)}(\mathbf{x})$$

$$+ \mathcal{R}\_r + \mathcal{R}\_s + g(\mathbf{x}, t\_r), \ r = 1, 2, \dots, \mathcal{M}, \tag{26}$$

where R*<sup>s</sup>* denotes the error term in the space direction arising due to replacing *v*(*x*, *t*) with *<sup>v</sup>*<sup>N</sup> (*x*, *<sup>t</sup>*).

Neglecting the error part, we obtain the fully discretized scheme of Equation (1) by the collocation method [32,33]. We choose the collocation points such that the stability is unchanged. So, we choose the collocation point of the form *xi*, *i* = 1, 2, ... N − 1, which are the roots of the *n*th degree Jacobi polynomials, and *x*0, *x*<sup>N</sup> are the boundary conditions. Thus, for (*xi*, *tr*) ∈ (0, 1) × [0, *τ*], *i* = 1, . . . , N ; *r* = 1, . . .M, it holds that

$$\begin{split} &\sum\_{s\_1=0}^{N} \left[ \frac{[w(t\_r)]^{-1}}{\Gamma(2-\gamma)} \sum\_{l=1}^{r} q\_l [w(t\_l) c\_{s\_1}(t\_l) \mathcal{J}\_{s\_1}^{a,\beta}(\mathbf{x}\_i) - w(t\_{l-1}) c\_{s\_1}(t\_{l-1}) \mathcal{J}\_{s\_1}^{a,\beta}(\mathbf{x}\_i)] \right] \\ &= \sum\_{s\_1=0}^{N} c\_{s\_1}(t\_r) \frac{\Gamma(a+\beta+s\_1+3)}{\Gamma(a+\beta+s\_1+1)} \mathcal{J}\_{s\_1-2}^{(a+2,\beta+2)}(\mathbf{x}\_i) + \mathcal{g}(\mathbf{x}\_i, t\_r), \ r = 1, 2, \dots, \mathcal{M}, \end{split} \tag{27}$$

and the initial and boundary conditions become

$$\begin{cases} \boldsymbol{v}\_{\mathcal{N}}(\mathbf{x}\_{i},0) = \sum\_{s=0}^{\mathcal{N}} \boldsymbol{c}\_{s\_{1}}(0) \mathcal{J}\_{s\_{1}}^{a,\emptyset}(\mathbf{x}\_{i}) = \boldsymbol{\eta}\_{1}(\mathbf{x}\_{i}),\\ \boldsymbol{v}\_{\mathcal{N}}(\mathbf{x}\_{0\prime},t\_{r}) = \sum\_{s\_{1}=0}^{\mathcal{N}} \boldsymbol{c}\_{s\_{1}}(t\_{r}) \mathcal{J}\_{s\_{1}}^{a,\emptyset}(\mathbf{x}\_{0}) = \boldsymbol{\eta}\_{2}(t\_{r}),\\ \boldsymbol{v}\_{\mathcal{N}}(\mathbf{x}\_{\mathcal{N}},t\_{r}) = \sum\_{s\_{1}=0}^{\mathcal{N}} \boldsymbol{c}\_{s\_{1}}(t\_{r}) \mathcal{J}\_{s\_{1}}^{a,\emptyset}(\mathbf{x}\_{\mathcal{N}}) = \boldsymbol{\eta}\_{3}(t\_{r}). \end{cases} \tag{28}$$

In this way, from Equations (27)–(28) we have a system of (N + 1) linear difference equations in unknown coefficients *cs*<sup>1</sup> , *s*<sup>1</sup> = 0, 1, 2 ... N . We can find the value of the unknown coefficients by solving the system of linear equations using any standard method. Hence, the approximate solution can be found from Equation (22).
