1. Introduction
When solving various engineering and scientific problems, we fail to deal with the necessity to calculate double integrals with variable integration limits. Thus, the analytical solution for the problem of migration of contaminants with a solving in multilayered water filters can be obtained only in integral form. Then, the resulting solution must be integrated once again to determine the concentration of particles absorbed on the filter skeleton over a certain time interval. In this case, the time variable which is in the upper limit of the external integral should not be considered as a parameter, because to establish the optimal regimes of operation of industrial filters still need to solve numerically the functional equation containing this double integral over a time interval of unknown length [
1,
2,
3,
4].
Similar problems arise for
determining the amount of radioactive contamination that gets groundwater during radiation pollution of the soil,
the quantity of heat that a multiphase porous body can lose or get,
determining the loss of alloying doping impurities of reinforced material during intensive exploitation of the object in conditions of the aggressive external environment, etc. [
5,
6,
7].
Therefore, it is necessary to develop numerical methods for integrating double integrals with variable limits and an intricate integrand.
In the literature (for example, [
8,
9,
10]) methods of double integration have been developed, but within definite limits.
The first method explicitly devised for multiple integrals was published in 1877 in a paper by James Clerk Maxwell [
11] proposed the formulas for the rectangle and the rectangular parallelopipedon [
12]. After the 1950s, several new methods were devised, which have begun to make the numerical evaluation of multiple integrals available as a working tool for scientists and engineers [
13]. Krylov, V. I. and I. P. Mysovskikh made a significant contribution to the theory of approximate calculation of integrals [
14,
15]. General overviews to the problems of numerical approximation of multiple integrals are contained in [
13,
16]. Encyclopedic work on multiple numerical integrations was published by Arthur H. Stroud [
17]. Cubature formulas have been developed for different regions of integration, namely cubature formulas for the cube [
17,
18], for triangle [
18,
19], for the sphere [
20], for the space with weight function
[
16,
21], for the space with weight function
[
16,
22] and for the simplex [
23,
24]. In addition, we can mention the class of Monte Carlo methods, which has been extended by S. M. Ulam and John von Neumann [
25,
26]. Monte Carlo methods are constructed on a fundamentally different basis. They use random sampling to obtain numerical results, but an aleatory generation of points makes the problem more dependent on luck, increasing the chance of obtaining uncertainties in the results [
27,
28,
29].
As concerns double and multiple integrals, numerical integration methods are developed to calculate the definite integrals and the integrals with definite limits in the external integration [
1] and solve Volterra’s integral equations [
30], i.e., the regions of integration are constant or fixed. In the work [
19], it collects together theoretical results in the area of numerical cubature over triangles. The theory relating to regular integrands and the corresponding theory of singular integrands are considered here. The existence of cubature formulas for planar regions was shown by A. H. Stroud, which used m
2 points with polynomial precision 2 m
−1 [
30,
31]. Thus, in [
32], sufficient conditions are formulated for the existence of cubature formulas using fewer than m
2 of points with the same polynomial accuracy.
As a rule, only elements that are fully within the scope of the integration region are taken into account, while others are rejected. As a result, the problem of assurance of the accuracy of the calculations, because to increase the accuracy it is proposed increasing the number of elements of the division, i.e., compressing the grid, and in turn for complex and intricate integrands, this leads to a significant accumulation of computational error.
Approximations of the double integral
are obtained under the assumption that the partial derivatives of the integrand belong to the Lebesgue space
for certain
[
33]. In this case, it is not enough to satisfy the condition that integrand
is a simple integrated function. So it is necessary to impose additional restrictions: if the integrand is real in the domain
then the formulas for numerical integration of the double integral exist under the assumption that the mixed partial derivative
belongs to one of the Lebesgue spaces
for some
(if
, then
is a continuously differentiable function of both variables). Thus, it is assumed that the norm
is limited. Moreover, the integration error can be estimated in the terms of the norm
[
33].
In the case of double integral with variable limits, it is not possible to estimate the calculation error by classical methods. Moreover, the variable limits of the integral
are functions of independent variables τ,
that leads to variableness of the integration region.
We suppose that integral (1), functions
f(τ′, τ″, τ),
and
satisfy necessary restrictions (in particular, functions
,
are continuous functions of their arguments). Without loss of generality, we can accept that
and
, because, if the inverse functions
and
exist, then using change of variables
and
the integral (1) can be reduced to the form
Note that zero values of the lower limits of integration can be obtained using the additive property of an integral.
3. Error of Numerical Integration
We find the error of numerical integration by the Taylor formula [
34,
35].
The main term of the error is [
36,
37].
where
is the area of the region of integration,
is the central point of the region of integration.
We choose the central point of the integration region
in the vicinity of which we expand the function
into the Taylor series
Note that the function
F(τ, τ′, τ″) can be expanded into a Taylor series if in some vicinity of the point
its continuous partial derivatives exist up to
order [
38].
Let
f(τ, τ′, τ″) be continuous in the domain
. Then it is integrated into this domain, as well as integrated into any subdomain of
[
38]. Then
F(τ, τ′, τ″) is continuous in the domain
. If
f(τ, τ′, τ″) is continuous in the domain
then
F(τ, τ′, τ″) is differentiable in the domain
[
38].
Taking into consideration that
F(τ, τ′, τ″) is the double integral with variable upper limits, we obtain (by the analogy of double integration in cubatures)
Here we have used Barrow’s theorem [
38]
Note that as distinct from double integrating within the definite limits, the first derivatives do not disappear and must be taken into account. We include them in error.
We will write down separately the errors for triangular and square elements. The integration error (18) for each triangular element takes the form
The error of integration (18) for each square element is
Here and are areas of the ith triangular element and the ijth square element accordingly.
Summing the expressions (19) and (20) for the region in which the integral is defined, we obtain the error of our method
or
Since higher degrees of h(τ) are rejected in the estimates (19) and (20), the relation for the error (21) is asymptotic, and it is satisfied at h(τ)→0 with an accuracy to the terms of a higher order of smallness than h(τ).
If we impose the definite limits of integration, the obtained Formula (21) is reduced to the classical formula for the error by the expansion of an integrand into the Taylor series and estimation of the error of the method takes the form .
4. Examples of Numerical Integration for the Double Integral with Variable Upper Limits
To test the efficiency and reliability of the obtained formulas of the numerical method, we apply it to the integration of sufficiently simple functions for which the integration expression can be found analytically.
I. Let such an integrand be given
f(τ′, τ″) = τ′τ″. The surface formed by the function
f(τ′, τ″) over the integration region is shown in
Figure 6.
Then we calculate the integral by Formulas (15)–(17) depending on the number of division elements changes and the grid width and analytically, namely .
The results of calculations are shown in
Table 1,
Table 2,
Table 3 and
Table 4 for different numbers of triangular elements
n(τ) and grid width
h(τ). It is given the values of the total volumes of square
and triangular
elements, the difference between the analytical and numerical calculation |
Ianalyt −
Inum|, as well as the relative error
E(τ)= |
Ianalyt −
Inum/
Ianalyt| [
39,
40]. We choose such basic values of parameters
n(1) = 10
4,
h(1) = 10
−4.
Table 1 shows the corresponding values for the case when only the size of the imposed grid
h(τ) changes with the change of τ, (A). The calculated values for the case when only the number of division elements
changes. With the change of τ, (B) are presented in
Table 2. In
Table 3 and
Table 4 it is shown the corresponding values of integration parameters for the case when with the change of τ, both the size of the grid and the number of division elements change (C). The change in the number of nodes in
Table 3 is described by the increasing function
, then
. The change in the number of nodes in
Table 4 is described by the decreasing function
, and then
.
Figure 7 demonstrates comparative graphs of absolute and relative errors in numerical integration by Formula (15) of the case of A, (16) of the case of B, (17) of the cases of C1 for increasing function
n(τ) and C2 for decreasing
n(τ).
Note that the values closest to the analytical values of the integral are obtained in the case of the constant width of the grid and of increase in the number of partition elements together with an increase in the integration (
Figure 7a,b). The results calculated by the Formula (17) at the imposition of the increasing function of nodes quantity
n(τ) (case C1,
Figure 7) show that the values of absolute and relative errors are quite acceptable. However, in this case, the number of operations is smaller than in the case of B. Note that only one case C2, i.e., imposition of the decreasing function of the number of nodes
n(τ), leads to a sharp increase in absolute and relative errors with increasing τ and can go beyond a given accuracy of calculations (
Figure 7,
Table 4). In the cases of A, B, and C1 the difference between the analytical and numerical calculations of |
Ianalyt −
Inum| is within the acceptable deviation.
In this case, at a denser grid overlaid on the variable region of integration both absolute and relative errors decrease. In particular, the difference |
Ianalyt −
Inum| decreases by two orders of magnitude when
n increases by an order (
Table 1,
Table 2,
Table 3 and
Table 4).
II. Consider next integrand
f(τ′, τ″) =
eτ′τ″ for the same values of τ. The surface formed by the function
f(τ′, τ″) over the integration region is shown in
Figure 8.
We also calculate the integral by Formulas (15)–(17). The analytical expression has been found in the form .
The results of calculations are presented in
Table 5,
Table 6,
Table 7 and
Table 8 for different numbers of triangular elements
n(τ) and grid width
h(τ).
Table 5 shows the corresponding values for the case when only the size of the imposed grid
h(τ) changes with the change of τ, (A). The calculated values for the case when only the number of division elements
changes with the change of τ, (B) are presented in
Table 6. In
Table 7 and
Table 8 it is shown the values of integration parameters for the case when with the change of τ, both the size of the grid and the number of division elements change (C), namely for
,
and
,
correspondingly.
Figure 9 demonstrates comparative graphs of absolute (
Figure 9a) and relative (
Figure 9b) errors in numerical integration
by Formula (15) of the case of A, (16) of the case of B, (17) of the cases of C1 for increasing function
n(τ) and C2 for decreasing
n(τ).
When the integrand contains an exponential function, the sharp increase in the integrand has almost no effect on the value of both absolute and relative errors for numerical calculation of the integral by Formulas (16) and (17) under the increasing function of the number of nodes, i.e., case C1 (
Figure 9,
Table 6 and
Table 7).
For this integral, the difference between the analytical and numerical calculation |
Ianalyt −
Inum| is also within the acceptable deviation for the cases of A, B, and C1. However, as distinct from the previous case I, the magnitude of this difference is an order larger. So, for the case of B and
,
, but
(
Table 2 and
Table 6). Herewith, when increasing
n by an order of magnitude, the relative error decreases by two orders.
III. Now we consider the integrand
f(τ′, τ″) = sin(τ′)sin(τ″) for the same values of τ. The surface formed by the function
f(τ′, τ″) over the integration region is shown in
Figure 10.
The integral is also calculated by Formulas (15)–(17). The analytical expression has been found in the form .
The results of calculations are presented in
Table 9,
Table 10,
Table 11 and
Table 12 for different numbers of triangular elements
n(τ) and grid width
h(τ).
Table 9 shows the corresponding values for the case when only the size of the imposed grid
h(τ) changes with the change of τ, (A). The calculated values for the case when only the number of division elements
changes with the change of τ, (B) are presented in
Table 10. In
Table 11 and
Table 12 it is shown the values of integration parameters for the case when with the change of τ, both the size of the grid and the number of division elements change (C), namely for
,
and
,
correspondingly.
Figure 11 demonstrates comparative graphs of absolute (
Figure 11a) and relative (
Figure 11b) errors in numerical integration
by Formula (15) of the case of A, (16) of the case of B, (17) of the cases of C1 for increasing function
n(τ) and C2 for decreasing
n(τ).
Note that for the periodic integrand, the closest to the analytical value of the integral is obtained in the case of the constant width of the grid and in the case of an increase in the number of partition elements together with an increase in the integration region (
Figure 11a,b). Here the results for the absolute and relative error calculated by the Formula (17) for the imposition of the increasing function of the number of nodes
n(τ), case C1 (
Figure 11) are quite acceptable. For this integrand, the integration results obtained by Formulas (15)–(17) with increasing τ remain within the given accuracy of calculations (
Figure 11,
Table 9,
Table 10,
Table 11 and
Table 12).
In this case, the difference between the analytical and numerical calculation |Ianalit − Inum| is of the same order as for the integrand . When increasing n by an order of magnitude, the value of E(τ) also decreases by two orders of magnitude.
Note that for all three considered integrands, no significant accumulation of machine error was observed.
If we apply the proposed method to calculate the double integral with a given external limit of integration, the result is the same (within accuracy) as the value of the same integral, calculated by Maple. For example, according to the calculations in the Maple integral
, in our case
(the fifth line from the top in
Table 1); integral
, in our case
(the fifth line from the top in
Table 5); integral
, in our case
(the fifth line from the top in
Table 9) under
.
The CPU time of the program module was calculated by the algorithm in [
41]. It was determined that the times of program execution for calculation of integral
were from 2.2189994808 s at
and to 215.3279999737 s at
; of integral
were from 4.7030001646 s at
and to 463.6879999191 s at
; of integral
were from 6.4680001466 s at
and to 635.4220004054 s at
.
5. Application of the Method to Calculating the Double Integral with Variable Upper Limits Depending on One External Variable
We use the proposed method to calculate double integrals with variable upper limits, which are functions of the external variable τ but do not depend on the integration variables. This kind of integrals is in some sense a partial case of the above integrals with due regard that there is no variable limit
in the region of integration (
Figure 3). At the same time, the integration region in
is variable.
Taking into account that in all considered examples of the application of the method in chapter 4, the lowest values of absolute and relative errors are achieved in the case of increasing the number of variable elements of division and fixing the grid cell size, i.e., Case B, here we consider only this case of constructing a variable grid.
Divide the integration region
into cells by a rectangular grid that contains
elements of the same length
along the axis
and
elements of the same length
along the axis
. Then in the case of B, the cubature formula with weight function
(16) is modified into the form
where
;
.
We obtain the estimation of the error of the method for this case from Formula (21) taking into account the rectangular grid of division of the integration region and the notation introduced here. So, in the general case, we have
or
If the lengths of the sides of rectangular cells are constant (fixed), then we obtain the estimation of the method error in the classical form of the error of the cells method [
42].
Consider the typical cases of the kind of function g(τ).
In this case, the integration region is a square that enlarges equally along both coordinate axes in proportion to the growth τ (
Figure 12).
Here we accept
, that is we impose a square grid. Then Formula (22) is simplified to the form
The application of this formula is implemented for the simple integrand
. The results of the calculations are shown in
Table 13.
In this case, the integration region is a rectangle that enlarges with growth τ. If
α > 1 then the side length of this rectangle along the axis Oτ″ is always
α times greater than the side length along the axis Oτ′. Then with increasing τ, the region of integration increases in two coordinates, but with a greater rate along the axis Oτ″ (
Figure 13).
If
α < 1 then the side length of this rectangle along the axis Oτ″ is always
α times less than the side length along the axis Oτ′. Then with increasing τ, the region of integration increases in two coordinates, but with a greater rate along the axis Oτ′ (
Figure 14).
When applying this method here and hereafter, under constructing a grid, it is not necessary to take into account the type of function g(τ), i.e., a rectangular grid can be overlayed in different combinations. We will abide by the structure of the function g(τ) when constructing the grid.
Let
n(τ) =
αm(τ). Then Formula (22) is modified to the form
The application of this formula is implemented to calculate the integral
. The results of the calculations are shown in
Table 14 for
α > 1 and in
Table 15 for
α < 1.
In this case, the integration region is also a rectangle that increases with growth τ. Moreover, the growth rate for this region along the axis Oτ″ is much greater than along the axis Oτ′ and the difference between them increases with the increase of τ (
Figure 15).
Let
n(τ) = (
m(τ))
2 under constructing the variable grid. Then the Formula (22) takes the form
The application of this formula is implemented to the calculation of the integral
(
Table 16).
In this case, the integration region is also a rectangle that changes with growth τ. The integration region increases proportionally along the axis Oτ′ and decreases along the axis Oτ″ (
Figure 16).
If at constructing the grid we choose a variable number of elements according to the type of function g(τ), i.e., for this case n(τ) = τm(τ), then with increasing τ the number of elements increases along the axis Oτ′, and decreases along the axis Oτ″ according to the change of the integration region. Then at each step, an additional check of the condition m(τ) ≥ 1 (or n(τ)/τ ≥ 1) is required, as there must be at least one grid element along the axis Oτ″.
For this case, we carry out the calculation of integrals by the formula
Its application was realized for the calculation of the integral
(
Table 17).
In our opinion, for this case of the type of function g(τ) it is advisable to choose the construction of the grid in the case C1 with the correct (appropriate) choice of function m(τ) and step hm(τ).
If the function g(τ) is periodic (for example g(τ) = sin(τ)), then the region of integration is variable and rectangular. At the intervals of this function increasing, the integration region increases along the axis Oτ″, and at the intervals of decrease, it decreases along the axis Oτ″, respectively. That is, the increasing and decreasing of the integration region have cyclical (periodic) nature. Then the variable integration grid must be chosen by the case C1 with the choice of suitable periodic functions as m(τ) and hm(τ).
6. Conclusions and Perspectives
All obtained results are new. The numerical method for calculating doubles integrals with variable upper limits was developed. It can be divided into several stages as determining the variable region of integration; overlaying the square or rectangular grid on the integration region; separating the integration subregions consisting of square and triangular elements; applying the cubatures in the subregion with square elements; triangulation partition along variable boundary; calculating the volumes of elementary elements with triangular basis, calculating the reference integral and establishing the calculation error.
The variable region of integration leads to the necessity to change the grid of its division into elementary volumes. The variable of the upper limit of the external integral has a significant effect. Here we consider three cases of a possible change of the grid, namely when this variable changes, we change only the size of the imposed grid and fix the number of partition elements; only the number of division elements changes, and the grid size is fixed, as well as both the number of division elements and the grid size change under fixing their multiplication. In the latter case, we considered an assignment of increasing and decreasing functions describing the change in the number of integration nodes on specific examples. In all considered examples of the application of the proposed method the smallest values of absolute and relative errors are reached for the case of an increase of the number of division elements changes and the grid size is fixed. At the same time, the question remains whether the choice of the function of the number of integration nodes, which increases much more sharply, will give rise to descent the error of the method. Additionally, note that the imposition of a variable grid on the integration region, if necessary, can be applied to definite double integrals.
When finding the estimate of the error of the method, we expanded the integral itself into a Taylor series using Barrow’s theorem. If we impose the definite limits of integration, the obtained formula will be reduced to the classical formula for expanding an integrand into the Taylor series. It is also necessary to carry out an individual investigation on the influence of setting variables of the number of elements of the division of the integration region and the size of the grid on the error estimate.
In this paper, we have considered the case when a double integral with variable limits can be reduced to an integral with simple variables in the upper limits of integration and zero lower limits. However, the proposed changes of variables are not always appropriate. Therefore, further research is needed on numerical integration, which limits functions, including the establishment of conditions and constraints on these functions, the integrand, and the variable region of integration that will be formed.