Differential equations with fractional order derivatives represent a powerful mathematical tool for exact and realistic description of physical and chemical processes for which it is needed to take into consideration the background (memory) of the process [1, 2, 3, 4]. The patterns which take memory into consideration in such equations are the memory functions that are the kernels of integrals defining the operators of fractional integro-differentiation. For fractional integro-differentiation operators, the memory functions are namely power functions. The exponent of the power function of memory defines the order of the derivative and is connected with the fractal dimension of the environment in which the described process takes place. For more accurate description of the process in heterogeneous porous media, differential equations with fractional derivatives of distributed order are often used too. Processes of the memory can be described with the help of the memory function which has more complex structure than the power function.
In the rectangle we consider the Dirichlet boundary value problem for time fractional diffusion equation with generalized memory kernel and variable coefficients
is the generalized Caputo fractional derivative of order , with weighting function , where , for all ; , for all .
Diffusion and Fokker-Planck-Smoluchowski equations which have a generalized memory kernel were investigated in . In this work it is demonstrated that the memory kernel appearing in the generalized diffusion equation has diverse potential forms which can describe a broad range of experimental phenomena.
With the help of the energy inequality method, a priori estimates for the solution of both differential and difference problems of the Dirichlet and Robin boundary value problems for the fractional, variable and distributed order diffusion equation with Caputo fractional derivative were derived in [6, 7, 8, 9, 10, 11, 12, 13]. A priori estimates for the difference problems analyzed in  by means of the maximum principle imply the stability and convergence of these difference schemes.
In this work, to construct difference schemes with the order of accuracy in time we have to demand the existence of a sufficiently smooth solution of the original problem. It brings on a significant narrowing of the input data class of the problem for which we apply the proposed method. As it is well known (see for example [15, 16]), in the case of smooth input data for a time-fractional diffusion equation, the solutions are not necessarily smooth in a closed domain, because the derivatives of the function with respect to might possess a singularity at . In such cases, if possible, we present the solution as the sum of two functions: one of which is known but not smooth, whereas the other is smooth but not known, as it is illustrated in work .
In work , we consider a reaction-diffusion problem with a Caputo time derivative of the order . It is shown that the solution of such a problem has in general a weak singularity near the initial time , and we derive sharp pointwise bounds on certain derivatives of this solution. We have given a new analysis of a standard finite difference method for the problem, taking into account this initial singularity.
In , we study an analysis of the L1 scheme for the subdiffusion equation with nonsmooth data. In , error estimates for approximations of distributed order time fractional diffusion equation with nonsmooth data were investigated.
In the current paper, a difference analog of the Caputo fractional derivative with generalized memory kernel (L2-1 formula) is built up. The essential features of this difference operator are investigated and on its ground some difference schemes generating approximations of the second and fourth order in space and the second order in time for the generalized time-fractional diffusion equation with variable coefficients are studied. Stability of the suggested schemes as well as their convergence in the grid - norm with the rate equal to the order of the approximation error are proven. The achieved results are supported by the numerical computations performed for some test problems.
2 Stability and convergence of the family of difference schemes
In this section, we consider some families of difference schemes in a general form, set on a non-uniform time grid. A criterion of the stability of the difference schemes in the grid - norm is worked out. The convergence of solutions of the difference schemes to the solution of the corresponding differential problem with the rate equal to the order of the approximation error is proven.
In the rectangle we assign the grid , where , .
is a difference analog of the generalized Caputo fractional derivative of the order with weighting function (, , ), is a difference operator which approximates the continuous operator , such that the operator preserves its positive definiteness:
, , at .
 If , then for any function defined on the grid the following inequalities hold true
 If and , where , , then for any function defined on the grid we have the inequality
 If the conditions of Theorem (2.1) are fulfilled and difference scheme (3)–(4) has the approximation order , where and are some known positive numbers, then the solution of difference scheme (3)–(4) converges to the solution of differential problem (1)–(2) in the grid - norm with the rate equal to the order of the approximation error .
3 A second order numerical differentiation formula for the generalized Caputo fractional derivative
In this section, we construct a difference analog of the Caputo fractional derivative with the approximation order and investigate its essential properties.
Next we consider the uniform grid . Let us find the discrete analog of the at the fixed point , , where , . For all and (, ) the following equalities hold true
Let us consider the below fractional numerical differentiation formula for the generalized Caputo fractional derivative of order with weighting function ()
We call (10) the L2-1 - formula for the generalized Caputo fractional derivative.
For any and , it is true that
where , and .
Proof. We have .
Estimate the errors , , , and :