1 Introduction

In this paper, we study numerical quadrature rules for the evaluation of integrals of the form

$$\begin{aligned} \int _{\Gamma } f(x) \,\mathrm {d}{\mu }(x), \end{aligned}$$
(1)

and

$$\begin{aligned} \int _{\Gamma }\int _{\Gamma '} f(x,y) \,\mathrm {d}{\mu '}(y)\mathrm {d}{\mu }(x), \end{aligned}$$
(2)

where \(\Gamma\) and \(\Gamma '\) are compact fractal subsets of \(\mathbb {R}^n\)—more precisely, the attractors of iterated function systems (IFSs) satisfying the open set condition (OSC) (see Section 2.2)—and \(\mu\) and \(\mu '\) are “invariant” (also known as “balanced” or “self-similar”) measures on \(\Gamma\) and \(\Gamma '\) respectively (see Section 2.5). A special case is where \(\mu =\mathcal {H}^d|_\Gamma\) and \(\mu '=\mathcal {H}^{d'}|_{\Gamma '}\), where \(\mathcal {H}^{d}\) and \(\mathcal {H}^{d'}\) are Hausdorff measures, with d and \(d'\) denoting the Hausdorff dimensions of \(\Gamma\) and \(\Gamma '\) (see Section 2.1), and \(|_\Gamma\) denotes the restriction to \(\Gamma\) in the sense that \(\mathcal {H}^d|_\Gamma (A):=\mathcal {H}^d(\Gamma \cap A)\) for \(A\subset \mathbb {R}^n\). Our particular interest is in singular integrals, where, in the case of (1), f is singular at some point \(\eta \in \Gamma\), and, in the case of (2), f is singular on \(x=y\).

One context in which such integrals arise is in the discretization of certain boundary integral equation and volume integral equation formulations of boundary value problems for elliptic PDEs (such as the Laplace or Helmholtz equation) posed on domains with fractal boundary, for instance in the scattering of electromagnetic and acoustic waves by fractal obstacles [11, 12], applications of which include antenna design in electrical engineering [35, 38] and the quantification of the scattering effect of atmospheric ice crystals in climate modelling [37]. Our main motivating example is the “Hausdorff boundary element method (BEM)” introduced in [9] for the solution of time-harmonic acoustic scattering in \(\mathbb {R}^{n+1}\) (\(n=1,2\)) by a sound-soft fractal screen \(\Gamma _\mathrm{screen}\subset \mathbb {R}^n\times \{0\}\), assumed to be the attractor of an IFS satisfying the OSC. The BEM proposed in [9] discretizes the associated single-layer boundary integral equation on \(\Gamma _\mathrm{screen}\) using an approximation space consisting of products of the relevant Hausdorff measure with piecewise-constant functions on a “mesh” of \(\Gamma _\mathrm{screen}\) comprising self-similar fractal “elements”, which are subsets of \(\Gamma _\mathrm{screen}\) obtained as scaled, rotated and translated copies of \(\Gamma _\mathrm{screen}\) via the IFS structure. The entries of the right-hand side vector in the Galerkin BEM system then involve integrals of the form (1) (with \(\mu =\mathcal {H}^d|_\Gamma\)), where \(\Gamma\) is an element of the mesh and f(x) depends on the incident wave. The Galerkin BEM system matrix entries involve integrals of the form (2) (with \(\mu =\mathcal {H}^d|_\Gamma\) and \(\mu '=\mathcal {H}^{d'}|_{\Gamma '}\)), where \(\Gamma\) and \(\Gamma '\) are elements of the mesh and \(f(x,y)=\Phi (x,y)\), where \(\Phi (x,y)\) is the fundamental solution of the Helmholtz equation in \(\mathbb {R}^{n+1}\), viz.

$$\begin{aligned} \Phi (x,y) = {\left\{ \begin{array}{ll} \frac{\mathrm {i}}{4} H_0^{(1)}(k|x-y|),&{} n=1,\\ \dfrac{\mathrm {e}^{\mathrm {i}k |x-y|}}{4\pi |x-y|}, &{} n=2, \end{array}\right. } \qquad x\ne y, \end{aligned}$$
(3)

where \(k>0\) is the wavenumber and \(H_\nu ^{(1)}\) denotes the Hankel function of the first kind of order \(\nu\). This choice of f(xy) makes (2) singular when \(\Gamma =\Gamma '\). Although not studied in [9], one could also consider a collocation (as opposed to Galerkin) method for the same integral equation and approximation space, in which case the collocation matrix entries would involve integrals of the form (1) (with \(\mu =\mathcal {H}^d|_\Gamma\)), where \(\Gamma\) is an element of the mesh and \(f(x)=\Phi (x,\eta )\), with \(\eta\) denoting a collocation point, giving a singular integral when \(\eta \in \Gamma\). A key goal of the current paper is to present a detailed derivation and rigorous error analysis of the quadrature rules used in the implementation of the Hausdorff BEM in [9]. But we expect that the techniques we present will be of wider interest, since they apply to general invariant measures, to general regular integrands, and to a quite general class of singular integrands with logarithmic or algebraic singularities.

Our quadrature rules for (1) and (2) are based on decomposing integrals over \(\Gamma\) into sums of integrals over suitable partitions of \(\Gamma\) into self-similar subsets, generated using the IFS structure, in the same way that the Hausdorff BEM meshes are constructed in [9]. After reviewing some preliminaries in Section 2, we start in Section 3 by considering regular integrands. Applying a one-point quadrature rule on each subset leads to a composite quadrature rule, which, when the quadrature nodes are chosen as the barycentres (with respect to \(\mu\) or \(\mu '\)) of the subsets, can achieve second-order convergence with respect to the maximum diameter of the subsets (Theorems 3.6 and 3.7). In Section 4, we then consider a special class of singular integrands, indexed by \(t\ge 0\), namely \(f(x)=\Phi _t(x,\eta )\) (in the case of (1)), and \(f(x,y)=\Phi _t(x,y)\) with \(\Gamma '=\Gamma\) (in the case of (2)), where

$$\begin{aligned} \Phi _t(x,y):= \left\{ \begin{array}{ll} \log |x-y|,&{} t=0,\\ |x-y|^{-t},&{} t>0. \end{array}\right. \end{aligned}$$
(4)

For these particular choices of f (and for a particular choice of \(\eta\) in the case of (1)), we use the fact (as noted in e.g. [7] for the case of Cantor sets) that the invariance property of \(\mu\) and the homogeneity property of \(\Phi _t\) can be exploited to express the singular integral exactly in terms of regular integrals (Theorems 4.6 and 4.7), which can be evaluated using our composite barycentre rule, again with second-order accuracy (Corollaries 4.4 and 4.7). The results on \(\Phi _t\) are directly relevant to Hausdorff-BEM formulations of Laplace problems analogous to the Helmholtz ones described above. In Section 5, we combine this approach to integrating \(\Phi _t\) with a singularity-subtraction technique (cf. [2, 3, 21, 36]) to propose and analyse a second-order accurate quadrature rule for the motivating example from [9] discussed above, exploiting the fact that the singular behaviour of \(\Phi (x,y)\) matches that of \(\Phi _t(x,y)\) for \(t=n-1\), \(n=1,2\). Here the main result is Theorem 5.7. In Section 6, we present some numerical results illustrating our theory. In the Appendix, we collect some results concerning the integrability of singular functions with respect to invariant measures on IFS attractors.

For ease of reference, we list the quadrature rules that we propose:

  • The barycentre rule \(Q_\Gamma [f]\) (25) for single regular integrals;

  • The barycentre rule \(Q_{\Gamma ,\Gamma '}[f]\) (32) for double regular integrals;

  • The rule \(Q_{\Gamma ,t,m}^h\) (43) for single integrals of the singular integrand \(\Phi _t\);

  • The rule \(Q_{\Gamma ,\Gamma ,t}^h\) (48) for double integrals of the singular integral \(\Phi _t\);

  • The singularity-subtraction rule \(Q_{\Gamma ,\Gamma ,\Phi }^h\) (61) for double integrals of the singular Helmholtz fundamental solution \(\Phi\); this rule reduces to (60) for small wavenumbers.

A link to our open-source implementation of these rules, and a pointer to an interactive notebook showing example usage, is provided in Section 6.

To put our results in the context of related work, we note that in the case \(n=1\), i.e. when \(\Gamma \subset \mathbb {R}\), Gauss quadrature rules can be derived for (1) (and applied to (2) iteratively), as discussed e.g. in [27, 28]. For sufficiently regular integrands, these rules offer superior convergence rates when compared to our composite barycentre rules. However, one advantage of our low-order composite approach is that it is also generically applicable for \(\Gamma \subset \mathbb {R}^n\), \(n>1\). In contrast, stable Gauss rules are not in general available for the case \(n>1\) (except when \(\Gamma\) is a subset of a line, in which case the \(n=1\) results apply). Moreover, the case \(n>1\) cannot in general be treated by taking Cartesian products of Gauss rules, since IFS attractors in \(\mathbb {R}^n\), \(n>1\), are not in general the Cartesian product of IFS attractors in \(\mathbb {R}\). Furthermore, even when \(\Gamma \subset \mathbb {R}^n\) has such a Cartesian product structure, as is the case for the Cantor dust in Fig. 1(I), the corresponding invariant measure is not the tensor-product measure of the respective lower-dimensional invariant measures (see e.g. [18, Proposition 7.1]). We stress, however, that if a stable Gauss rule (or any other quadrature rule for regular integrals) is available, it can be used in place of our composite barycentre rule within the context of our singularity-subtraction and invariance techniques for singular integrals, with corresponding analogues of the convergence results in Corollaries 4.4 and 4.7 and Theorem 5.7.

We also note that other quadrature rules for regular integrals on IFS attractors have been investigated in the abstract framework of uniform distributions and discrepancies in [13, 23], and in the context of so-called chaos games (i.e. Monte-Carlo-type algorithms) in e.g. [19]. In both settings, convergence is typically proved for general continuous integrands, but convergence rates for smoother integrands are not provided. We present a numerical comparison between our quadrature rules and a simple chaos game approach in Section 6.

We end this introduction with a comment relating to the practical evaluation of the quadrature rules presented in this paper. All our rules require knowledge of \({\mu }(\Gamma )\), since this quantity appears as a multiplicative factor in the formula (27) for the weights in the barycentre rule on which all our other quadrature rules are based. Somewhat surprisingly, even in the special case \(\mu =\mathcal {H}^d|_\Gamma\) the exact value of \(\mathcal {H}^d(\Gamma )\) is known only for a small number of IFS attractors, including the middle third Cantor set in \(\mathbb {R}\) but not including the middle third Cantor dust in \(\mathbb {R}^2\)—we provide a more detailed commentary on the current state of knowledge regarding \(\mathcal {H}^d(\Gamma )\) in Remark 3.4. This means that, in practice, it is in general not possible to compute (1) and (2) even for \(f=1\)! However, this does not compromise the utility of our quadrature rules for the main motivating application of this paper, namely the implementation of the Galerkin Hausdorff BEM for acoustic scattering by a fractal screen \(\Gamma _\mathrm{screen}\) in [9], and for similar possible applications to other differential and integral equations. This is because when one uses a BEM to solve a wave scattering problem, the physically relevant quantities such as the scattered wave field and its far-field pattern are unaffected by the choice of normalisation of the surface measure used in the BEM calculations. Working with the normalised measure \(\mathcal {H}_{\star }^d(\cdot ):=\mathcal {H}^d(\cdot )/\mathcal {H}^d(\Gamma _\mathrm{screen})\) in the BEM application leads to integrals of the form (1) and (2) with \(\mathcal {H}^d\) replaced by \(\mathcal {H}_{\star }^d\). Our quadrature rules apply mutatis mutandis to such integrals, requiring the value of \(\mathcal {H}_{\star }^d(\Gamma )\), but this can be computed for any subcomponent \(\Gamma\) of \(\Gamma _\mathrm{screen}\) using the IFS structure because \(\mathcal {H}_{\star }^d\) has the same self-similarity scaling properties as \(\mathcal {H}^d\) on subcomponents of \(\Gamma _\mathrm{screen}\) (cf. (18) below), and \(\mathcal {H}_{\star }^d(\Gamma _\mathrm{screen})\) is known (\(\mathcal {H}_{\star }^d(\Gamma _\mathrm{screen})=1\) by the definition of \(\mathcal {H}_{\star }^d\)). For details see [9].

2 Preliminaries

We begin by reviewing a number of basic results about IFS attractors and integration on them, and introduce the notation and terminology we will use throughout the paper.

2.1 Hausdorff measure and dimension

For \(E\subset \mathbb {R}^n\) and \(\alpha \ge 0\), we recall (e.g. [18, Section 3]) the definition of the Hausdorff \(\alpha\)-measure of E,

$$\begin{aligned} \mathcal {H}^\alpha (E)=\underset{\delta \rightarrow 0}{\lim }\, \bigg (\inf \sum \limits _{i=1}^\infty \big ({{\,\mathrm{diam}\,}}(U_i)\big )^\alpha \bigg )\in [0,\infty )\cup \{\infty \}, \end{aligned}$$

where the infimum is over all countable covers of E by sets \(U_i\subset \mathbb {R}^n\) with \({{\,\mathrm{diam}\,}}(U_i)\le \delta\) for \(i\in \mathbb {N}\). The Hausdorff dimension of E is then defined to be

$$\begin{aligned} \text{dim}_{\mathrm{H}}E = \sup \big \{\alpha \in \mathbb {R}^+: \mathcal {H}^\alpha (E)=\infty \big \} =\inf \big \{\alpha \in \mathbb {R}^+: \mathcal {H}^\alpha (E)=0\big \}\in [0,n], \end{aligned}$$

where the supremum of the empty set is taken to be 0. Given \(0< d\le n\), we call a non-empty closed set \(\Gamma \subset \mathbb {R}^n\) a d-set if there exist \(c_{2}>c_{1}>0\) such that

$$\begin{aligned} c_{1}r^{d}\le \mathcal {H}^{d}\big (\Gamma \cap B_{r}(x)\big )\le c_{2}r^{d},\qquad x\in \Gamma ,\quad 0<r\le 1, \end{aligned}$$
(5)

where \(B_r(x)\) denotes the closed ball of radius r centred at x. This definition is equivalent to the definitions given in [25, Subsubsection II.1.1] and [40, Subsection 3.1], by [40, Subsection 3.4]. Condition (5) implies not only that \(\text{dim}_{\mathrm{H}}(\Gamma )=d\) [40, Cor 3.6], but moreover that \(\Gamma\) is uniformly d-dimensional in the sense that \(\text{dim}_{\mathrm{H}}(\Gamma \cap B_r(x))=d\) for every \(x\in \Gamma\) and \(r>0\). If \(\Gamma\) is compact then condition (5) also gives that \(0<\mathcal {H}^d(\Gamma )<\infty\). and there exist \(\tilde{c}_2>\tilde{c}_1>0\), depending only on \(c_1,c_2\) and \({{\,\mathrm{diam}\,}}(\Gamma )\), such that

$$\begin{aligned} \tilde{c}_{1}r^{d}\le \mathcal {H}^d\big (\Gamma \cap B_{r}(x)\big )\le \tilde{c}_{2}r^{d},\qquad x\in \Gamma ,\quad 0<r\le {{\,\mathrm{diam}\,}}(\Gamma ). \end{aligned}$$
(6)

2.2 Iterated function systems

Throughout the paper, we assume that \(\Gamma\) is the attractor of an iterated function system (IFS) of contracting similarities (see e.g. [18, 22]), by which we mean a collection \(\{s_1,s_2,\ldots ,s_M\}\), for some \(M\in \mathbb {N}\), \(M\ge 2\), where, for each \(m=1,\ldots ,M\), \(s_m:\mathbb {R}^n\rightarrow \mathbb {R}^n\) satisfies, for some \(\rho _m\in (0,1)\),

$$\begin{aligned} |s_m(x)-s_m(y)| = \rho _m|x-y|,\quad \text {for }x,y\in \mathbb {R}^{n}. \end{aligned}$$

Explicitly, for each \(m=1,\ldots ,M\) we can write

$$\begin{aligned} s_m(x) = \rho _mA_mx + \delta _m, \end{aligned}$$
(7)

for some orthogonal matrix \(A_m\in \mathbb {R}^{n\times n}\) and some translation \(\delta _m\in \mathbb {R}^n\). We denote by \(\eta _{m}:=(I-\rho _mA_m)^{-1}\delta _m\) (I being the \(n\times n\) identity matrix) the fixed point of the contracting similarity \(s_{m}\), i.e. the unique point \(\eta _{m}\in \mathbb {R}^n\) such that \(s_m(\eta _m)=\eta _m\). Saying that \(\Gamma\) is the attractor of the IFS means that \(\Gamma\) is the unique non-empty compact set satisfying

$$\begin{aligned} \Gamma = s(\Gamma ), \end{aligned}$$

where

$$\begin{aligned} s(E) := \bigcup \limits _{m=1}^M s_m(E), \quad E\subset \mathbb {R}^{n}. \end{aligned}$$
(8)

We shall also assume throughout that the open set condition (OSC) [22, Section 5.2] holds, meaning that there exists a non-empty bounded open set \(O\subset \mathbb {R}^{n}\) such that

$$\begin{aligned} s(O) \subset O \quad \text{ and } \quad s_m(O)\cap s_{m'}(O)=\emptyset , \quad m\ne m'\in \{1,\ldots ,M\}. \end{aligned}$$
(9)

Then \(\Gamma\) is a d-set (e.g. [40, Thm. 4.7]), where \(d\in (0,n]\) is the unique solution of

$$\begin{aligned} \sum \limits _{m=1}^M (\rho _m)^d = 1. \end{aligned}$$
(10)

Furthermore, \(\mathcal {H}^d(s_{m}(\Gamma ))\cap s_{m'}(\Gamma ))=0\) for \(m\ne m'\), a property known as self-similarity [22, 5.1(4)(ii)].

The best-known example of an IFS attractor is the Cantor set \(\Gamma \subset \mathbb {R}\), defined by

$$\begin{aligned} n=1, \quad M=2, \quad s_1(x)=\rho x, \quad s_2(x) = (1-\rho ) + \rho x, \end{aligned}$$
(11)

for some \(\rho \in (0,1/2)\), the choice \(\rho =1/3\) corresponding to the classical “middle third” case.

2.3 Further assumptions on the IFS

We say that the IFS is homogeneous (as in, e.g. [15]) if \(\rho _m=\rho \in (0,1)\) for \(m=1,\ldots ,M\). In this case (10) becomes

$$\begin{aligned} M\rho ^d =1, \quad \text { equivalently, } \quad d = \log (M)/\log (1/\rho ). \end{aligned}$$
(12)

We say that the IFS is disjoint (as in, e.g., [5, Defn 7.1]) if

$$\begin{aligned} R_\Gamma :=\underset{m\ne m'}{\min }\,\big \{{{\,\mathrm{dist}\,}}\big ( s_{m}(\Gamma ), s_{m'}(\Gamma )\big ) \big \}>0, \end{aligned}$$
(13)

which holds if and only if the open set O in the OSC can be taken such that \(\Gamma \subset O\) (e.g. [9]).

Fig. 1
figure 1

Four IFS attractors in \(\mathbb {R}^2\) with different degrees of “disjointness”. The formulas of all contractions are in Table 1. Homogeneity, disjointness and hull-disjointness were defined in Section 2.3. (I) Top left: a homogeneous hull-disjoint IFS (a Cantor dust with \(\rho =1/3\)). (II) Top right: a homogeneous disjoint IFS that is not hull-disjoint and such that \(\eta _m\notin \mathrm {Hull}(\Gamma _{m'})\) for all \(m\ne m'\) (recall that \(\eta _m\) is the fixed point of \(s_m\)). The fixed points are the three vertices and the centre of \(\mathrm {Hull}(\Gamma )\). This condition on the fixed points is relevant e.g. in Corollary 4.7. (III) Bottom left: a non-homogeneous disjoint IFS that is not hull-disjoint and such that \(\eta _m\in \mathrm {Hull}(\Gamma _{m'})\) for some \(m'\ne m\). (In particular, \(s_5(\Gamma )\subset \mathrm {Hull}(s_3(\Gamma ))\).) (IV) Bottom right: a homogeneous IFS attractor that is not disjoint (the Vicsek fractal). All these examples satisfy the OSC (9): (I) and (IV) for the open square \(O=(0,1)^2\), (II) and (III) (and (I) again) for a neighbourhood \(O=\Gamma +B_\epsilon (0)\) with sufficiently small \(\epsilon\)

We say that the IFS is hull-disjoint if

$$\begin{aligned} R_{\Gamma ,\mathrm {Hull}}:=\underset{m\ne m'}{\min }\,\Big \{{{\,\mathrm{dist}\,}}\Big ( s_{m}\big (\mathrm {Hull}(\Gamma )\big ), s_{m'}\big (\mathrm {Hull}(\Gamma )\big )\Big ) \Big \}>0, \end{aligned}$$
(14)

where \(\mathrm {Hull}(E)\) denotes the convex hull of a set \(E\subset \mathbb {R}^n\). Clearly \(R_{\Gamma ,\mathrm {Hull}}\le R_\Gamma\), so hull-disjointness implies disjointness. But the converse is not true—see (II) and (III) in Fig. 1 for counterexamples.

Table 1 The contractions corresponding to the IFS attractors in Fig. 1

2.4 Vector index notation

Our quadrature rules will be based on partitioning \(\Gamma\) into self-similar subsets, via the IFS structure. To describe these subsets, we adopt the vector index notation used in [24] (cf. also [22, Section 2.1]). For \(\ell \in \mathbb {N}\) let \(I_\ell :=\{1,\ldots ,M\}^\ell\). Then for \(E\subset \mathbb {R}^n\) let \(E_0:=E\), and, for \(\varvec{m}=(m_1,\ldots ,m_\ell )\in I_\ell\), let

$$\begin{aligned} E_{\varvec{m}} := s_{\varvec{m}}(E),\qquad s_{\varvec{m}}:=s_{m_1}\circ \ldots \circ s_{m_\ell }. \end{aligned}$$

For an illustration of this notation in the case of the middle-third Cantor dust, see Fig. 2.

Fig. 2
figure 2

Illustration of the vector index notation of Section 2.4, in the case where \(\Gamma \subset \mathbb {R}^2\) is the middle-third Cantor dust (example (I) in Fig. 1 and Table 1). The subsets \(\Gamma _1\), \(\Gamma _2\), \(\Gamma _3\), \(\Gamma _4\), \(\Gamma _{(2,1)}\), \(\Gamma _{(2,3)}\) and \(\Gamma _{(1,1,1)}\) are circled

For \(\varvec{m}\in I_\ell\), \(\Gamma _{\varvec{m}}\) is itself the attractor of an IFS, namely \(\{s_{\varvec{m}} \circ s_m\circ (s_{\varvec{m}})^{-1}\}_{m=1}^M\), and

$$\begin{aligned} {{\,\mathrm{diam}\,}}(\Gamma _{\varvec{m}}) = \bigg (\prod \limits _{i=1}^\ell \rho _{m_i}\bigg ){{\,\mathrm{diam}\,}}(\Gamma ). \end{aligned}$$

This implies that the “elements” of the “Hausdorff-BEM” proposed in [9] are themselves IFS attractors, so the quadrature rules developed here can be used in the implementation of that method.

When considering singular integrands, it will be important to estimate the distance between subsets of \(\Gamma\). To that end, given \(\varvec{m}\ne \varvec{n}\in \cup _{\ell \in \mathbb {N}}I_\ell\), we define (cf. the partial ordering in [22, Section 2.1])

$$\begin{aligned} \ell _*(\varvec{m},\varvec{n}):=\min \big \{\ell \in \{1,\ldots ,\min \big (\dim (\varvec{m}),\dim (\varvec{n})\big )\}: m_\ell \ne n_\ell \big \}\in \mathbb {N}, \end{aligned}$$
(15)

and note the following obvious result, concerning how many indices share a common value of \(\ell _*\).

Lemma 2.1

Let \(\ell \in \mathbb {N}\). Given \(\varvec{m}\in I_\ell\) and \(\nu \in \{1,\ldots ,\ell \}\), there are \(M^{\ell -\nu }(M-1)\) indices \(\varvec{n}\in I_\ell\) such that \(\ell _*(\varvec{m},\varvec{n})=\nu\).

We shall also use the fact that if \(\Gamma\) is hull-disjoint (in the sense of (14)) then for \(\varvec{m}\ne \varvec{n}\in \cup _{\ell \in \mathbb {N}}I_\ell\)

$$\begin{aligned} {{\,\mathrm{dist}\,}}\big (\mathrm {Hull}(\Gamma _{\varvec{m}}),\mathrm {Hull}(\Gamma _{\varvec{n}})\big ) \ge R_{\Gamma ,\mathrm {Hull}}\prod \limits _{i=1}^{\ell _*(\varvec{m},\varvec{n})-1} \rho _{m_i}. \end{aligned}$$
(16)

2.5 Invariant measures and scaling properties

Integrals over IFS attractors have certain scaling properties that will be central to our analysis. In the case of the Hausdorff measure \(\mu =\mathcal {H}^d|_\Gamma\), by e.g. [24, (3.3)] we note that for \(\ell \in \mathbb {N}\), \(\varvec{m}=(m_1,\ldots ,m_\ell )\in I_\ell\), and for any \({\mathcal {H}^d|_\Gamma }\)-measurable function f,

$$\begin{aligned} \int _{\Gamma _{\varvec{m}}}f(x)\,\mathrm {d}{\mathcal {H}^d}(x)= & {} \left( \frac{{{\,\mathrm{diam}\,}}{\Gamma _{\varvec{m}}}}{{{\,\mathrm{diam}\,}}\Gamma }\right) ^d\int _\Gamma f\big (s_{\varvec{m}}(x')\big ) \,\mathrm {d}{\mathcal {H}^d}(x')\nonumber \\= & {} \bigg (\prod \limits _{i=1}^\ell \rho _{m_i}^d \bigg )\int _\Gamma f\big (s_{\varvec{m}}(x')\big ) \,\mathrm {d}{\mathcal {H}^d}(x'). \end{aligned}$$
(17)

In particular, taking \(f\equiv 1\) gives

$$\begin{aligned} \quad \mathcal {H}^d(\Gamma _{\varvec{m}}) = \left( \frac{{{\,\mathrm{diam}\,}}{\Gamma _{\varvec{m}}}}{{{\,\mathrm{diam}\,}}\Gamma }\right) ^d \mathcal {H}^d(\Gamma ) =\left( \prod \limits _{i=1}^\ell \rho _{m_i}^d\right) \mathcal {H}^d(\Gamma ) . \end{aligned}$$
(18)

The measure \(\mathcal {H}^d|_\Gamma\) is just one member of a general class of finite measures on \(\Gamma\) for which similar scaling results apply. Given a collection \((p_1,\ldots ,p_M)\) of positive weights (or “probabilities”) satisfying

$$\begin{aligned} 0<p_m<1, \quad m=1,\ldots ,M, \qquad \text {and} \qquad \sum \limits _{m=1}^M p_m =1, \end{aligned}$$
(19)

there exists (see, e.g., [22, Sections 4 & 5]) a Borel regular finite measure \(\mu\) supported on \(\Gamma\), unique up to normalisation, called an “invariant” [22] (also known as “balanced” [6] or “self-similar” [34]) measure associated to \(\Gamma\) and \((p_1,\ldots ,p_M)\), such that \(\mu (A)=\sum _{m=1}^M p_m \mu (s_m^{-1}(A))\) for every measurable set \(A\subset \mathbb {R}^n\). By [34, Thm. 2.1] the OSC implies that \(\mu (s_m(\Gamma )\cap s_{m'}(\Gamma ))=0\) for each \(m\ne m'\), and as a consequence we find that for \(\ell \in \mathbb {N}\), \(\varvec{m}=(m_1,\ldots ,m_\ell )\in I_\ell\), and any \(\mu\)-measurable function f,

$$\begin{aligned} \int _{\Gamma _{\varvec{m}}}f(x)\,\mathrm {d}\mu (x) =\bigg (\prod \limits _{i=1}^\ell p_{m_i} \bigg )\int _\Gamma f\big (s_{\varvec{m}}(x')\big ) \,\mathrm {d}\mu (x') \end{aligned}$$
(20)

and

$$\begin{aligned} \quad \mu (\Gamma _{\varvec{m}}) = \bigg (\prod \limits _{i=1}^\ell p_{m_i}\bigg )\mu (\Gamma ). \end{aligned}$$
(21)

We shall assume henceforth that \(\mu\) is an invariant measure on \(\Gamma\) in this sense, for some collection of associated weights \((p_1,\ldots ,p_M)\). The case \(\mu =\mathcal {H}^d|_\Gamma\) corresponds to choosing \(p_m=\rho _m^d\) for \(m=1,\ldots ,M\), with (19) holding by (10).

2.6 Partitioning \(\Gamma\)

To define our composite quadrature rules, we need to specify an index set \(\mathcal {I}\subset \cup _{\ell \in \mathbb {N}}I_\ell\) such that

$$\begin{aligned} \Gamma= & {} \bigcup \limits _{\varvec{m}\in \mathcal {I}}\Gamma _{\varvec{m}}\quad \text { and } \quad {\mu }(\Gamma _{\varvec{m}}\cap \Gamma _{\varvec{m}'})=0 \text { for }\varvec{m}\ne \varvec{m}'\in \mathcal {I},\nonumber \\&\text {so that }\sum \limits _{\varvec{m}\in \mathcal {I}} {\mu }(\Gamma _{\varvec{m}})= {\mu }(\Gamma ). \end{aligned}$$
(22)

One approach is to choose subsets with a fixed level of refinement, i.e. to take \(\mathcal {I}=I_\ell\) for some fixed \(\ell \in \mathbb {N}\). However, in the case of a non-homogeneous IFS, subsets chosen in this way may differ significantly in size. An alternative approach is to choose subsets with approximately equal diameter, taking \(\mathcal {I}=L_h(\Gamma )\) for some fixed \(h>0\), where

$$\begin{aligned} L_{h}(\Gamma ):= & {} \big \{\varvec{m}=(m_1,\ldots ,m_\ell )\in \cup _{\ell '\in \mathbb {N}}I_{\ell '} :\nonumber \\&{{\,\mathrm{diam}\,}}(\Gamma _{\varvec{m}})\le h \text { and } {{\,\mathrm{diam}\,}}(\Gamma _{(m_1,\ldots ,m_{\ell -1})})>h\big \}, \end{aligned}$$
(23)

with \(\Gamma _{(m_1,.\ldots ,m_{\ell -1})}\) replaced by \(\Gamma\) when \(\ell =1\) and \(L_h(\Gamma ):=\{0\}\) when \(h\ge {{\,\mathrm{diam}\,}}(\Gamma )\) (recall our convention that \(\Gamma _0=\Gamma\)). See Figs. 3 and 4 for illustrations of the decomposition \(L_h(\Gamma )\) for the Koch snowflake and a non-homogeneous Cantor set. If \(\Gamma\) is homogeneous then for \(0<h\le {{\,\mathrm{diam}\,}}(\Gamma )\) we have \(L_h(\Gamma )=I_\ell\), where

$$\begin{aligned} \rho ^\ell {{\,\mathrm{diam}\,}}(\Gamma )\le h < \rho ^{\ell -1}{{\,\mathrm{diam}\,}}(\Gamma ), \,\,\text { i.e. }\,\,\ell = \left\lceil \frac{\log (h/{{\,\mathrm{diam}\,}}(\Gamma ))}{\log {\rho }} \right\rceil . \end{aligned}$$
(24)
Fig. 3
figure 3

Examples of the partitioning (22) corresponding to the index set \(\mathcal {I}=L_h(\Gamma )\) defined by (23) in the case where \(\Gamma \subset \mathbb {R}^2\) is the Koch snowflake. The barycentres (defined by (26)) of the self-similar subsets in the partitioning are indicated with red crosses. The Koch snowflake can be written as a non-homogeneous IFS attractor with \(M=7\), \(s_m(x,y)=\frac{1}{3}(x,y)+\frac{2}{3}(\cos \alpha _m,\sin \alpha _m)\) with \(\alpha _m=\frac{(2m-1)\pi }{6}\) for \(m=1,\ldots ,6\), and \(s_7(x,y)=(\frac{1}{2}x-\frac{1}{2\sqrt{3}}y,\frac{1}{2\sqrt{3}}x+\frac{1}{2}y )\) (so that \(\rho _7=1/\sqrt{3}\)). It satisfies the OSC (9) with O equal to the interior of \(\Gamma\)

Fig. 4
figure 4

A depiction of the index set \(L_h(\Gamma )\) and of \(\Gamma _{\mathrm {Hull},h}\) for the non-homogeneous Cantor set \(\Gamma \subset \mathbb {R}\) with \(s_1(x)=\frac{1}{2}x\), \(s_2(x)=\frac{1}{4}x+\frac{3}{4}\). Each segment represents the convex hull of some \(\Gamma _{\varvec{m}}\). Given \(h\in [1/16,1/8)\), the multi-indices \(\varvec{m}\in L_h(\Gamma )\) are those corresponding to the red segments: these are the segments of length \(\le h\) whose parent segment has length \(>h\).The set \(\Gamma _{\mathrm {Hull},h}\) is the union of the red segments

3 Barycentre rule for regular integrals

We now present our composite barycentre rules for the evaluation of regular integrals of the form (1) and (2).

3.1 Single integrals

We first consider the single integral (1). Given a partitioning (22) of \(\Gamma\) into self-similar subsets, our quadrature nodes are the barycentres of the subsets (for an illustration in the case of the Koch snowflake see Fig. 3), computed with respect to the measure \({\mu }\), and the weights are the measures of the subsets.

Definition 3.1

(Barycentre rule for single integrals) Let \(\Gamma\) and \(\mu\) be as in Sections 2.2 and 2.5, let \(\mathcal {I}\subset \cup _{\ell \in \mathbb {N}}I_\ell\) be an index set satisfying (22), and let \(f:\Gamma \rightarrow \mathbb {C}\) be continuous. Then for the approximation of the integral

$$\begin{aligned}I_\Gamma [f]:=\int _\Gamma f(x)\,\mathrm {d}{\mu }(x) \end{aligned}$$

we define the barycentre rule

$$\begin{aligned} Q_\Gamma [f]:=\sum \limits _{\varvec{m}\in \mathcal {I}}w_{\varvec{m}}f(x_{\varvec{m}}), \end{aligned}$$
(25)

where, for \(\varvec{m}{=(m_1,\ldots ,m_l)}\in \mathcal {I}\),

$$\begin{aligned} x_{\varvec{m}} :=\frac{\int _{\Gamma _{\varvec{m}}}x\,\mathrm {d}{\mu }(x)}{\int _{\Gamma _{\varvec{m}}}\mathrm {d}{\mu }(x)} =\frac{\int _{\Gamma _{\varvec{m}}}x\,\mathrm {d}{\mu }(x)}{ {\mu }(\Gamma _{\varvec{m}})} \end{aligned}$$
(26)

and

$$\begin{aligned} w_{\varvec{m}}:= {\mu }(\Gamma _{\varvec{m}}) . \end{aligned}$$
(27)

The number of weights and nodes in this approximation is \(|\mathcal {I}|\).

Remark 3.2

While it always holds that \(x_{\varvec{m}}\in \mathrm {Hull}(\Gamma _{\varvec{m}})\) (by the supporting hyperplane theorem), it does not in general hold that \(x_{\varvec{m}}\in \Gamma _{\varvec{m}}\) (the middle-third Cantor set provides a counterexample).

The weights \(w_{\varvec{m}}\) in (27) can be computed using (21) as

$$\begin{aligned} w_{\varvec{m}}= \left( \prod \limits _{i=1}^{\ell } {p}_{m_i}\right) {\mu }(\Gamma ). \end{aligned}$$
(28)

While the barycentres \(x_{\varvec{m}}\) are defined a priori in terms of integrals with respect to \({\mu }\), the following result shows how they can be computed using only information about the similarities \((s_1,\ldots ,s_M)\). This result coincides with the first step in the recursive procedure described in [26, 2.5.2] and [27, Section 2] for the calculation of moments of invariant measures.

Proposition 3.3

The barycentres \(x_{\varvec{m}}\) defined by (26) can be evaluated as

$$\begin{aligned} x_{\varvec{m}} = s_{\varvec{m}}(x_\Gamma ), \quad \varvec{m}\in \mathcal {I}, \end{aligned}$$
(29)

where \(x_\Gamma :=\frac{\int _{\Gamma }x\,\mathrm {d}{\mu }(x)}{\int _{\Gamma }\mathrm {d}{\mu }(x)}=\int _{\Gamma }x\,\mathrm {d}{\mu }(x)\) is the barycentre of \(\Gamma\), which can be evaluated as

$$\begin{aligned} x_\Gamma = \Bigg (I - \sum \limits _{m=1}^M {p_m}\rho _mA_{m}\Bigg )^{-1}\bigg (\sum \limits _{m=1}^M {p_m}\delta _m\bigg ), \end{aligned}$$
(30)

where I is the \(n\times n\) identity matrix and \(\rho _m\), \(A_m\) and \(\delta _m\), \(m=1,\ldots ,M\), are as in (7).

Proof

To prove (29), we first consider the case where \(s_{\varvec{m}}=s_m\) for some \(m\in \{1,\ldots ,M\}\), for which by (7), (20) and (21) we have

$$\begin{aligned} x_m:= & {} {\frac{\int _{\Gamma _{m}}x\,\mathrm {d}\mu (x)}{\int _{\Gamma _{m}}\mathrm {d}\mu (x)} } =\frac{ {p_m}\int _{\Gamma } s_m(x) \,\mathrm {d}{\mu }(x)}{ {p_m}\int _{\Gamma }\mathrm {d}{\mu }(x)} = \frac{ \rho _mA_m\int _{\Gamma }x \,\mathrm {d}{\mu }(x)}{\int _{\Gamma }\mathrm {d}{\mu }(x)} + \frac{\delta _m\int _{\Gamma } \,\mathrm {d}{\mu }(x)}{\int _{\Gamma }\mathrm {d}{\mu }(x)}\nonumber \\= & {} \rho _mA_m x_\Gamma + \delta _m = s_m(x_\Gamma ). \end{aligned}$$
(31)

The general result follows by induction on the length of the vector index \(\varvec{m}\).

To prove (30) we note that, by (26) and (21),

$$\begin{aligned} x_\Gamma = \frac{\sum _{m=1}^M\int _{\Gamma _m}x\,\mathrm {d}{\mu }(x)}{ {\mu }(\Gamma )}= \sum \limits _{m=1}^M\frac{ {\mu }(\Gamma _{m})x_m}{ {\mu }(\Gamma )} = \sum \limits _{m=1}^M {p_m}x_m = \sum \limits _{m=1}^M {p_m} s_m(x_\Gamma ). \end{aligned}$$

Using (31), this can be written as

$$\begin{aligned} \bigg (I- \sum \limits _{m=1}^M {p_m}\rho _mA_m\bigg ) x_\Gamma = \sum \limits _{m=1}^M {p_m}\delta _m, \end{aligned}$$

from which (30) follows by matrix inversion. The invertibility of the matrix \(\big (I- \sum _{m=1}^M {p_m}\rho _mA_m\big )\) follows from the fact that \(\Vert A_m\Vert _2=1\) and \(0<\rho _m<1\) for each \(m=1,\ldots ,M\), so that, recalling (19),

$$\begin{aligned} \left\| \sum \limits _{m=1}^M {p_m}\rho _mA_m\right\| _2\le \sum \limits _{m=1}^M {p_m}\rho _m\Vert A_m \Vert _2 = \sum \limits _{m=1}^M {p_m}\rho _m<\sum \limits _{m=1}^M {p_m} = 1. \end{aligned}$$

\(\square\)

Remark 3.4

Evaluation of the quadrature weights \(w_{\varvec{m}}\) defined in (27) requires knowledge of \({\mu }(\Gamma )\). If \({\mu }(\Gamma )\) is unknown then the quadrature rule (25) can only be evaluated up to the unknown factor \({\mu }(\Gamma )\). As mentioned in Section 1, even in the special case \(\mu =\mathcal {H}^d|_\Gamma\), the exact value of \(\mathcal {H}^d(\Gamma )\) is known only in certain special cases, and, to our knowledge, only for examples where \(d\le 1\). In the Hausdorff BEM application that motivates this paper, this is unproblematic as one can simply work with an appropriately normalised measure (see the discussion in Section 1 and [9]). However, for completeness, we comment briefly on the current state of knowledge regarding \(\mathcal {H}^d(\Gamma )\). The best-studied examples are Cantor-type sets in \(\mathbb {R}\) (\(n=1\)). Important early work in this area includes that of Marion [30, 31] and Falconer [17], where it was proved that \(\mathcal {H}^d(\Gamma )=1\) for a large class of Cantor-type sets including the classical Cantor sets defined by (11) [17, Thm. 1.14–1.15]; for more recent related results, see e.g. [4] and [43]. For \(n>1\), it appears that the exact value of the Hausdorff measure of even the simplest IFS attractors is known only for \(d\le 1\) (see e.g. [41], where it is proved that for the Cantor dust defined in Example (I) of Table 1, \(\mathcal {H}^d(\Gamma )=2^{d/2}\) for \(0<\rho \le 1/4\) (\(0<d\le 1\)) [41, Cor. 1]; see also the earlier paper [42] where the case \(\rho =1/4\) was considered). For \(n>1\) and \(d>1\), it appears that only approximate results are available. For instance, when \(\Gamma \subset \mathbb {R}^2\) is the Sierpiński triangle, it is known that \(0.77\le \mathcal {H}^d(\Gamma )\le 0.81794\) [33]. One complication in the case \(n>1\) is that even if \(\Gamma\) is a Cartesian product of lower-dimensional IFS attractors, as is the case for the Cantor dust in Example (I) of Table 1, the measure of \(\Gamma\) cannot be computed as the product of lower-dimensional measures, since for sets \(\Gamma _1\) and \(\Gamma _2\) of dimension \(d_1\) and \(d_2\) respectively, in general we do not have \(\mathcal {H}^{d_1}(\Gamma _1)\times \mathcal {H}^{d_2}(\Gamma _2) = \mathcal {H}^{{d_1} + {d_2}}(\Gamma _1\times \Gamma _2)\) [18, Proposition 7.1].

3.2 Double integrals

Double integrals of the form (2) can be treated by iterating the barycentre rule in the obvious way.

Definition 3.5

(Barycentre rule for double integrals) Let \(\Gamma \subset \mathbb {R}^n\) and \(\Gamma '\subset \mathbb {R}^{n'}\) be as in Section 2.2 (possibly with different Hausdorff dimensions), and let \(\mu\) and \(\mu '\) be invariant measures on \(\Gamma\) and \(\Gamma '\) respectively, as in Section 2.5. Let \(\mathcal {I}\) and \(\mathcal {I}'\) be index sets satisfying (22) for \({(\Gamma ,\mu )}\) and \({(\Gamma ',\mu ')}\) respectively, and let \(f:\Gamma \times \Gamma '\rightarrow \mathbb {C}\) be continuous. Then for the approximation of the iterated integral

$$\begin{aligned} I_{\Gamma ,\Gamma '}[f]:=\int _\Gamma \int _{\Gamma '} f(x,y)\,\mathrm {d}{\mu '}(y)\,\mathrm {d}{\mu }(x) \end{aligned}$$

we define the iterated barycentre rule

$$\begin{aligned} Q_{\Gamma ,\Gamma '}[f]:= \sum \limits _{\varvec{m}\in \mathcal {I}} \sum \limits _{\varvec{m}'\in \mathcal {I}'} w_{\varvec{m}} w'_{\varvec{m}'}f(x_{\varvec{m}},x'_{\varvec{m}'}), \end{aligned}$$
(32)

where, for \(\varvec{m}\in \mathcal {I}\), \(x_{\varvec{m}}\) and \(w_{\varvec{m}}\) are defined by (26) and (27), and, for \(\varvec{m}'\in \mathcal {I}'\), \(x'_{\varvec{m}'}\) and \(w'_{\varvec{m}}\) are defined by the analogous formulas involving \(\Gamma '\) and \(\mu '\).

3.3 Error estimates

When the integrands are sufficiently smooth, error estimates for the quadrature rules in Definitions 3.1 and 3.5 can be derived by standard Taylor series arguments. The result for single integrals (Definition 3.1) is presented in Theorem 3.6 below. Before stating the theorem, we introduce some notation. Given a set \(E\subset \mathbb {R}^n\) and a function \(f:E\rightarrow \mathbb {C}\), we define

$$\begin{aligned} \mathcal {L}_{0,E}[f]:=\underset{x\ne y\in E}{\sup }\,\frac{|f(x)-f(y)|}{|x-y|}. \end{aligned}$$

If f is differentiable in an open set \(\Omega \supset E\), we denote its gradient by \(\nabla f:\Omega \rightarrow \mathbb {C}^n\), and define

$$\begin{aligned} \mathcal {L}_{1,E}[f]:=\underset{x\ne y\in E}{\sup }\,\frac{|\nabla f(x)-\nabla f(y)|}{|x-y|}. \end{aligned}$$

Note that we are allowing the possibility that \(\mathcal {L}_{0,E}[f]\) and \(\mathcal {L}_{1,E}[f]\) are infinite. If f is twice differentiable in \(\Omega\), we denote its Hessian by \(Hf:\Omega \rightarrow \mathbb {C}^{n\times n}\). For \(\alpha \in \mathbb {N}_0^n\), \(D^\alpha\) denotes standard multi-index notation for partial derivatives. Finally, given \(h>0\) we define

$$\begin{aligned} \Gamma _{\mathrm {Hull},h}:=\bigcup \limits _{\varvec{m}\in L_h(\Gamma )}\mathrm {Hull}(\Gamma _{\varvec{m}}). \end{aligned}$$
(33)

Theorem 3.6

Let \(\Gamma\) and \(\mu\) be as in Sections 2.2 and 2.5. Let \(h>0\), and let \(\Gamma _{\mathrm {Hull},h}\) be as in (33). Suppose that \(f:\Gamma _{\mathrm {Hull},h}\rightarrow \mathbb {C}\), and let \(Q_\Gamma ^h\) denote the barycentre rule of Definition 3.1 with \(\mathcal {I}=L_h(\Gamma )\). Then, with E denoting \(|I_\Gamma [f]-Q_\Gamma ^h[f]|\),

  1. (i)

    \({E}\le h {\mu }(\Gamma )\max _{\varvec{m}\in L_h(\Gamma )}\mathcal {L}_{0,\mathrm {Hull}(\Gamma _{\varvec{m}})}[f]\).

  2. (ii)

    If f is differentiable in an open set \(\Omega \supset \Gamma _{\mathrm {Hull},h}\) then

    $$\begin{aligned} {E}\le & {} h {\mu }(\Gamma )\underset{x\in \Gamma _{\mathrm {Hull},h}}{\sup }\,|\nabla f(x)|\\\le & {} \sqrt{n}h {\mu }(\Gamma )\underset{x\in \Gamma _{\mathrm {Hull},h}}{\sup }\,{\underset{|\alpha |=1}{\underset{\alpha \in \mathbb {N}_0^n}{\max }}}|D^\alpha f(x)| \end{aligned}$$

    and

    $$\begin{aligned} {E} \le h^2 {\mu }(\Gamma ) \underset{\varvec{m}\in L_h(\Gamma )}{\max }\,\mathcal {L}_{1,\mathrm {Hull}(\Gamma _{\varvec{m}})}[f]. \end{aligned}$$
  3. (iii)

    If f is twice differentiable in an open set \(\Omega \supset \Gamma _{\mathrm {Hull},h}\) then

    $$\begin{aligned} {E}\le & {} \frac{h^2}{2} {\mu }(\Gamma )\underset{x\in \Gamma _{\mathrm {Hull},h}}{\sup }\,\Vert Hf(x)\Vert _2\\\le & {} \frac{nh^2}{2} {\mu }(\Gamma ) \underset{x\in \Gamma _{\mathrm {Hull},h}}{\sup }\,{\underset{|\alpha |=2}{\underset{\alpha \in \mathbb {N}_0^n}{\max }}}|D^\alpha f(x)|. \end{aligned}$$

Proof

(i) Elementary estimation, combined with (22), gives

$$\begin{aligned} |I_\Gamma [f]-Q_\Gamma ^h[f]|\le & {} \sum \limits _{\varvec{m}\in L_h(\Gamma )}\int _{\Gamma _{\varvec{m}}}|f(x)-f(x_{\varvec{m}})|\,\mathrm {d}{\mu }(x)\\\le & {} \sum \limits _{\varvec{m}\in L_h(\Gamma )} {\mu }(\Gamma _{\varvec{m}}) \mathcal {L}_{0,\mathrm {Hull}(\Gamma _{\varvec{m}})}[f]{{\,\mathrm{diam}\,}}(\Gamma _{\varvec{m}})\\\le & {} h {\mu }(\Gamma )\underset{\varvec{m}\in L_h(\Gamma )}{\max }\,\mathcal {L}_{0,\mathrm {Hull}(\Gamma _{\varvec{m}})}[f]. \end{aligned}$$

(ii) The first bound follows from part (i) and the fact that, by the mean value theorem, \(\mathcal {L}_{0,\mathrm {Hull}(\Gamma _{\varvec{m}})}[f]\) \(\le \sup _{x\in \mathrm {Hull}(\Gamma _{\varvec{m}})} |\nabla f(x)|\). For the second bound, we also apply the mean value theorem, noting for each \(\varvec{m}\in L_h(\Gamma )\) and \(x\in \Gamma _m\) there exists a point \(\xi _{\varvec{m}}(x)\) on the segment between x and \(x_{\varvec{m}}\) such that \(f(x)-f(x_{\varvec{m}})=\nabla f(\xi _{\varvec{m}}(x))^T(x-x_{\varvec{m}})\). Hence

$$\begin{aligned} \int _{\Gamma _{\varvec{m}}} f(x)-f(x_{\varvec{m}})\,\mathrm {d}{\mu }(x)= & {} \int _{\Gamma _{\varvec{m}}}\nabla f(x_{\varvec{m}})^T(x-x_{\varvec{m}})\,\mathrm {d}{\mu }(x) \\&+ \int _{\Gamma _{\varvec{m}}}\big (\nabla f(\xi _{\varvec{m}}(x))-\nabla f(x_{\varvec{m}})\big )^T(x-x_{\varvec{m}})\,\mathrm {d}{\mu }(x). \end{aligned}$$

The first integral on the right-hand side vanishes by the definition of \(x_{\varvec{m}}\), with the result that, again using (22),

$$\begin{aligned} |I_\Gamma [f]-Q_\Gamma ^h[f]|\le & {} \sum \limits _{\varvec{m}\in L_h(\Gamma )} {\mu }(\Gamma _{\varvec{m}}) \mathcal {L}_{1,\mathrm {Hull}(\Gamma _{\varvec{m}})}[f]{{\,\mathrm{diam}\,}}(\Gamma _{\varvec{m}})^2\\\le & {} h^2 {\mu }(\Gamma )\underset{\varvec{m}\in L_h(\Gamma )}{\max }\,\mathcal {L}_{1,\mathrm {Hull}(\Gamma _{\varvec{m}})}[f]. \end{aligned}$$

(iii) By Taylor’s theorem, for each \(\varvec{m}\in L_h(\Gamma )\) and \(x\in \Gamma _m\) there exists a point \(\xi _{\varvec{m}}(x)\) on the segment between x and \(x_{\varvec{m}}\) such that \(\displaystyle f(x)-f(x_{\varvec{m}})= \nabla f(x_{\varvec{m}})^T(x-x_{\varvec{m}}) + \frac{1}{2}(x-x_{\varvec{m}})^THf(\xi _{\varvec{m}}(x))(x-x_{\varvec{m}})\). Again, the linear term integrates to 0, so

$$\begin{aligned} \left| \int _{\Gamma _{\varvec{m}}} f(x)-f(x_{\varvec{m}})\,\mathrm {d}{\mu }(x)\right| \le \frac{1}{2} {\mu }(\Gamma _{\varvec{m}}) \underset{x\in \mathrm {Hull}(\Gamma _{\varvec{m}})}{\sup }\,\Vert Hf(x)\Vert _2 {{\,\mathrm{diam}\,}}(\Gamma _{\varvec{m}})^2, \end{aligned}$$

and the result follows, by bounding \({{\,\mathrm{diam}\,}}(\Gamma _{\varvec{m}})\le h\), summing over \(\varvec{m}\) and using (22).

\(\square\)

We now consider the double integral case (Definition 3.5). Higher order iterated integrals over the product of arbitrarily many IFS attractors can be analysed similarly, but are not considered here.

Theorem 3.7

Let \(\Gamma \subset \mathbb {R}^n\) and \(\Gamma '\subset \mathbb {R}^{n'}\) be as in Section 2.2, and let \(\mu\) and \(\mu '\) be invariant measures on \(\Gamma\) and \(\Gamma '\) respectively, as in Section 2.5. Let \(h>0\), and let \(\Gamma _{\mathrm {Hull},h}\) be as in (33) and \(\Gamma _{\mathrm {Hull},h}'\) be as in (33) with \(\Gamma\) replaced by \(\Gamma '\). Suppose that \(f:\Gamma _{\mathrm {Hull},h}\times \Gamma _{\mathrm {Hull},h}'\rightarrow \mathbb {C}\), and let \(Q_{\Gamma ,\Gamma '}^h\) denote the barycentre rule of Definition 3.5 with \(\mathcal {I}=L_h(\Gamma )\) and \(\mathcal {I}'=L_h(\Gamma ')\). Then, with E denoting \(|I_{\Gamma ,\Gamma '}[f]-Q_{\Gamma ,\Gamma '}^h[f]|\):

  1. (i)

    \({E} \le \sqrt{2}\,h {\mu }(\Gamma ) {\mu '}(\Gamma ') \max _{(\varvec{m},\varvec{m}')\in L_h(\Gamma )\times L_h(\Gamma ')} \mathcal {L}_{0,\mathrm {Hull}(\Gamma _{\varvec{m}})\times \mathrm {Hull}(\Gamma '_{\varvec{m}'})}[f]\).

  2. (ii)

    If f is differentiable in an open set \(\Omega \supset \Gamma _{\mathrm {Hull},h}\times \Gamma _{\mathrm {Hull},h}'\) then

    $$\begin{aligned} {E}\le & {} \sqrt{2}\,h {\mu }(\Gamma ) {\mu '}(\Gamma ') \underset{(x,x')\in \Gamma _{\mathrm {Hull},h}\times \Gamma _{\mathrm {Hull},h}'}{\sup }\,|\nabla f(x,x')|\\\le & {} \sqrt{2}\sqrt{n+n'}\;h {\mu }(\Gamma ) {\mu '}(\Gamma ') \underset{(x,x')\in \Gamma _{\mathrm {Hull},h}\times \Gamma _{\mathrm {Hull},h}'}{\sup }\,{\underset{|\alpha |=1}{\underset{\alpha \in \mathbb {N}_0^{n+n'}}{\max }}}|D^\alpha f(x,x')| \end{aligned}$$

    and

    $$\begin{aligned} {E}\le & {} 2h^2 {\mu }(\Gamma ) {\mu '}(\Gamma ') \underset{(\varvec{m},\varvec{m}')\in L_h(\Gamma )\times L_h(\Gamma ')}{\max }\, \mathcal {L}_{1,\mathrm {Hull}(\Gamma _{\varvec{m}})\times \mathrm {Hull}(\Gamma '_{\varvec{m}'})}[f]. \end{aligned}$$
  3. (iii)

    If f is twice differentiable in an open set \(\Omega \supset \Gamma _{\mathrm {Hull},h}\times \Gamma _{\mathrm {Hull},h}'\) then

    $$\begin{aligned} {E}\le & {} h^2 {\mu }(\Gamma ) {\mu '}(\Gamma ') \underset{(x,x')\in \Gamma _{\mathrm {Hull},h}\times \Gamma _{\mathrm {Hull},h}'}{\sup }\,\Vert H f(x,x')\Vert _2 \\\le & {} (n+n')h^2 \underset{(x,x')\in \Gamma _{\mathrm {Hull},h}\times \Gamma _{\mathrm {Hull},h}'}{\sup }\,{\underset{|\alpha |=2}{\underset{\alpha \in \mathbb {N}_0^{n+n'}}{\max }}}|D^\alpha f(x,x')|. \end{aligned}$$

Proof

Follows similar arguments to those used to prove Theorem 3.6, in the setting of \(\mathbb {R}^{n+n'}\). The extra factors of \(\sqrt{2}\) and 2 arise because \({{\,\mathrm{diam}\,}}(E\times E')\le \sqrt{{{\,\mathrm{diam}\,}}(E)^2+{{\,\mathrm{diam}\,}}(E')^2}\) for \(E\subset \mathbb {R}^n\) and \(E'\subset \mathbb {R}^{n'}\).

\(\square\)

Remark 3.8

The fact that \(x_{\varvec{m}}\) is the barycentre of \(\Gamma _{\varvec{m}}\) only enters in the proof of the \(O(h^2)\) estimates in Theorems 3.6 and 3.7. The O(h) estimates remain true if the barycentre \(x_{\varvec{m}}\) is replaced by any other point of \(\mathrm {Hull}(\Gamma _{\varvec{m}})\).

Remark 3.9

The error bounds in Theorem 3.6 are written in terms of the discretization parameter h, which measures the diameter of the portion of \(\Gamma\) on which the integrand is approximated by a constant value. In practice it is useful to estimate the error in terms of the computational effort of the quadrature rule, writing the error bounds in terms of the number of quadrature points (and thus of the evaluations of the integrand) \(N:=|L_h(\Gamma )|\).

We shall do this in the special case where \(\Gamma\) is homogeneous. Then \(L_h(\Gamma )=I_\ell\) for \(\ell \in \mathbb {N}\) as in (24), so that \(N=M^\ell\), and from (24) and (10), which gives \(\rho ^d=1/M\), we have

$$\begin{aligned} h<\rho ^{\ell -1}{{\,\mathrm{diam}\,}}(\Gamma )=\frac{{{\,\mathrm{diam}\,}}(\Gamma )}{\rho }\;\frac{1}{M^{\ell /d}}=\frac{{{\,\mathrm{diam}\,}}(\Gamma )}{\rho }\; N^{-1/d} ={{\,\mathrm{diam}\,}}(\Gamma )\left( \frac{N}{M}\right) ^{-1/d}. \end{aligned}$$
(34)

We can substitute either of the last two expressions in place of h in the right-hand sides of the error bounds in Theorem 3.6, obtaining \(O(N^{-1/d})\) and \(O(N^{-2/d})\) convergence rates, with respect to increasing N. We observe that the lower the Hausdorff dimension d of \(\Gamma\), the faster the convergence of the quadrature rule with respect to increasing N, all other factors being equal.

In the double-integral case, we can substitute either of the expressions

$$\begin{aligned}&\min \bigg \{\frac{{{\,\mathrm{diam}\,}}(\Gamma )}{\rho }N^{-1/d},\frac{{{\,\mathrm{diam}\,}}(\Gamma ')}{\rho '} (N')^{-1/d'}\bigg \} \\= & {} \min \bigg \{{{\,\mathrm{diam}\,}}(\Gamma )\left( \frac{N}{M}\right) ^{-1/d},{{\,\mathrm{diam}\,}}(\Gamma )\left( \frac{N'}{M'}\right) ^{-1/d'}\bigg \}, \end{aligned}$$

where \(N':=|L_h(\Gamma ')|\), in place of h in the error estimates of Theorem 3.7. In this case, the computational cost, measured as the number of integrand evaluations, is the product \(NN'\).

The barycentre rule (25) depends on the choice of the index set \(\mathcal {I}\). The choice \(\mathcal {I}=L_h(\Gamma )\) stipulated in Section 3.3, with \(L_h(\Gamma )\) as in (23), allocates the quadrature nodes \(x_{\varvec{m}}\) only according to the diameter of the associated subsets \(\Gamma _{\varvec{m}}\subset \Gamma\), and is motivated by the use of a Taylor-polynomial technique to bound the quadrature error. This choice is most effective for homogeneous IFSs and Hausdorff measures, where the fraction of the measure associated to each quadrature node is the same. For general IFSs and invariant measures, we expect that more sophisticated choices of the index set \(\mathcal {I}\), taking into account the measure of the subsets in the induced partition as well as their diameter, may be more efficient. However, we leave further discussion of this issue to future work.

4 Evaluation of singular integrals

We now turn to the case where the integrands in (1) and (2) are singular. In this section, we show how two classes of singular integrals involving the function \(\Phi _t\) (defined in (4)) can be expressed in terms of regular integrals, using the scaling properties from Section 2.5 and certain homogeneity properties of \(\Phi _t\). This will allow us to derive and analyse quadrature rules for the singular integrals based on the barycentre rule described in the previous section.

4.1 Homogeneity and bounds on derivatives of \(\Phi _t\)

Key to our analysis will be the fact that, for any \(x\ne y\in \mathbb {R}^n\) and \(\rho >0\),

$$\begin{aligned} \Phi _t(\rho x, \rho y)=\left\{ \begin{array}{cc} \log \rho + \Phi _t (x,y),&{}\quad t=0,\\ \rho ^{-t}\Phi _t(x,y),&{}\quad t>0. \end{array}\right. \end{aligned}$$
(35)

We note also that \(\Phi _t(x,y)\) is smooth as a function of both x and y, away from the diagonal \(x=y\), on which it is singular. More precisely, we shall need the following result concerning derivatives of \(\Phi _t\). Here the assumption that the multi-index \(\alpha \in \mathbb {N}_0^{2n}\) means that \(\alpha\) could correspond to differentiation with respect to the components of either x or y, and

$$\begin{aligned} a_t:={\left\{ \begin{array}{ll}2,&{}t=0,\\ t(t+2),&{}t>0.\end{array}\right. } \end{aligned}$$

Lemma 4.1

Let \(\alpha \in \mathbb {N}_0^{2n}\) be a multi-index with \(|\alpha |=2\). Then for \(x\ne y\)

$$\begin{aligned} \left| {D}^{\alpha }\Phi _t(x,y)\right| \le {\dfrac{a_t}{|x-y|^{t+2}}.} \end{aligned}$$

Proof

Let \(\alpha =\beta +\gamma\) for some multi-indices \(\beta ,\gamma \in \mathbb {N}_0^{2n}\) with \(|\beta |=|\gamma |=1\). With \(r(x,y):=|x-y|\) for \(x,y\in \mathbb {R}^n\), for any twice differentiable \(F:\mathbb {R}_+\rightarrow \mathbb {C}\) we have that for \(x\ne y\)

$$\begin{aligned} {D}^{\beta }\big (F(r(x,y))\big )= & {} F'\big (r(x,y)\big )\big ({D}^\beta r(x,y)\big ),\nonumber \\ {D}^{\alpha }\big (F(r(x,y))\big )= & {} F^{\prime \prime }\big (r(x,y)\big )\big ({D}^\beta r(x,y)\big )\big ({D}^\gamma r(x,y)\big )+ F'\big (r(x,y)\big )\big ({D}^{\alpha }r(x,y)\big ). \end{aligned}$$
(36)

From \(|x_i-y_i|\le r(x,y)\) and the values of the following partial derivatives for \(i,j=1,\ldots ,n\):

$$\begin{aligned} \frac{\partial r(x,y)}{\partial x_i}= & {} - \frac{\partial r(x,y)}{\partial y_i}= \frac{(x_i-y_i)}{r(x,y)}, \\ \frac{\partial ^2 r(x,y)}{\partial x_i\partial x_j}= & {} -\frac{\partial ^2 r(x,y)}{\partial x_i\partial y_j} =\frac{-(x_i-y_i)(x_j-y_j)}{r(x,y)^3}, \qquad i\ne j,\\ \frac{\partial ^2 r(x,y)}{\partial x_i^2}= & {} -\frac{\partial ^2 r(x,y)}{\partial x_i\partial y_i} =\frac{1}{r(x,y)} - \frac{(x_i-y_i)^2}{r(x,y)^3}, \end{aligned}$$

we obtain

$$\begin{aligned} |{D}^\beta r(x,y)|\le 1, \qquad |{D}^\gamma r(x,y)|\le 1, \qquad |{D}^\alpha r(x,y)|\le \dfrac{1}{r(x,y)}. \end{aligned}$$

Inserting these in (36) gives, for all \(\alpha ,\beta \in \mathbb {N}_0^{2n}\) with \(|\beta |=1\) and \(|\alpha |=2\),

$$\begin{aligned} \big |{D}^\beta \big (F(r(x,y))\big )\big |\le & {} \big |F'\big (r(x,y)\big )\big |,\nonumber \\ \big |{D}^\alpha \big (F(r(x,y))\big )\big |\le & {} \big |F''\big (r(x,y)\big )\big |+\frac{\big |F'\big (r(x,y)\big )\big |}{r(x,y)}. \end{aligned}$$
(37)

Now recall that \(\Phi _t(x,y)=\tilde{\Phi }_t(r(x,y))\), where

$$\begin{aligned} \tilde{\Phi }_t(r) = \left\{ \begin{array}{cc} \log r,&{}t=0,\\ \dfrac{1}{r^{t}},&{}t>0. \end{array}\right. \end{aligned}$$

Elementary computations show that

$$\begin{aligned} \tilde{\Phi }'_t(r) = \left\{ \begin{array}{cc} \dfrac{1}{r},&{}t=0,\\ -\dfrac{t}{r^{t+1}},&{}t>0, \end{array}\right. \qquad \text {and}\qquad \tilde{\Phi }^{\prime \prime }_t(r) = \left\{ \begin{array}{cc} -\dfrac{1}{r^2},&{}t=0,\\ \dfrac{t(t+1)}{r^{t+2}},&{}t>0. \end{array}\right. \end{aligned}$$
(38)

Inserting these results into (37) (with \(F=\tilde{\Phi }_t\)) gives the claimed result.

\(\square\)

4.2 Single integrals

We consider first the evaluation of the single integral

$$\begin{aligned} I_\Gamma [\Phi _t(\cdot , \eta )] = \int _\Gamma \Phi _t(x,\eta )\,\mathrm {d}{\mu }(x), \end{aligned}$$
(39)

for \(\eta \in \mathbb {R}^n\). When \(\eta \not \in \Gamma\) the integral is regular, and combining Theorem 3.6(iii) and Lemma 4.1 gives the following error estimate for the barycentre rule.

Proposition 4.2

Let \(\Gamma\) and \(\mu\) be as in Sections 2.2 and 2.5. Let \(h>0\) and let \(\Gamma _{\mathrm {Hull},h}\) be as in (33). Let \(\eta \in \mathbb {R}^n\setminus \Gamma _{\mathrm {Hull},h}\). Then

$$\begin{aligned} \left| I_{\Gamma }[\Phi _t(\cdot ,\eta )] -Q^h_{\Gamma }[\Phi _t(\cdot ,\eta )]\right|&\le {\frac{na_th^2 {\mu }(\Gamma ) }{2{{\,\mathrm{dist}\,}}(\eta ,\Gamma _{\mathrm {Hull},h})^{t+2}}.} \end{aligned}$$

When \(\eta \in \Gamma\) the integral is singular, but convergent for sufficiently small t. In the case \(\mu =\mathcal {H}^d|_\Gamma\) we have convergence for \(0\le t<d\le n\), for any \(\eta \in \Gamma\) (see Corollary A.2). For a general invariant measure, the situation is more complicated and the integrability threshold depends on \(\eta\) (see the discussion in Section 1). In the special case where \(\eta\) is the fixed point of one of the contracting similarities \(s_m\) defining \(\Gamma\), we have convergence for \(0\le t<t_m\) (see Lemma A.3), where

$$\begin{aligned} t_m:=\frac{\log p_m}{\log \rho _m}. \end{aligned}$$
(40)

Furthermore, in this case the singular integral can be written in terms of regular integrals, as the following result shows. We remind the reader that if \(\mu =\mathcal {H}^d|_\Gamma\) then \(p_m=\rho _m^d\) and \(t_m=d\).

Theorem 4.3

Let \(\Gamma\) and \(\mu\) be as in Sections 2.2 and 2.5. Fix \(m\in \{1,\ldots ,M\}\) and let \(\eta _{m}\) denote the fixed point of the contracting similarity \(s_{m}\), i.e. the unique point \(\eta _{m}\in \Gamma\) such that \(s_m(\eta _m)=\eta _m\). Suppose that \(\eta _m\not \in \Gamma _{m'}\) for any \(m'\in \{1,\ldots ,M\}\), \(m'\ne m\). (This holds, for instance if  \(\Gamma\) is disjoint in the sense of (13).) Then the singular integral (39) is finite for \(0\le t<t_m\), where \(t_m\) is defined in (40), and it can be represented in terms of regular integrals, as:

$$\begin{aligned} I_\Gamma [\Phi _t(\cdot , \eta _{m})]= \left\{ \begin{array}{ll} \displaystyle (1- {p_m})^{-1}\Bigg ( {p_m} {\mu }(\Gamma )\log \rho _{m} + {\sum_{ \underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}^{M}} I_{\Gamma _{m'}}[\Phi _t(\cdot ,\eta _m)]\Bigg ),&{}\quad t=0,\\ \displaystyle (1- {p_m}\rho ^{-t}_{m})^{-1}{\sum_{\underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}^{M}} I_{\Gamma _{m'}}[\Phi _t(\cdot ,\eta _m)], &{}\quad t\in (0, {t_m}). \end{array} \right. \end{aligned}$$

Proof

The integrability result is proved in Lemma A.3. To prove the claimed decomposition, we first split the integral, writing

$$\begin{aligned} I_{\Gamma }[\Phi _t(\cdot ,\eta _{m})]= \underbrace{I_{\Gamma _m}[\Phi _t(\cdot ,\eta _{m})]}_{\text {singular integral}}+ {\overset{M}{\underset{m'=1}{\underset{m'\ne {m}}{\sum }}}} \underbrace{I_{\Gamma _{m'}}[\Phi _t(\cdot ,\eta _{m})]}_{\text {regular integral}}. \end{aligned}$$
(41)

Focusing on the singular term, by (20) and the fact that \(s_m(\eta _m)=\eta _m\) we can write

$$\begin{aligned} I_{\Gamma _m}[\Phi _t(\cdot ,\eta _{m})]= & {} \int _{\Gamma _{m}}\Phi _t(x,\eta _{m})\,\mathrm {d}{\mu }(x)\\= & {} {p_m}\int _{\Gamma }\Phi _t(s_m(x),\eta _{m})\,\mathrm {d}{\mu }(x)\\= & {} {p_m}\int _{\Gamma }\Phi _t(s_m(x),s_m(\eta _{m}))\,\mathrm {d}{\mu }(x)\\= & {} {p_m}\int _{\Gamma }\Phi _t(\rho _m A_mx+\delta _m,\rho _m A_m \eta _{m}+\delta _m)\,\mathrm {d}{\mu }(x)\\= & {} {p_m}\int _{\Gamma }\Phi _t(\rho _mx,\rho _m\eta _{m})\,\mathrm {d}{\mu }(x), \end{aligned}$$

using the fact that \(\Phi _t\) is translation and rotation invariant. Then, applying (35) gives

$$\begin{aligned} I_{\Gamma _m}[\Phi _t(\cdot ,\eta _{m})] =\left\{ \begin{array}{ll} {p_m}\left( {\mu }(\Gamma )\log \rho _{m}+I_{\Gamma }[\Phi _t(\cdot ,\eta _{m})]\right) ,&{}t=0,\\ {p_m}\rho _{m}^{-t}I_{\Gamma }[\Phi _t(\cdot ,\eta _{m})] ,&{}t\in (0, {t_m}). \end{array}\right. \end{aligned}$$
(42)

Substituting (42) into (41) and solving for \(I_{\Gamma }[\Phi _t(\cdot ,\eta _{m})]\), we obtain the result.

\(\square\)

Theorem 4.3 can be combined with any quadrature rule capable of evaluating the regular integrals \(I_{\Gamma _{m'}}[\Phi _t(\cdot ,\eta _{m})]\), \(m'\ne m\), to produce a quadrature rule for evaluating the singular integral (39) when \(\eta =\eta _m\). In particular, given \(h>0\), applying the barycentre rule of Definition 3.1 with \(\Gamma\) replaced by \(\Gamma _{m'}\) and \(\mathcal {I}=L_h(\Gamma _{m'})\), for each \(m'\ne m\), produces the following quadrature rule:

$$\begin{aligned} Q^h_{\Gamma ,t,m} := \left\{ \begin{array}{ll} \displaystyle (1- {p_m})^{-1}\Bigg ( {p_m} {\mu }(\Gamma )\log (\rho _{m}) + {\overset{M}{\underset{m'\ne {m}}{\underset{m'=1}{\sum }}}} Q^h_{\Gamma _{m'}}[\Phi _t(\cdot , \eta _{m})] \Bigg ),&{}t=0,\\ \displaystyle (1- {p_m}\rho ^{-t}_{m})^{-1} {\overset{M}{\underset{m'\ne {m}}{\underset{m'=1}{\sum }}}} Q^h_{\Gamma _{m'}}[\Phi _t(\cdot , \eta _{m})],&{}t\in (0, {t_m}). \end{array}\right. \end{aligned}$$
(43)

This quadrature formula could be used for the implementation of a collocation-type discretisation of the integral equations in [9], with the collocation nodes chosen as fixed points of the self-similar subsets of the IFS attractor used as the BEM elements in [9]. This discretisation is not investigated in [9].

Corollary 4.4

Let \(\Gamma\), m, \(\eta _m\) and \({t_m}\) be as in Theorem 4.3. Let \(0<h<{{\,\mathrm{diam}\,}}(\Gamma )\), and suppose that \(\eta _m\not \in \mathrm {Hull}(\Gamma _{\varvec{m}'})\) for each \(\varvec{m}'\in L_h(\Gamma )\) such that \(m'_1\ne m\). Then the quadrature rule defined by (43) for the integral (39) with \(\eta =\eta _m\) satisfies the error estimate

$$\begin{aligned} \left| I_\Gamma [\Phi _t(\cdot , \eta _{m})] - Q^h_{\Gamma ,t,m} \right| \le {\frac{na_th^2 {\mu }(\Gamma )}{2(1- {p_m}\rho ^{-t}_{m})R_{m,h}^{t+2}}, \qquad {0\le t<t_m,}} \end{aligned}$$

where

$$\begin{aligned} R_{m,h}:={\underset{m_1'\ne m}{\underset{\varvec{m}'\in L_h(\Gamma )}{\min }}}{{\,\mathrm{dist}\,}}\big (\eta _m,\mathrm {Hull}(\Gamma _{\varvec{m}'})\big ) >0. \end{aligned}$$
(44)

Proof

For \({0\le t<t_m}\), we have from Theorem 4.3 and Eq. (43) that

$$\begin{aligned}&\left| I_\Gamma [\Phi _t(\cdot , \eta _{m})] - Q^h_{\Gamma ,t,m} \right| \\\le & {} \displaystyle (1- {p_m}\rho ^{-t}_{m})^{-1} {\overset{M}{\underset{m'\ne {m}}{\underset{m'=1}{\sum }}}} \left| I_{\Gamma _{m'}}[\Phi _t(\cdot ,\eta _{m})] -Q^h_{\Gamma _{m'}}[\Phi _t(\cdot ,\eta _{m})] \right| , \end{aligned}$$

and the result follows by applying Proposition 4.2 to each term in the sum, and recalling (22) to see that \({\sum\nolimits_{\underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}^{M}} \mu (\Gamma _{m'})\le \mu (\Gamma )\).

\(\square\)

The separation parameter \(R_{m,h}\) introduced in (44) is used only in the statement of Corollary 4.4, and is compared to other related parameters in Remark 4.8. The relative error and the behaviour of the bound in the limit \((d-t)\rightarrow 0\) are analysed for the case of homogeneous IFSs with \(\mu =\mathcal {H}^d|_\Gamma\) in Section 4.4.

4.3 Double integrals

We now consider the evaluation of the double integral

$$\begin{aligned} I_{\Gamma ,\Gamma '}[\Phi _t]=\int _{\Gamma }\int _{\Gamma '}\Phi _t(x,y)\,\mathrm {d}{\mu '}(y)\,\mathrm {d}{\mu }(x). \end{aligned}$$
(45)

When \(\Gamma\) and \(\Gamma '\) are disjoint the integral is regular, and combining Theorem 3.7(iii) and Lemma 4.1 gives the following error estimate for the barycentre rule.

Proposition 4.5

Let \(\Gamma ,\Gamma '\subset \mathbb {R}^{n}\) and \(\mu ,\mu '\) be as in Sections 2.2 and 2.5. Let \(h>0\) and let \(\Gamma _{\mathrm {Hull},h}\) be as in (33) and \(\Gamma _{\mathrm {Hull},h}'\) be as in (33) with \(\Gamma\) replaced by \(\Gamma '\). Suppose that \(\Gamma _{\mathrm {Hull},h}\cap \Gamma _{\mathrm {Hull},h}'=\emptyset\). Then

$$\begin{aligned} \left| I_{\Gamma ,\Gamma '}[\Phi _t] -Q^h_{\Gamma ,\Gamma '}[\Phi _t]\right|&\le \frac{2na_th^2 {\mu }(\Gamma ) {\mu '}(\Gamma ')}{{{\,\mathrm{dist}\,}}(\Gamma _{\mathrm {Hull},h},\Gamma _{\mathrm {Hull},h}')^{t+2}}. \end{aligned}$$

When \(\Gamma\) and \(\Gamma '\) are not disjoint (45) is a singular integral, which converges only for sufficiently small t. Suppose for simplicity that \(\Gamma '=\Gamma\). Then in the case \(\mu =\mu '=\mathcal {H}^d|_\Gamma\) we have convergence for \(0\le t<d\le n\) (see Corollary A.2). For a more general pair of invariant measures \(\mu\) and \(\mu '\) on \(\Gamma\), with respective (possibly different) weights/probabilities \((p_1,\ldots ,p_M)\) and \((p_1',\ldots ,p_M')\), if \(\Gamma\) is disjoint then the integral converges for \(0\le t<t_*\) (see Lemma A.4), where \(t_{*}\) is the unique positive solution of

$$\begin{aligned} \sum \limits _{m=1}^M p_mp_m' \rho _m^{-t_*}=1. \end{aligned}$$
(46)

In the disjoint case, the singular integral (when it converges) can be written purely in terms of regular integrals, as the following result shows. This was noted previously for the case of Cantor sets in e.g. [7]. We remind the reader that if \(\mu =\mu '=\mathcal {H}^d|_\Gamma\) then \(p_m=p_m'=\rho _m^d\) and \(t_*=d\).

Theorem 4.6

Let \(\Gamma \subset \mathbb {R}^n\) be as in Section 2.2, and let \(\mu ,\mu '\) be as in Section 2.5. Suppose that \(\Gamma\) is disjoint in the sense of (13). Then the singular double integral (45) with \(\Gamma '=\Gamma\) converges for \(0\le t<t_*\), where \(t_*\) is the unique positive solution of (46), and it can be represented in terms of regular integrals, as:

$$I_{\Gamma ,\Gamma }[\Phi _t] = \left\{ \begin{array}{ll} \displaystyle\left(1-\sum_{m=1}^M {p_mp_m'}\right)^{-1} \sum_{m=1}^M\Bigg ({p_mp_m'} {\mu }(\Gamma ) {\mu '}(\Gamma ) \log (\rho _m) +{\sum_{ \underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}} I_{\Gamma _m,\Gamma _{m'}}[\Phi _t] \Bigg ), & t=0,\\ \displaystyle \bigg (1-\sum _{m=1}^M {p_mp_m'}\rho ^{-t}_m\bigg )^{-1}\sum _{m=1}^M {\sum_{\underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}^{M}} I_{\Gamma _m,\Gamma _{m'}}[\Phi _t], \quad& t\in (0,t_*). \end{array}\right.$$

Proof

The integrability result is proved in Lemma A.4. To prove the claimed decomposition, as in the single integral case we begin by splitting the integral, writing

$$\begin{aligned} I_{\Gamma ,\Gamma }[\Phi _t] =\sum_{m=1}^M \underbrace{I_{\Gamma _m,\Gamma _m}[\Phi _t]}_{\text {singular integral}} + \sum _{m=1}^M{\sum_{ \underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}^{M}}\,\,\underbrace{I_{\Gamma _m,\Gamma _{m'}}[\Phi _t]}_{\text {regular integral}} . \end{aligned}$$
(47)

By applying (20) (for both \(\mu\) and \(\mu '\)), (35), and the fact that \(\Phi _t\) is translation and rotation invariant, the singular integrals in (47) can be written as

$$\begin{aligned} I_{\Gamma _m,\Gamma _m}[\Phi _t]= & {} \int _{{\Gamma _m}}\int _{{\Gamma _m}}\Phi _t\left( x,y\right) \mathrm {d}{\mu '}(y)\mathrm {d}{\mu }(x) \\= & {} { {p_mp_m'}}\int _{\Gamma }\int _{\Gamma }\Phi _t\left( s_m(x),s_m(y)\right) \mathrm {d}{\mu '}(y)\mathrm {d}{\mu }(x)\\= & {} { {p_mp_m'}}\int _{\Gamma }\int _{\Gamma }\Phi _t\left( \rho _mx,\rho _my\right) \mathrm {d}{\mu '}(y)\mathrm {d}{\mu }(x)\\= & {} {\left\{ \begin{array}{ll} \displaystyle { {p_mp_m'}}\left( {\mu }(\Gamma ) {\mu '}(\Gamma )\log (\rho _m)+I_{\Gamma ,\Gamma }[\Phi _t]\right) ,&{}\quad t=0,\\ { {p_mp_m'}\rho _m^{-t}}I_{\Gamma ,\Gamma }[\Phi _t],&{}\quad t\in (0, {t_*}). \end{array}\right. } \end{aligned}$$

Substituting this expression into (47) and solving for \(I_{\Gamma ,\Gamma }[\Phi _t]\) gives the claimed result.

\(\square\)

By combining Theorem 4.6 with a suitable quadrature rule for evaluating the regular integrals \(I_{\Gamma _m,\Gamma _{m'}}[\Phi _t]\), \(m'\ne m\), we can obtain a quadrature rule for evaluating the singular integral (45). In particular, given \(h>0\), applying the barycentre rule of Definition 3.5 with \(\Gamma ,\Gamma '\) replaced by \(\Gamma _m,\Gamma _{m'}\) and with \(\mathcal {I}=L_h(\Gamma _m)\) and \(\mathcal {I}'=L_h(\Gamma _{m'})\) for each pair \((m,m')\) such that \(m'\ne m\) produces the following quadrature rule:

$$\begin{aligned}&Q^h_{\Gamma ,\Gamma ,t}:= \nonumber \\&\left\{ \begin{array}{lr} \bigg (1-\sum \limits _{m=1}^M {p_mp_m'}\bigg )^{-1}\sum \limits _{m=1}^M \Bigg ( {p_mp_m'} {\mu }(\Gamma ) {\mu '}(\Gamma )\log (\rho _m) + {\sum_{\underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}} Q^h_{\Gamma _m,\Gamma _{m'}}[\Phi _t] \Bigg ), &{} t=0,\\ \displaystyle \bigg (1-\sum \limits _{m=1}^M {p_mp_m'}\rho ^{-t}_m\bigg )^{-1}\sum \limits _{m=1}^M {\sum_{\underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}^{M}} Q^h_{\Gamma _m,\Gamma _{m'}}[\Phi _t], &t\in (0, {t_*}). \end{array}\right. \end{aligned}$$
(48)

Corollary 4.7

Let \(\Gamma\), \(\mu\), \(\mu '\) and t be as in Theorem 4.6. Let \(0<h<{{\,\mathrm{diam}\,}}(\Gamma )\), and assume that \(\mathrm {Hull}(\Gamma _{\varvec{m}})\cap \mathrm {Hull}(\Gamma _{\varvec{m}'})=\emptyset\) for all \(\varvec{m},\varvec{m}'\in L_h(\Gamma )\) such that \(m_1\ne m_1'\). Then the quadrature rule defined by (48) for the integral (45) satisfies the error estimate

$$\begin{aligned} \left| I_{\Gamma ,\Gamma }[\Phi _t] - Q^h_{\Gamma ,\Gamma ,t}\right| \le {\dfrac{2na_t h^2 {\mu }(\Gamma ) {\mu '}(\Gamma )}{\displaystyle \bigg (1-\sum \limits _{m=1}^M {p_mp_m'}\rho ^{-t}_m\bigg )R_{\Gamma ,\mathrm {Hull},h}^{t+2}},} \end{aligned}$$

where

$$\begin{aligned} R_{\Gamma ,\mathrm {Hull},h}:=\min _{\begin{array}{c} \varvec{m},\varvec{m}'\in L_h(\Gamma )\\ m_1\ne m_1' \end{array}} {{\,\mathrm{dist}\,}}\big (\mathrm {Hull}(\Gamma _{\varvec{m}}),\mathrm {Hull}(\Gamma _{\varvec{m}'})\big ) \ge R_{\Gamma ,\mathrm {Hull}}. \end{aligned}$$
(49)

Proof

The proof is similar to that of Corollary 4.4. For \(0\le t< {t_*}\), we have

$$\begin{aligned} \left| I_{\Gamma ,\Gamma }[\Phi _t] - Q^h_{\Gamma ,\Gamma ,t} \right| = \bigg (1-\sum \limits _{m=1}^M {p_mp_m'}\rho ^{-t}_m\bigg )^{-1}\sum \limits _{m=1}^M {\sum_{\underset{\scriptstyle m^{\prime}\ne {m}}{m^{\prime}=1}}^{M}} \left| I_{\Gamma _m,\Gamma _{m'}}[\Phi _t] - Q^h_{\Gamma _m,\Gamma _{m'}}[\Phi _t]\right| , \end{aligned}$$

and the result follows by applying Proposition 4.5 to each term in the sum.

\(\square\)

Remark 4.8

So far, we have introduced four different parameters quantifying the distance between self-similar subsets of an IFS attractor \(\Gamma\):

  • \(R_\Gamma\) in (13), which measures the minimum distance between level-1 subsets,

  • \(R_{\Gamma ,\mathrm {Hull}}\) in (14), which measures the minimum distance between the convex hulls of level-1 subsets,

  • \(R_{m,h}\) in (44), which measures the minimum distance between a fixed point \(\eta _m\) of \(s_m\) and the convex hulls of subsets of \(\Gamma \setminus \Gamma _m\) of diameter approximately h,

  • \(R_{\Gamma ,\mathrm {Hull},h}\) in (49), which measures the minimum distance between the convex hulls of pairs of subsets, taken from different level-1 subsets, of approximate diameter h.

Recall that \(R_{m,h}\) and \(R_{\Gamma ,\mathrm {Hull},h}\) are defined only for \(0<h<{{\,\mathrm{diam}\,}}(\Gamma )\). They satisfy the inequalities

$$\begin{aligned} 0\le R_{\Gamma ,\mathrm {Hull}}\le R_{\Gamma ,\mathrm {Hull},h}\le R_\Gamma ,\qquad R_{\Gamma ,\mathrm {Hull},h}\le \min _{m=1,\ldots ,M} R_{m,h}. \end{aligned}$$

In particular, Corollaries 4.4 and 4.7 show how \(R_{m,h}\) and \(R_{\Gamma ,\mathrm {Hull},h}\) quantify the expected deterioration of the quadrature accuracy due to the vicinity of the integrand singularity, for single and double integrals (\(I_\Gamma [\Phi _t(\cdot ,\eta _m)]\) and \(I_{\Gamma ,\Gamma }[\Phi _t]\)), respectively.

Table 2 shows the values of these parameters for the four examples in Fig. 1. The values of \(R_{m,h}\) and \(R_{\Gamma ,\mathrm {Hull},h}\) are valid for all sufficiently small h (e.g. \(R_{5,h}=0\) for (III) and \(h\ge \sqrt{2}/3\)).

We are not aware of any IFS attractor satisfying the open set condition with \(R_{m,h}=0\) for some m, i.e. with \(\eta _m\in \mathrm {Hull}(\Gamma _{\varvec{m}'})\) for \(\varvec{m}'\in L_h(\Gamma )\) and \(m_1'\ne m\).

Table 2 The values of the separation parameters described in Remark 4.8 for the IFS attractors of Fig. 1, for sufficiently small h

4.4 Relative errors and dependence on N for homogeneous IFSs and Hausdorff measure

In this section, we show how the error bounds we derived for the singular integrals in Sections 4.2 and 4.3 can be written in terms of the quantity \(N:=|L_h(\Gamma )|\), as was discussed for the regular integrals of Section 3.3 in Remark 3.9. As well as allowing us to determine the dependence of our error bounds on the computational cost of the quadrature rules, this also allows us to clarify the limiting behaviour of our bounds as \((d-t)\rightarrow 0\). To this purpose, we now consider relative errors, and restrict our attention in this section to homogeneous IFSs and the case \(\mu =\mu '=\mathcal {H}^d|_\Gamma\).

For a homogeneous IFS, we have \(N=|I_\ell |=M^\ell\) for \(\ell\) as in (24). The number of evaluations of the integrand \(\Phi _t\) required for the computation of the quadrature formulas is \((M-1)M^{\ell -1}=\frac{M-1}{M} N\) for the single-integral formula (43) and \((M-1)M^{2\ell -1}=\frac{M-1}{M} N^2\) for the double-integral formula (48).

Let us consider first the case \(t>0\). From (71) we have the lower bounds:

$$\begin{aligned} \begin{aligned}&I_\Gamma [\Phi _t(\cdot ,\eta )]\ge \frac{\tilde{c}_1d}{d-t}\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{d-t},\\&I_{\Gamma ,\Gamma }[\Phi _t]\ge \frac{\tilde{c}_1d}{d-t}\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{d-t}\mathcal {H}^d(\Gamma ), \end{aligned} \qquad \eta \in \Gamma , \quad 0<t<d. \end{aligned}$$

Recall that \(\tilde{c}_1>0\), defined in (6), is an intrinsic parameter of the d-set \(\Gamma\), independent of its characterization as an IFS attractor. Then, using that for a homogeneous IFS and the case \(\mu =\mu '=\mathcal {H}^d|_\Gamma\) we have \({\sum _{m=1}^Mp_m^2\rho _m^{-t}=}\sum _{m=1}^M\rho ^{2d-t}= \rho ^{d-t}\) from \(M\rho ^d=1\) in (12), Corollaries 4.4 and 4.7 imply the following relative error estimates:

$$\begin{aligned} \frac{\left| I_\Gamma [\Phi _t(\cdot , \eta _{m})] - Q^h_{\Gamma ,t,m}\right| }{\big |I_\Gamma [\Phi _t(\cdot ,\eta _m)]\big |} \le \frac{\mathcal {E}_t}{R_{m,h}^{t+2}}, \qquad \frac{\left| I_{\Gamma ,\Gamma }[\Phi _t] - Q^h_{\Gamma ,\Gamma ,t}\right| }{\big |I_{\Gamma ,\Gamma }[\Phi _t]\big |} \le \frac{4\,\mathcal {E}_t}{R_{\Gamma ,\mathrm {Hull},h}^{t+2}}, \end{aligned}$$
(50)

where

$$\begin{aligned} \mathcal {E}_t:=\frac{na_th^2\mathcal {H}^d(\Gamma )(d-t)}{2\tilde{c}_1d\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{d-t}(1-\rho ^{d-t})}. \end{aligned}$$

To bound \(\mathcal {E}_t\), we first note that, for \(0<z,\rho <1\), we have \(\rho ^z\le 1-z(1-\rho )\) (by comparison of an affine and a convex function of z that coincide for \(z=0\) and \(z=1\)), so that

$$\begin{aligned} \frac{d-t}{1-\rho ^{d-t}}\le \frac{d-t}{1-1+(d-t)(1-\rho )}=\frac{1}{1-\rho }. \end{aligned}$$
(51)

Moreover, from \(|\log \rho |=\log \frac{1}{\rho }\le \frac{1}{\rho }-1=\frac{1-\rho }{\rho }\) we have \(\displaystyle |\log \rho |(\frac{1}{1-\rho }-1)=|\log \rho |(\frac{\rho }{1-\rho })\le 1\) and hence

$$\begin{aligned} \frac{|\log \rho |}{1-\rho }\le 1+|\log \rho |. \end{aligned}$$
(52)

Then, using also \(d=\frac{\log M}{|\log \rho |}\), \(\rho =M^{-1/d}\) and \(h\le \frac{{{\,\mathrm{diam}\,}}(\Gamma )}{\rho \, N^{1/d}}\) (see (34)), we can bound

$$\begin{aligned} \mathcal {E}_t & \overset{(51)}{\le }\frac{na_t\,h^2\, \mathcal {H}^d(\Gamma )|\log \rho |}{2\tilde{c}_1\log M\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{d-t}(1-\rho )} \nonumber \\ & \overset{(52)}{\le }\frac{na_t\, h^2\, \mathcal {H}^d(\Gamma )(1+|\log \rho |)}{2\tilde{c}_1\log M\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{d-t}} \nonumber \\ & \le \frac{na_t\mathcal {H}^d(\Gamma )\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{2-d+t}\; (1+|\log \rho |)}{2\tilde{c}_1(\log M)\rho ^2} N^{-2/d}\nonumber \\ & = \frac{na_t\mathcal {H}^d(\Gamma )\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{2-d+t}}{2\tilde{c}_1\log M} \;\Big (1+\frac{\log M}{d}\Big )\Big (\frac{N}{M}\Big )^{-2/d}\nonumber \\ & \le \frac{na_t\mathcal {H}^d(\Gamma )\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{2-d+t}}{2\tilde{c}_1\log 2} \;\Big (1+\frac{1}{d}\Big ) \Big (\frac{N}{M}\Big )^{-2/d}. \end{aligned}$$
(53)

Combined with (50), this reveals the dependence of the relative error on the computational cost, through the parameter N; specifically, the errors are \(O(N^{-2/d})\) as \(N\rightarrow \infty\). The above bound can also be written in terms of the refinement level \(\ell\) using \(\frac{N}{M}=M^{\ell -1}\), giving exponential convergence at the rate \(M^{-2\ell /d}\) as \(\ell \rightarrow \infty\).

While the bounds on the absolute errors in Corollaries 4.4 and 4.7 blow up in the limit \(t\nearrow d\) (with N fixed), the bounds (50) and (53) show that the corresponding relative errors are bounded in this limit because the integrals being approximated also blow up at the same rate. Similarly, for a sequence of IFSs with \(d\searrow t>0\) (and with M constant, \(\tilde{c}_1\) and \(R_{\Gamma ,\mathrm {Hull}}\) uniformly bounded away from zero, and \(\mathcal {H}^d(\Gamma )\) and \({{\,\mathrm{diam}\,}}(\Gamma )\) uniformly bounded above), the absolute errors blow up while the relative errors are uniformly bounded. Furthermore, the same is true (again for fixed N) in the case where \(d\searrow 0\) and \(t\searrow 0\) with \(d>t\), since the algebraic growth of the \(\frac{1}{d}\) term in (53) is controlled by the exponential decay of the factor \((\frac{N}{M})^{-2/d}\) (provided \(\ell \ge 2\)).

In the case \(t=0\), the logarithmic function \(\Phi _0\) changes sign, so it is not in general possible to bound its integrals from below. Thus, we assume that \({{\,\mathrm{diam}\,}}(\Gamma )\le 1\). Under this assumption, for all \(\eta \in \Gamma\), (71) gives

$$\begin{aligned} \big |I_\Gamma [\Phi _0(\cdot ,\eta )]\big |= & {} -I_\Gamma [\Phi _0(\cdot ,\eta )]\\\ge & {} \tilde{c}_1 d\int _0^{{{\,\mathrm{diam}\,}}(\Gamma )}-r^{d-1}\log r\,\mathrm {d}r= \tilde{c}_1\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^d\Big (\frac{1}{d}-\log {{\,\mathrm{diam}\,}}(\Gamma )\Big ),\\ \big |I_{\Gamma ,\Gamma }[\Phi _0]\big |= & {} -I_{\Gamma ,\Gamma }[\Phi _0] \ge \tilde{c}_1\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^d\Big (\frac{1}{d}-\log {{\,\mathrm{diam}\,}}(\Gamma )\Big )\mathcal {H}^d(\Gamma ). \end{aligned}$$

Proceeding as above and using \(a_0=2\), \(\log {{\,\mathrm{diam}\,}}(\Gamma )\le 0\), and \(\frac{1}{1-\rho ^d}=\frac{M}{M-1}\le 2\), the bound (50) on the relative error extends to the case \(t=0\) with

$$\begin{aligned} \mathcal {E}_0:= & {} \frac{n a_0 h^2\mathcal {H}^d(\Gamma )}{2(1-\rho ^d) \, \tilde{c}_1\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^d(\frac{1}{d}-\log {{\,\mathrm{diam}\,}}(\Gamma ))}\\\le & {} \frac{2 n \mathcal {H}^d(\Gamma )\big ({{\,\mathrm{diam}\,}}(\Gamma )\big )^{2-d}}{\tilde{c}_1} d \bigg (\frac{N}{M}\bigg )^{-2/d}, \end{aligned}$$

which tends to 0 as \(d\searrow t= 0\).

Regarding sequences of IFS attractors for which \(d\searrow 0\), one can show for example that for any \(\epsilon >0\) the family of Cantor sets in \(\mathbb {R}\) defined by (11), for \(\rho \in (0,1/2-\epsilon )\), i.e. for \(d=\log 2/\log (1/\rho )\in (0,\log 2/\log (1/(1/2-\epsilon )))\subset (0,1)\), have \({{\,\mathrm{diam}\,}}(\Gamma )=\mathcal {H}^d(\Gamma )=1\) and \(\tilde{c}_1\) and \(R_{\Gamma ,\mathrm {Hull}}\) uniformly bounded away from 0.

5 Application to Galerkin Hausdorff BEM for acoustic scattering

We now apply our previous results to derive and analyse quadrature rules for the evaluation of

$$\begin{aligned} I_{\Gamma ,\Gamma '}[\Phi ]=\int _{\Gamma }\int _{\Gamma '}\Phi (x,y)\,\mathrm {d}\mathcal {H}^{d'}(y)\,\mathrm {d}\mathcal {H}^d(x), \end{aligned}$$
(54)

where \(\Gamma ,\Gamma '\subset \mathbb {R}^{n}\) are as in Section 2.2 and \(\Phi (x,y)\) is the fundamental solution of the Helmholtz equation in \(\mathbb {R}^{n+1}\), defined in (3). As (54) suggests, our focus on this section is on the case \(\mu =\mathcal {H}^d|_\Gamma\), \(\mu '=\mathcal {H}^{d'}|_\Gamma\). As explained in Section 1, integrals of the form (54) arise as the elements of the Galerkin matrix in the “Hausdorff BEM” described in [9], for acoustic scattering by fractal screens. We first consider (54) in the non-singular case where \(\Gamma\) and \(\Gamma '\) are disjoint, corresponding to the off-diagonal matrix entries in [9]. Our quadrature rule in this case is the composite barycentre rule, and the main result is Proposition 5.2. We then consider (54) in the singular case where \(\Gamma =\Gamma '\), corresponding to the diagonal matrix entries in [9]. Our quadrature rule for this case is defined in (60) and (61), and the main result is Theorem 5.7.

Before proceeding with the analysis, we note the following regularity estimate on \(\Phi\). Here and henceforth, \(a\lesssim b\) means \(a\le C b\) for some constant \(C>0\), independent of \(\Gamma\), \(\Gamma '\), h and k, which may change from occurrence to occurrence.

Lemma 5.1

For all \(\alpha \in \mathbb {N}_0^{2n}\) with \(|\alpha |=2\) and all \(x\ne y\)

$$\begin{aligned} \left| {D}^{\alpha }\Phi (x,y)\right| \lesssim \dfrac{(1+(k|x-y|)^{n/2+1})}{|x-y|^{n+1}}. \end{aligned}$$

Proof

The proof is analogous to that of Lemma 4.1. We first note that \(\Phi (x,y)=\tilde{\Phi }(r(x,y))\), where

$$\begin{aligned} \tilde{\Phi }(r) = \left\{ \begin{array}{cc} \dfrac{\mathrm {i}}{4}H_0^{(1)}(kr),&{}n=1,\\ \dfrac{\mathrm {e}^{\mathrm {i}kr}}{4\pi r},&{}n=2, \end{array}\right. \end{aligned}$$

and by standard calculations (e.g. [1, 10.6.2–3]) we find that

$$\begin{aligned} \tilde{\Phi }'(r) = \left\{ \begin{array}{cc} -\dfrac{\mathrm {i}k}{4}H_1^{(1)}(kr),\\ \dfrac{(\mathrm {i}k r-1)\mathrm {e}^{\mathrm {i}kr}}{4\pi r^2}, \end{array}\right. \quad \text {and } \tilde{\Phi }^{\prime \prime }(r) = \left\{ \begin{array}{cc} \dfrac{\mathrm {i}k^2}{4}\left( \dfrac{1}{kr}H_1^{(1)}(kr)-H_0^{(1)}(kr)\right) ,&{}n=1,\\ \dfrac{(2-2\mathrm {i}kr -(kr)^2)\mathrm {e}^{\mathrm {i}kr}}{4\pi r^3},&{}n=2. \end{array}\right. \end{aligned}$$
(55)

Inserting these results into (37) (with \(F=\tilde{\Phi }\)) gives the claimed result, after application of the following standard bounds (which follow from results in [1, Section 10]):

$$\begin{aligned} |H_0^{{(1)}}(z)|\lesssim \left\{ \begin{array}{cc} (1+|\log z|),&{}0<z\le 1,\\ z^{-1/2},&{}z>1, \end{array}\right. \qquad |H_1^{{(1)}}(z)|\lesssim \left\{ \begin{array}{cc} z^{-1},&{}0<z\le 1,\\ z^{-1/2},&{}z>1. \end{array}\right. \end{aligned}$$
(56)

\(\square\)

We now consider (54) in the non-singular case where \(\Gamma\) and \(\Gamma '\) are disjoint. The following result follows from Theorem 3.7(iii) and Lemma 5.1, and the fact that \((1+(kz)^{n/2+1})/z^{n+1}\) is a positive decreasing function on \((0,\infty )\) for \(n=1,2\).

Proposition 5.2

Let \(\Gamma \subset \mathbb {R}^n\) and \(\Gamma '\subset \mathbb {R}^{n}\) be as in Section 2.2. Let \(h>0\), and let \(\Gamma _{\mathrm {Hull},h}\) be as in (33) and \(\Gamma _{\mathrm {Hull},h}'\) be as in (33) with \(\Gamma\) replaced by \(\Gamma '\). Suppose that \(\Gamma _{\mathrm {Hull},h}\cap \Gamma _{\mathrm {Hull},h}'=\emptyset\). Then

$$\begin{aligned} \left| I_{\Gamma ,\Gamma '}[\Phi ] -Q^h_{\Gamma ,\Gamma '}[\Phi ]\right| \lesssim h^2\mathcal {H}^{d}(\Gamma )\mathcal {H}^{d'}(\Gamma ') \dfrac{\left( 1+(k\delta )^{n/2+1}\right) }{\delta ^{n+1}}, \qquad n=1,2, \end{aligned}$$

where \(\delta ={{\,\mathrm{dist}\,}}(\Gamma _{\mathrm {Hull},h},\Gamma _{\mathrm {Hull},h}')\).

We now turn to the singular case where \(\Gamma =\Gamma '\) and (54) becomes

$$\begin{aligned} I_{\Gamma ,\Gamma }[\Phi ]= \int _{\Gamma }\int _{\Gamma }\Phi (x,y)\,\mathrm {d}\mathcal {H}^{d}(y)\,\mathrm {d}\mathcal {H}^{d}(x). \end{aligned}$$
(57)

For fixed \(k>0\), we have (by [1, (10.8.2)] in the case \(n=1\)) that

$$\begin{aligned} \Phi (x,y)\sim C_n\Phi _{n-1}(x,y), \qquad |x-y|\rightarrow 0, \quad n=1,2, \end{aligned}$$
(58)

where

$$\begin{aligned} C_1=-1/(2\pi ) \text { and }C_2=1/(4\pi ). \end{aligned}$$

Furthermore, the function

$$\begin{aligned} \Phi _* := \Phi -C_n\Phi _{n-1} \end{aligned}$$

is continuous across \(x=y\) (in fact, Lipschitz continuous), with (see [1, 10.8.2] for the case \(n=1\))

$$\begin{aligned} \underset{x\rightarrow y}{\lim }\,\Phi _*(x,y) = {\left\{ \begin{array}{ll} \dfrac{- \log \left( k/2\right) - \gamma }{2 \pi }+\dfrac{\mathrm {i}}{4},&{} n=1,\\ \displaystyle\frac{\mathrm {i}k}{4\pi }, &{}n=2, \end{array}\right. } \qquad y\in \mathbb {R}^n. \end{aligned}$$

This motivates a singularity-subtraction approach for evaluating (57), using the splitting

$$\begin{aligned} \Phi = C_n\Phi _{n-1} + \Phi _*, \end{aligned}$$
(59)

integrating \(\Phi _{n-1}\) using the quadrature rules from Section 4, and \(\Phi _*\) using the composite barycentre rule. However, the application of (59) is complicated by the fact that while (59) is designed to deal efficiently with the singular behaviour (58), it is not well adapted to the oscillatory behaviour of \(\Phi\) as \(k|x-y|\rightarrow \infty\). To deal with this systematically, we introduce a parameter \(c_\mathrm{osc}>0\), proportional to the maximum number of wavelengths there can be across \(\Gamma\) for us to consider the integral non-oscillatory. We then define our quadrature rule for (57) differently depending on whether \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\) or \(k{{\,\mathrm{diam}\,}}(\Gamma )> c_\mathrm{osc}\). Note that the non-oscillatory regime \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\) is the one relevant for the BEM application in [9], since the diameter of the BEM elements in [9] needs to be small compared to the wavelength in order to achieve acceptable approximation error.

Definition 5.3

(Singularity-subtraction quadrature rule \(Q^h_{\Gamma ,\Gamma ,\Phi }\)) When \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\) we apply (59) directly to (57), approximating

$$\begin{aligned} I_{\Gamma ,\Gamma }[\Phi ]\approx Q^h_{\Gamma ,\Gamma ,\Phi }:= C_n Q^h_{\Gamma ,\Gamma ,n-1} + Q^h_{\Gamma ,\Gamma }[\Phi _*], \end{aligned}$$
(60)

where \(Q^h_{\Gamma ,\Gamma ,n-1}\) is defined as in (48).

When \(k{{\,\mathrm{diam}\,}}(\Gamma )>c_\mathrm{osc}\) we first partition \(\Gamma\) into subsets of diameter at most \(h_*:=c_\mathrm{osc}/k\) before applying (59) only to the singular terms in the resulting decomposition of (57), approximating

$$\begin{aligned} I_{\Gamma ,\Gamma }[\Phi ]\approx Q^h_{\Gamma ,\Gamma ,\Phi }:= & {} \sum \limits _{\varvec{m}\in L_{h_*}(\Gamma )} \bigg ( C_n Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}},n-1} + Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*]\bigg )\nonumber \\&+ \sum \limits _{\varvec{m}\in L_{h_*}(\Gamma )} {\sum_{\underset{\scriptstyle \varvec{m}'\ne \varvec{m}}{\varvec{m}'\in L_{h_*}}(\Gamma)}} Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi ], \end{aligned}$$
(61)

where \(Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}},n-1}\) is defined as in (48) with \(\Gamma\) replaced by \(\Gamma _{\varvec{m}}\).

For the error analysis of (60), we recall that an error estimate for \(Q^h_{\Gamma ,\Gamma ,n-1}\) was presented in Corollary 4.7, so it remains to derive an error estimate for \(Q^h_{\Gamma ,\Gamma }[\Phi _*]\). Naively applying Theorem 3.6 would result in an O(h) estimate for \(Q^h_{\Gamma ,\Gamma }[\Phi _*]\), because while \(\Phi _*\) is Lipschitz continuous across \(x=y\), its derivative is not Lipschitz. An \(O(h^2)\) estimate (matching that for \(Q^h_{\Gamma ,\Gamma ,n-1}\) provided by Corollary 4.7) can be obtained via a first-principles analysis, which we present in Proposition 5.5. We then apply this result to give a full error analysis of both (60) and (61) in Theorem 5.7. Our analysis is restricted to the case of a homogeneous IFS, but we expect that with further non-trivial work a similar analysis could be carried out for the non- homogeneous case—see the discussion before Theorem 5.11, where a weaker O(h) estimate is proved for the non-homogeneous case.

Our arguments will make use of the following bounds on the second-order derivatives of \(\Phi _*\).

Lemma 5.4

For all \(\alpha \in \mathbb {N}_0^{2n}\) with \(|\alpha |=2\) and all \(x\ne y\)

$$\begin{aligned} \left| {D}^{\alpha }\Phi _*(x,y)\right| \lesssim {\left\{ \begin{array}{ll} k^2\big (1+\big |\log (k|x-y|)\big |\big ), &{}n=1, \quad 0<k|x-y|\le 1, \\ \dfrac{k^2}{(k|x-y|)^{1/2}}, &{}n=1, \quad |x-y|>1,\\ \dfrac{k^2}{|x-y|}, &{}n=2. \end{array}\right. } \end{aligned}$$

Proof

The proof is analogous to that of Lemmas 4.1 and 5.1. We first note that \(\Phi _*(x,y)=\tilde{\Phi }_*(r(x,y))\), where \(\tilde{\Phi }_*:=\tilde{\Phi }-C_n\tilde{\Phi }_{n-1}\), so that combining (38) and (55) gives

$$\begin{aligned} \tilde{\Phi }_*'(r) = \left\{ \begin{array}{cc} -\dfrac{\mathrm {i}k}{4}\left( H_1^{(1)}(kr)+\dfrac{2\mathrm {i}}{\pi kr}\right) ,&{}n=1, \\ \dfrac{(\mathrm {i}k r-1)\mathrm {e}^{\mathrm {i}kr}+1}{4\pi r^2},&{}n=2, \end{array}\right. \end{aligned}$$

and

$$\begin{aligned} \tilde{\Phi }_{*}^{\prime \prime }(r) = \left\{ \begin{array}{cc} \dfrac{\mathrm {i}k^2}{4}\left( \dfrac{1}{kr}H_1^{(1)}(kr)-H_0^{(1)}(kr)+\dfrac{2\mathrm {i}}{\pi (kr)^2}\right) ,&{}n=1,\\ \dfrac{(2-2\mathrm {i}kr -(kr)^2)\mathrm {e}^{\mathrm {i}kr}-2}{4\pi r^3},&{}n=2. \end{array}\right. \end{aligned}$$

Using the series expansions for the exponential and the Hankel functions (see [1, 10.8.1]) and the bounds (56), one finds that

$$\begin{aligned} |\tilde{\Phi }_*'(r)| \lesssim \left\{ \begin{array}{cl} k^2r(1+|\log kr|), \\ \dfrac{k}{(kr)^{1/2}}, \\ \dfrac{k^2}{1+kr}, \end{array}\right. \quad |\tilde{\Phi }_{*}^{\prime \prime }(r)| \lesssim \left\{ \begin{array}{cl} k^2(1+|\log kr|), &{}n=1,\,0<kr\le 1, \\ \dfrac{k^2}{(kr)^{1/2}}, &{}n=1, \,kr>1,\\ \dfrac{k^3}{1+kr},&{}n=2. \end{array}\right. \end{aligned}$$
(62)

Inserting these bounds into (37) (with \(F=\tilde{\Phi }_*\)) gives the result.

\(\square\)

In what follows, we shall also make use of the fact that

$$\begin{aligned} \text {if}\quad 0<x_1\le x_2\le x_3<\infty \quad \text {then} \quad |\log x_2| \le |\log x_1|+ |\log x_3|, \end{aligned}$$
(63)

and that, in the case \(\mu =\mathcal {H}^d|_\Gamma\), for \(\varvec{m}\in L_h(\Gamma )\) it follows from (18) that

$$\begin{aligned} \mathcal {H}^d(\Gamma _{\varvec{m}}) \le \left( \frac{h}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d \mathcal {H}^d(\Gamma ). \end{aligned}$$
(64)

We now consider the approximation of \(I_{\Gamma ,\Gamma }[\Phi _*]\).

Proposition 5.5

Let \(\Gamma \subset \mathbb {R}^n\) be as in Section 2.2, with \(d=\text{dim}_{\mathrm{H}}(\Gamma )>n-1\). Suppose that \(\Gamma\) is homogeneous in the sense of Section 2.3, with contraction factor \(\rho \in (0,1)\). Suppose also that \(\Gamma\) is hull-disjoint in the sense of (14). Let \(k>0\) and suppose that \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\). Let \(0<h\le {{\,\mathrm{diam}\,}}(\Gamma )\). Then

$$\begin{aligned} \Big |I_{\Gamma ,\Gamma }[\Phi _*] -Q^h_{\Gamma ,\Gamma }[\Phi _*]\Big |&\lesssim ck^2h^2\big (\mathcal {H}^d(\Gamma )\big )^2 \le ck^2\big ({{\,\mathrm{diam}\,}}(\Gamma )\mathcal {H}^d(\Gamma )\big )^2\left( \frac{N}{M}\right) ^{-2/d}, \end{aligned}$$
(65)

where the constant implied in \(\lesssim\) depends only on \(c_\mathrm{osc}\) and

$$\begin{aligned} c = {\left\{ \begin{array}{ll} \dfrac{|\log {\rho }|}{\log {M}} +\big |\log (kR_{\Gamma ,\mathrm {Hull}})\big |= \dfrac{1}{d} +\big |\log (kR_{\Gamma ,\mathrm {Hull}})\big |, &{} n=1,\\ \dfrac{\rho M}{R_{\Gamma ,\mathrm {Hull}}(\rho M-1)}=\dfrac{1}{R_{\Gamma ,\mathrm {Hull}}(1- M^{1/d-1})}, &{} n=2. \end{array}\right. } \end{aligned}$$

Proof

We first note that

$$\begin{aligned} \left| I_{\Gamma ,\Gamma }[\Phi _*] -Q^h_{\Gamma ,\Gamma }[\Phi _*]\right|\le & {} \underbrace{ \sum \limits _{\varvec{m}\in L_{h}(\Gamma )} \left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*] \right| }_{=:S_1}\\&+ \underbrace{\sum \limits _{\varvec{m}\in L_{h}(\Gamma )} {\sum_{\underset{\scriptstyle \varvec{m}'\ne \varvec{m}}{\varvec{m}'\in L_{h}}(\Gamma)}} \left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi _*]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi _*] \right| }_{=:S_2}. \end{aligned}$$

For the analysis of \(S_1\) we note that for \(\varvec{m}\in L_h(\Gamma )\)

$$\begin{aligned}&\Big |I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*] \Big | \nonumber \\= & {} \left| \int _{\Gamma _{\varvec{m}}}\int _{\Gamma _{\varvec{m}}} \left( \Phi _*(x,y)-\Phi _*(x_{\varvec{m}},x_{\varvec{m}})\right) \,\mathrm {d}\mathcal {H}^d(y)\mathrm {d}\mathcal {H}^d(x)\right| \nonumber \\\le & {} \int _{\Gamma _{\varvec{m}}}\int _{\Gamma _{\varvec{m}}} \left| \tilde{\Phi }_*(r(x,y))-\tilde{\Phi }_*(0)\right| \,\mathrm {d}\mathcal {H}^d(y)\mathrm {d}\mathcal {H}^d(x). \end{aligned}$$
(66)

By (62) we have that, when \(kr\le c_\mathrm{osc}\),

$$\begin{aligned} |\tilde{\Phi }_*(r)-\tilde{\Phi }_*(0)| \lesssim {\left\{ \begin{array}{ll} (kr)^2(1+|\log {kr}|), &{} n=1,\\ k^2r, &{} n=2. \end{array}\right. } \end{aligned}$$

Since both \(z^2(1+|\log z|)\) and z are increasing functions of \(z\in (0,\infty )\), applying a uniform upper bound on the integrand in (66) (with \(r\le h\)), then summing over \(\varvec{m}\) and using (22) and (64) gives

$$\begin{aligned} S_1\le & {} |\tilde{\Phi }_*(h)-\tilde{\Phi }_*(0)|\sum \limits _{\varvec{m}\in L_{h}(\Gamma )} \mathcal {H}^d(\Gamma _{\varvec{m}})^2\\\le & {} |\tilde{\Phi }_*(h)-\tilde{\Phi }_*(0)|\left( \frac{h}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d\mathcal {H}^d(\Gamma ) \sum \limits _{\varvec{m}\in L_{h}(\Gamma )} \mathcal {H}^d(\Gamma _{\varvec{m}}) \\= & {} {|\tilde{\Phi }_*(h)-\tilde{\Phi }_*(0)|\left( \frac{h}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d\mathcal {H}^d(\Gamma )^2} \\\lesssim & {} k^2\left( \frac{h}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d\mathcal {H}^d(\Gamma )^2 {\left\{ \begin{array}{ll} h^2(1+|\log {kh}|), &{} n=1,\\ h, &{} n=2. \end{array}\right. } \end{aligned}$$

For the analysis of \(S_2\), we note that if \(\varvec{m}\in L_h(\Gamma )\) then \((\Gamma _{\varvec{m}})_{\mathrm {Hull},h}=\mathrm {Hull}(\Gamma _{\varvec{m}})\), so that for \(\varvec{m}\ne \varvec{m}'\) we have, by (16) and the assumption that \(\Gamma\) is hull-disjoint, that

$$\begin{aligned} {{\,\mathrm{dist}\,}}\big ((\Gamma _{\varvec{m}})_{\mathrm {Hull},h},(\Gamma _{\varvec{m}'})_{\mathrm {Hull},h}\big )={{\,\mathrm{dist}\,}}\big (\mathrm {Hull}(\Gamma _{\varvec{m}}),\mathrm {Hull}(\Gamma _{\varvec{m}'})\big )\ge R_{\Gamma ,\mathrm {Hull}}\rho ^{\ell _*(\varvec{m},\varvec{m}')-1}, \end{aligned}$$

where \(\ell _*(\varvec{m},\varvec{m}')\) was defined in (15). Now, since \(\Gamma\) is homogeneous we have that \(L_h(\Gamma )=I_\ell\), where \(\ell\) satisfies (24). Also, \(\mathcal {H}^d(\Gamma _{\varvec{m}})=M^{-\ell }\mathcal {H}^d(\Gamma )\) for \(\varvec{m}\in L_h(\Gamma )\).

In the case \(n=2\), given \(\varvec{m}\in L_h(\Gamma )=I_\ell\), by Lemma 5.4, Theorem 3.7 (iii) and Lemma 2.1 we have

$$\begin{aligned} \underset{\varvec{m}'\ne \varvec{m}}{\sum\limits_{\varvec{m}'\in L_{h}(\Gamma)}} \Big |I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi _*]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi _*] \Big |\lesssim & \underset{\varvec{m}'\ne \varvec{m}}{\sum\limits_{\varvec{m}'\in L_{h}(\Gamma)}} \frac{k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma _{\varvec{m}'})}{R_{\Gamma ,\mathrm {Hull}}\rho ^{\ell _*(\varvec{m},\varvec{m}')-1}}\\= & {} \frac{k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma )M^{-\ell }}{R_{\Gamma ,\mathrm {Hull}}} \sum \limits _{\ell _*=1}^{\ell -1}\frac{M^{\ell -\ell _*}(M-1)}{\rho ^{\ell _*-1}}\\= & {} \frac{k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}} (M-1)\rho \sum \limits _{\ell _*=1}^{\ell -1}(\rho M)^{-\ell _*}\\\le & {} \frac{k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}} \frac{(M-1)\rho }{(\rho M-1)}, \end{aligned}$$

where we used the fact that \(M\rho ^d=1\) (by (10)) and \(d>n-1=1\) (an assumption of the theorem) to deduce that \(\rho M>1\), which means we can take the summation limit to infinity in the geometric series. Finally, summing over \(\varvec{m}\) and bounding \(M-1\le M\) gives

$$\begin{aligned} S_2\lesssim \frac{k^2h^2\mathcal {H}^d(\Gamma )^2}{R_{\Gamma ,\mathrm {Hull}}} \frac{\rho M}{(\rho M-1)}, \qquad n=2. \end{aligned}$$

In the case \(n=1\), given \(\varvec{m}\in L_h(\Gamma )=I_\ell\), by Lemma 5.4, Theorem 3.7 (iii) and Lemma 2.1 we have

$$\begin{aligned}&\underset{\varvec{m}'\ne \varvec{m}}{\sum\limits_{\varvec{m}'\in L_{h}(\Gamma)}} \left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi _*]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi _*] \right| \\\lesssim & \underset{\varvec{m}'\ne \varvec{m}}{\sum\limits_{\varvec{m}'\in L_{h}(\Gamma)}} k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma _{\varvec{m}'})\left( 1+\left| \log \left( kR_{\Gamma ,\mathrm {Hull}}\rho ^{\ell _*(\varvec{m},\varvec{m}')-1}\right) \right| \right) \\= & {} k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma )M^{-\ell } \sum \limits _{\ell _*=1}^{\ell -1}M^{\ell -\ell _*}(M-1)\left( 1+\left| \log \left( kR_{\Gamma ,\mathrm {Hull}}\rho ^{\ell _*-1}\right) \right| \right) \\\le & {} k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma )(M-1) \sum \limits _{\ell _*=1}^{\ell -1}M^{-\ell _*}\left( 1+\left| \log \left( kR_{\Gamma ,\mathrm {Hull}}\right) \right| + (\ell _*-1)|\log \rho |\right) \\\le & {} k^2h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^d(\Gamma ) \left( 1+\left| \log \left( kR_{\Gamma ,\mathrm {Hull}}\right) \right| + \frac{|\log \rho |}{M-1}\right) , \end{aligned}$$

and then summing over \(\varvec{m}\), and noting that \(1\le 1/d\) and that \(\frac{|\log \rho |}{M-1}\le \frac{|\log \rho |}{\log M}=\frac{1}{d}\) by (12) and the fact that \(M-1>\log M\), gives

$$\begin{aligned} S_2\lesssim k^2h^2\big (\mathcal {H}^d(\Gamma )\big )^2 \left( \frac{1}{d}+\left| \log \left( kR_{\Gamma ,\mathrm {Hull}}\right) \right| \right) , \qquad n=1. \end{aligned}$$

Combining the estimates for \(S_1\) and \(S_2\) then gives

$$\begin{aligned}&\Big |I_{\Gamma ,\Gamma }[\Phi _*] -Q^h_{\Gamma ,\Gamma }[\Phi _*]\Big |\\\lesssim & {} k^2h^2\big (\mathcal {H}^d(\Gamma )\big )^2 {\left\{ \begin{array}{ll} \dfrac{h^d(1+|\log {kh}|)}{{{\,\mathrm{diam}\,}}(\Gamma )^d} + \dfrac{1}{d}+\left| \log \left( kR_{\Gamma ,\mathrm {Hull}}\right) \right| , &{} n=1,\\ \dfrac{h^{d-1}}{{{\,\mathrm{diam}\,}}(\Gamma )^d} + \dfrac{\rho M}{R_{\Gamma ,\mathrm {Hull}}(\rho M-1)}, &{} n=2. \end{array}\right. } \end{aligned}$$

The quantity in braces here is h-dependent, but can be bounded uniformly in h to give (65). For \(n=1\), this is achieved by noting that \(z^d|\log z|\le 1/(\mathrm {e}d)\) for \(z\in (0,1]\), which, together with \(h\le {{\,\mathrm{diam}\,}}(\Gamma )\), implies that

$$\begin{aligned} \dfrac{h^d(1+|\log {kh}|)}{{{\,\mathrm{diam}\,}}(\Gamma )^d}\le & {} \Big (\frac{h}{{{\,\mathrm{diam}\,}}(\Gamma )}\Big )^d \Big (1+\big |\log \big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )\big |+\Big |\log \frac{h}{{{\,\mathrm{diam}\,}}(\Gamma )}\Big |\Big ) \\\le & {} 1+\big |\log \big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )\big |+\frac{1}{\mathrm {e}d}\\\lesssim & {} \frac{1}{d}+\big |\log \big (kR_{\Gamma ,\mathrm {Hull}}\big )\big |, \end{aligned}$$

where the final inequality holds by (63) with \(x_1=kR_{\Gamma ,\mathrm {Hull}}\), \(x_2=k{{\,\mathrm{diam}\,}}(\Gamma )\), and \(x_3=c_\mathrm{osc}\), again noting that \(1\le 1/d\) in this case. For \(n=2\), since \(h\le {{\,\mathrm{diam}\,}}(\Gamma )\) and \(d>1\) we can bound

$$\begin{aligned} \frac{h^{d-1}}{{{\,\mathrm{diam}\,}}(\Gamma )^d} = \left( \frac{h}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^{d-1}\frac{1}{{{\,\mathrm{diam}\,}}(\Gamma )} \le \frac{1}{{{\,\mathrm{diam}\,}}(\Gamma )} \le \frac{1}{R_{\Gamma ,\mathrm {Hull}}} \le \dfrac{\rho M}{R_{\Gamma ,\mathrm {Hull}}(\rho M-1)}, \end{aligned}$$

and we can then obtain (65) by recalling that \(\rho ^d=1/M\). Finally, in converting the \(O(h^2)\) estimate to one involving \(N=|L_h(\Gamma )|\), we recall that \(h\le {{\,\mathrm{diam}\,}}(\Gamma )(N/M)^{-1/d}\) (see (34)).

\(\square\)

Remark 5.6

The error estimate of Proposition 5.5 for \(n=2\) blows up as \(\rho \searrow \frac{1}{M}\), equivalently as \(d\searrow 1\), assuming \(\mathcal {H}^d(\Gamma )\), \({{\,\mathrm{diam}\,}}(\Gamma )\), M and N are fixed and \(R_{\Gamma ,\mathrm {Hull}}\) is bounded away from zero, because of the factor \(\frac{\rho M}{\rho M-1}=\frac{1}{1-M^{1/d-1}}\). For example, for a family of Cantor dusts as in Fig. 1(I), parametrised by \(\rho\) and with \(M=4\), this corresponds to the limit \(\rho \searrow \frac{1}{4}\). Differently from the setting in Section 4.4, the relative error is also predicted to blow up in this limit because the integral being approximated in this case is bounded, since \(\Phi _*\in L^\infty (\Gamma \times \Gamma )\). In contrast, for \(n=1\) the estimate in Proposition 5.5 tends to 0 as \(d\searrow 0\) because for \(N>M\) the algebraic growth of the 1/d term in c is beaten by the exponential decay of the \((N/M)^{-2/d}\) factor.

Finally, we can state and prove our main result for the approximation of \(I_{\Gamma ,\Gamma }[\Phi ]\).

Theorem 5.7

Let \(\Gamma \subset \mathbb {R}^n\) be as in Section 2.2, with \(d=\text{dim}_{\mathrm{H}}(\Gamma )>n-1\). Suppose that \(\Gamma\) is homogeneous in the sense of Section 2.3, with contraction factor \(\rho \in (0,1)\). Suppose also that \(\Gamma\) is hull-disjoint in the sense of (14). Let \(k>0\). For the approximation of the integral (57) define the quadrature rule \(Q^h_{\Gamma ,\Gamma ,\Phi }\) by (60) (with \(h\le {{\,\mathrm{diam}\,}}(\Gamma )\)) if \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\) and by (61) (with \(h\le c_\mathrm{osc}/k\)) if \(k{{\,\mathrm{diam}\,}}(\Gamma )>c_\mathrm{osc}\). Then

$$\begin{aligned} \left| I_{\Gamma ,\Gamma }[\Phi ]-Q^h_{\Gamma ,\Gamma ,\Phi }\right|&\lesssim c' h^2\big (\mathcal {H}^d(\Gamma )\big )^2 \le c'\big ({{\,\mathrm{diam}\,}}(\Gamma )\mathcal {H}^d(\Gamma )\big )^2 \left( \frac{N}{M}\right) ^{-2/d}, \end{aligned}$$

where the constant implied in \(\lesssim\) depends only on \(c_\mathrm{osc}\), and

$$\begin{aligned} c'=\left\{ \begin{array}{lr} \dfrac{\left( \frac{\rho M}{\rho M-1}\right) ^{n-1}}{\rho ^{n+1}R_{\Gamma ,\mathrm {Hull}}^{n+1}} =\dfrac{M^{(n+1)/d}}{(1-M^{1/d-1})^{n-1}R_{\Gamma ,\mathrm {Hull}}^{n+1}} , & k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc},\\ \bigg (1+\dfrac{\left( \frac{\rho M}{\rho M-1}\right) ^{n-1}}{\rho ^{n+1}\big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )^d}\bigg ) \bigg (\dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}}\bigg )^{n+1} \\ =\bigg (1+\dfrac{M^{(n+1)/d}}{(1-M^{1/d-1})^{n-1}\big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )^d}\bigg ) \bigg (\dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}}\bigg )^{n+1}, & k{{\,\mathrm{diam}\,}}(\Gamma )> c_\mathrm{osc}. \end{array}\right. \end{aligned}$$

Proof

By redefining \(h_*:=\min \{c_\mathrm{osc}/k,{{\,\mathrm{diam}\,}}(\Gamma )\}\), (60) can be viewed as a special case of (61), since with \(h_*={{\,\mathrm{diam}\,}}(\Gamma )\) we have \(L_{h_*}(\Gamma )=\{0\}\), in which case the first sum in (61) reduces to (60) and the second sum is absent. We therefore present the proof of (61) and specialise to (60) at the end.

By the triangle inequality and the splitting \(\Phi =C_n\Phi _{n-1}+\Phi _*\), we have:

$$\begin{aligned} \left| I_{\Gamma ,\Gamma }[\Phi ]- Q^h_{\Gamma ,\Gamma ,\Phi } \right|\le & {} \underbrace{\sum \limits _{\varvec{m}\in L_{h_*}(\Gamma )} C_n\left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _{n-1}] - Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}},n-1} \right| }_{=:T_1}\\&+ \underbrace{\sum \limits _{\varvec{m}\in L_{h_*}(\Gamma )} \left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*] \right| }_{=:T_2}\\&+ \underbrace{\sum \limits _{\varvec{m}\in L_{h_*}(\Gamma )}{\underset{\varvec{m}'\ne \varvec{m}}{\underset{\varvec{m}'\in L_{h_*}(\Gamma )}{\sum }}} \left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi ]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi ] \right| }_{=:T_3}. \end{aligned}$$

To bound \(T_1\) above, we first note that by Corollary 4.7 (with \(\Gamma\) replaced by \(\Gamma _{\varvec{m}}\) and with \(t=n-1\) for \(n=1,2\)) for any \(\varvec{m}\in L_{h_*}(\Gamma )\) we have

$$\begin{aligned} \left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _{n-1}] - Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}},n-1}\right|\lesssim & {} h^2\big (\mathcal {H}^d(\Gamma _{\varvec{m}})\big )^2\left( 1-M\rho ^{2d+1-n}\right) ^{-1}\dfrac{1}{R_{\Gamma _{\varvec{m}},\mathrm {Hull}}^{n+1}}\\= & {} h^2\big (\mathcal {H}^d(\Gamma _{\varvec{m}})\big )^2\left( 1-M^{-1}\rho ^{1-n}\right) ^{-1}\dfrac{1}{R_{\Gamma _{\varvec{m}},\mathrm {Hull}}^{n+1}}. \end{aligned}$$

Let \(\ell (h_*)\) be given by (24) with h replaced by \(h_*\). Noting that \(\rho ^{\ell (h_*)}>\rho h_*/{{\,\mathrm{diam}\,}}(\Gamma )\) we have that

$$\begin{aligned} \dfrac{\rho h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}R_{\Gamma ,\mathrm {Hull}}< \rho ^{\ell (h_*)}R_{\Gamma ,\mathrm {Hull}}=R_{\Gamma _{\varvec{m}},\mathrm {Hull}}\le \dfrac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}R_{\Gamma ,\mathrm {Hull}}. \end{aligned}$$
(67)

Hence, using (22) with \(\mathcal {I}=L_{h_*}(\Gamma )\) and (64) with h replaced by \(h_*\),

$$\begin{aligned} T_1 \lesssim h^2\big (\mathcal {H}^d(\Gamma )\big )^2\left( \frac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d \frac{M}{M-\rho ^{1-n}}\left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{\rho h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^{n+1}. \end{aligned}$$

For \(T_2\), by Proposition 5.5 we have for any \(\varvec{m}\in L_{h_*}(\Gamma )\) that

$$\begin{aligned}&\left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*]-Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}}}[\Phi _*] \right| \\\lesssim & {} k^2h^2\big (\mathcal {H}^d(\Gamma _{\varvec{m}})\big )^2 {\left\{ \begin{array}{ll} \frac{|\log \rho |}{\log M} +\Big |\log \big (kR_{\Gamma _{\varvec{m}},\mathrm {Hull}}\big )\Big |, &{} n=1,\\ \dfrac{\rho M}{R_{\Gamma _{\varvec{m}},\mathrm {Hull}}(\rho M -1)}, &{} n=2. \end{array}\right. } \end{aligned}$$

Using (67), and for \(n=1\) the facts that \(\frac{|\log \rho |}{\log M}\lesssim |\log \rho |\le \frac{1}{\rho }\), and that \(\displaystyle kR_{\Gamma _{\varvec{m}},\mathrm {Hull}}\le k{{\,\mathrm{diam}\,}}\Gamma _{\varvec{m}}\le k h_*\le c_\mathrm{osc}\), so that we can apply (63) with \(x_1=\rho kh_* R_{\Gamma ,\mathrm {Hull}}/{{\,\mathrm{diam}\,}}(\Gamma _{\varvec{m}})\), \(x_2=kR_{\Gamma _{\varvec{m}},\mathrm {Hull}}\) and \(x_3=c_\mathrm{osc}\), to find that

$$\begin{aligned} T_2\lesssim k^2h^2\big (\mathcal {H}^d(\Gamma )\big )^2\left( \frac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d {\left\{ \begin{array}{ll} \dfrac{1}{\rho } +\left| \log \left( \dfrac{\rho kh_*R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) \right| , &{} n=1,\\ \dfrac{M{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma _{\varvec{m}},\mathrm {Hull}}(\rho M -1)}, &{} n=2. \end{array}\right. } \end{aligned}$$

For \(T_3\), by Proposition 5.2 we have for \(\varvec{m},\varvec{m}'\in L_{h_*}(\Gamma )\) with \(\varvec{m}\ne \varvec{m}'\) that

$$\begin{aligned}&\left| I_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi ] -Q^h_{\Gamma _{\varvec{m}},\Gamma _{\varvec{m}'}}[\Phi ]\right| \\\lesssim & {} h^2\mathcal {H}^d(\Gamma _{\varvec{m}})\mathcal {H}^{d}(\Gamma _{\varvec{m}'}) \dfrac{\Big (1+\big (k{{\,\mathrm{dist}\,}}((\Gamma _{\varvec{m}})_{\mathrm {Hull},h},(\Gamma _{\varvec{m}'})_{\mathrm {Hull},h})\big )^{n/2+1}\Big )}{{{\,\mathrm{dist}\,}}\big ((\Gamma _{\varvec{m}})_{\mathrm {Hull},h},(\Gamma _{\varvec{m}'})_{\mathrm {Hull},h}\big )^{n+1}}, \end{aligned}$$

and by (16) and (67) it holds that

$$\begin{aligned} {{\,\mathrm{dist}\,}}\big ((\Gamma _{\varvec{m}})_{\mathrm {Hull},h},(\Gamma _{\varvec{m}'})_{\mathrm {Hull},h}\big )\ge & {} {{\,\mathrm{dist}\,}}\big (\mathrm {Hull}(\Gamma _{\varvec{m}}),\mathrm {Hull}(\Gamma _{\varvec{m}'})\big )\\\ge & {} \rho ^{\ell (h_*)-1}R_{\Gamma ,\mathrm {Hull}}\\> & {} \frac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}R_{\Gamma ,\mathrm {Hull}}, \end{aligned}$$

so that, since \((1+(kz)^{n/2+1})/z^{n+1}\) is positive and decreasing on \((0,\infty )\), and \(\dfrac{kh_*R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}\le c_\mathrm{osc}\),

$$\begin{aligned} T_3 \lesssim h^2\big (\mathcal {H}^d(\Gamma )\big )^2 { \dfrac{\left( 1+\left( \dfrac{kh_*R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^{n/2+1}\right) }{\left( \dfrac{h_*R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^{n+1}} } \lesssim h^2\big (\mathcal {H}^d(\Gamma )\big )^2 { \left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^{n+1}}. \end{aligned}$$

Recalling our redefinition of \(h_*:=\min \{c_\mathrm{osc}/k,{{\,\mathrm{diam}\,}}(\Gamma )\}\), the result for the case \(k{{\,\mathrm{diam}\,}}(\Gamma )>c_\mathrm{osc}\) then follows by combining the estimates for \(T_1\), \(T_2\) and \(T_3\), and the result for the case \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\) follows by noting that in that case \(T_3\) is absent. We describe in more detail the four possible cases.

  • For \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\) (and thus \(h_*={{\,\mathrm{diam}\,}}(\Gamma )\)) and \(n=1\) we have, since \(M/(M-1)\le 2\),

    $$\begin{aligned} \frac{T_1+T_2}{h^2\big (\mathcal {H}^d(\Gamma )\big )^2}\lesssim & {} \Big (\frac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}\Big )^d \bigg ( \left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{\rho h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^2 +\dfrac{k^2}{\rho }+k^2\left| \log \left( \dfrac{\rho kh_*R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) \right| \bigg )\\= & {} \dfrac{1}{\rho ^2 R_{\Gamma ,\mathrm {Hull}}^2}+\dfrac{k^2}{\rho } +k^2\big |\log (\rho k R_{\Gamma ,\mathrm {Hull}})\big |\\\lesssim & {} \dfrac{1}{\rho ^2 R_{\Gamma ,\mathrm {Hull}}^2}, \end{aligned}$$

    where the final bound follows from the fact that \(\displaystyle k\le \frac{c_\mathrm{osc}}{{{\,\mathrm{diam}\,}}(\Gamma )}\lesssim \frac{1}{R_{\Gamma ,\mathrm {Hull}}}\), and because if \(\rho k R_{\Gamma ,\mathrm {Hull}}\le 1\) then \(k^2|\log (\rho k R_{\Gamma ,\mathrm {Hull}})|\le (\rho R_{\Gamma ,\mathrm {Hull}})^{-2}\), since

    $$\begin{aligned} |\log \epsilon |<|\epsilon ^{-2}|, \qquad 0<\epsilon \le 1, \end{aligned}$$
    (68)

    and if \(\rho k R_{\Gamma ,\mathrm {Hull}}>1\) then \(k^2|\log (\rho k R_{\Gamma ,\mathrm {Hull}})|\le k^2 |\log (k {{\,\mathrm{diam}\,}}(\Gamma ))| \le k^2 |\log (c_\mathrm{osc})|\lesssim k^2 \lesssim (\rho R_{\Gamma ,\mathrm {Hull}})^{-2}\).

  • For \(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\) and \(n=2\) we have, again using that \(k\lesssim 1/R_{\Gamma ,\mathrm {Hull}}\),

    $$\begin{aligned} \frac{T_1+T_2}{h^2\big (\mathcal {H}^d(\Gamma )\big )^2}\lesssim & {} \left( \frac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d \bigg (\frac{M}{\rho ^2(\rho M-1)}\left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^3 + \dfrac{k^2M{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma ,\mathrm {Hull}}(\rho M-1)}\bigg )\\\lesssim & {} \frac{M}{\rho ^2(\rho M-1)R_{\Gamma ,\mathrm {Hull}}^3} + \dfrac{k^2M}{R_{\Gamma ,\mathrm {Hull}}(\rho M-1)} \lesssim \frac{M}{\rho ^2(\rho M-1)R_{\Gamma ,\mathrm {Hull}}^3}. \end{aligned}$$
  • For \(k{{\,\mathrm{diam}\,}}(\Gamma )>c_\mathrm{osc}\) (and thus \(h_*=c_\mathrm{osc}/k\)) and \(n=1\),

    $$\begin{aligned} \frac{T_1+T_2+T_3}{h^2\big (\mathcal {H}^d(\Gamma )\big )^2}\lesssim & {} \left( \frac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d \bigg [ \left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{\rho h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^2 +\dfrac{k^2}{\rho }+k^2\left| \log \left( \dfrac{\rho kh_*R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) \right| \bigg ]\\&+ \left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^2 \\\lesssim & {} \frac{1}{\big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )^d} \bigg [\left( \dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{\rho R_{\Gamma ,\mathrm {Hull}}}\right) ^2 +\dfrac{k^2}{\rho } +k^2\left| \log \left( \dfrac{\rho R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) \right| \bigg ]\\&\quad +\left( \dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}}\right) ^2\\\lesssim & {} \bigg ( 1+ \frac{1}{\rho ^2\big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )^d}\bigg )\left( \dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}}\right) ^2 , \end{aligned}$$

    using \(R_{\Gamma ,\mathrm {Hull}}<{{\,\mathrm{diam}\,}}(\Gamma )\) and (68) with \(\epsilon =\frac{\rho R_{\Gamma ,\mathrm {Hull}}}{{{\,\mathrm{diam}\,}}(\Gamma )}<1\).

  • Finally, for \(k{{\,\mathrm{diam}\,}}(\Gamma )>c_\mathrm{osc}\) and \(n=2\),

    $$\begin{aligned} \frac{T_1+T_2+T_3}{h^2\big (\mathcal {H}^d(\Gamma )\big )^2}\lesssim & {} \left( \frac{h_*}{{{\,\mathrm{diam}\,}}(\Gamma )}\right) ^d\bigg [ \frac{M}{\rho ^2(\rho M-1)} \left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^3 +\dfrac{k^2M{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma ,\mathrm {Hull}}(\rho M-1)}\bigg ]\\&+\left( \dfrac{{{\,\mathrm{diam}\,}}(\Gamma )}{h_*R_{\Gamma ,\mathrm {Hull}}}\right) ^3 \\\lesssim & {} \frac{1}{\big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )^d}\bigg [ \frac{M}{\rho ^2(\rho M-1)} \left( \dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}}\right) ^3 + \dfrac{k^3M{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}(\rho M-1)}\bigg ]\\&+\left( \dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}}\right) ^3 \end{aligned}$$

    and we obtain the assertion again using the fact that \(R_{\Gamma ,\mathrm {Hull}}<{{\,\mathrm{diam}\,}}(\Gamma )\).

\(\square\)

Remark 5.8

(Number of function evaluations) For a homogeneous IFS, recall that \(N=|L_h(\Gamma )|=|I_\ell |=M^\ell\) for \(\ell\) as in (24). A priori, the quadrature rule (60) requires \((M-1)M^{2\ell -1}=\frac{M-1}{M}N^2\) evaluations of \(\Phi _{n-1}\) (see Section 4.4) and \(M^{2\ell }=N^2\) evaluations of \(\Phi _*\). If \(\ell _*\) is defined by (24) with h replaced by \(h_*\), i.e. \(\ell _*\) is the level of the partition whose elements have diameter approximately \(h_*=c_\mathrm{osc}/k\), then the quadrature rule (61) requires \(M^{\ell _*}\frac{M-1}{M}M^{2(\ell -\ell _*)}=\frac{M-1}{M}M^{2\ell -\ell _*}=\frac{M-1}{M^{\ell _*+1}}N^{2}\) evaluations of \(\Phi _{n-1}\), \(M^{\ell _*}M^{2(\ell -\ell _*)}=M^{2\ell -\ell _*}=\frac{1}{M^{\ell _*}}N^2\) evaluations of \(\Phi _*\), and \(M^{\ell _*}(M^{\ell _*}-1)M^{2(\ell -\ell _*)}=(M^{\ell _*}-1)M^{2\ell -\ell _*}=(1-\frac{1}{M^{\ell _*}})N^{2}\) evaluations of \(\Phi\). However, the number of function evaluations can be reduced (by a factor of a half in the limit \(h\rightarrow 0\)) by exploiting the symmetry of \(\Phi\), \(\Phi _*\), \(\Phi _{n-1}\), all of which satisfy \(f(x,y)=f(y,x)\).

Remark 5.9

(Limit behaviour for \(d\searrow n-1\)) We consider the behaviour of the estimates of Theorem 5.7 as \(d\searrow n-1\), assuming \(\mathcal {H}^d(\Gamma )\), \({{\,\mathrm{diam}\,}}(\Gamma )\), M and N are fixed, and \(R_{\Gamma ,\mathrm {Hull}}\) is bounded away from 0. This limit corresponds to \(\rho \searrow 0\) for \(n=1\) and \(\rho \searrow 1/M\) for \(n=2\). For \(n=1\), the absolute error tends to 0 like \(O((N/M^2)^{-2/d})\) as \(d\searrow 0\), provided \(N>M^2\). Since in this limit the integral is dominated by the contribution from the singular function \(\Phi _0\), the integral of which grows like 1/d as \(d\searrow 0\) (as shown in Section 4.4), the relative error tends to 0 like \(O(d(N/M^2)^{-2/d})\) as \(d\searrow 0\). For \(n=2\), the estimate for the absolute error grows as \(d\searrow 1\), being asymptotically proportional to \(1/(1-M^{1/d-1})\sim 1/((d-1)\log M)\) as \(d\searrow 1\). However, the relative error is bounded in this limit because, again, the contribution of the singular function (\(\Phi _1\) in this case) grows in proportion to \(1/(d-1)\) as \(d\searrow 1\) (as shown in Section 4.4). We validate these statements numerically in Section 6 below.

Remark 5.10

(Behaviour for vanishing distance between subsets) The estimates of Theorem 5.7 also blow up in the limit \(R_{\Gamma ,\mathrm {Hull}}\searrow 0\), specifically like \(R_{\Gamma ,\mathrm {Hull}}^{-(n+1)}\). However, our numerical investigations in Section 6 suggest that, at least in certain cases, this is overly pessimistic.

Proposition 5.5 and Theorem 5.7 are stated only for the case of a homogeneous IFS. We expect that with non-trivial further work one should be able to extend the \(O(h^2)\) estimates in these results to the non-homogeneous case, but we defer this to future studies. The main difficulty is obtaining sharp estimates for the sum \(S_2\) in the proof of Proposition 5.5. While we cannot currently prove \(O(h^2)\) estimates for the non-homogeneous case, we can at least prove weaker O(h) estimates. The following is the O(h) analogue of Theorem 5.7. The proof, which we do not provide here, essentially follows that of Theorem 5.7, but applies lower order estimates, and estimates the sum \(S_2\) in the proof of Proposition 5.5 more simply (but less sharply) using a uniform bound over all summands.

Theorem 5.11

Let \(\Gamma \subset \mathbb {R}^n\) satisfy the assumptions of Theorem 5.7, except that we no longer assume \(\Gamma\) is homogeneous in the sense of Section 2.3. Then

$$\begin{aligned} \left| I_{\Gamma ,\Gamma }[\Phi ]-Q^h_{\Gamma ,\Gamma ,\Phi }\right| \lesssim c''h\big (\mathcal {H}^d(\Gamma )\big )^2, \end{aligned}$$

where the constant implied by \(\lesssim\) depends only on \(c_\mathrm{osc}\) and

$$\begin{aligned} c^{\prime \prime }= \left\{ \begin{array}{lr} \dfrac{1}{\rho _{\min }^{n}(1-\sum _{m=1}^M\rho _m^{2d-n+1})R_{\Gamma ,\mathrm {Hull}}^{n}} ,& k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc},\\ \bigg (1+\dfrac{1}{\rho _{\min }^n\big (k{{\,\mathrm{diam}\,}}(\Gamma )\big )^d (1-\sum _{m=1}^M\rho _m^{2d-n+1})}\bigg ) \bigg (\dfrac{k{{\,\mathrm{diam}\,}}(\Gamma )}{R_{\Gamma ,\mathrm {Hull}}}\bigg )^{n}, & k{{\,\mathrm{diam}\,}}(\Gamma )> c_\mathrm{osc}, \end{array}\right. \end{aligned}$$

where \(\rho _{\min }=\min _{m\in \{1,\ldots ,M\}}\rho _m\).

6 Numerical experiments

In this section, we present numerical results complementing our theoretical analysis. The code used for our numerical experiments is available at https://github.com/AndrewGibbs/IFSintegrals, where we provide a Julia-based [8] implementation of all the quadrature rules presented in this paper. Within this repository, the interactive notebook QuadratureExample.jpynb provides an overview of the main steps in our algorithm and examples of usage. The pseudocode for a simple recursive implementation of the quadrature rule \(Q_\Gamma [f]\) (25) for regular single integrals is shown in Algorithms 1–2 below.

Estimation of \({{\,\mathrm{diam}\,}}(\Gamma )\) is a key step in Algorithm 1. In the numerical experiments which follow, \({{\,\mathrm{diam}\,}}(\Gamma )\) can be derived analytically. But for more general cases where an analytic derivation is not possible, our implementation estimates \({{\,\mathrm{diam}\,}}(\Gamma )\) using an algorithm that follows from [14, Proposition 6].

figure a
figure b

We shall focus mainly on the validation of the quadrature rule \(Q^h_{\Gamma ,\Gamma ,\Phi }\) defined by (60) and (61) for the calculation of the singular double integral \(I_{\Gamma ,\Gamma }[\Phi ]\) defined in (57), since this is the most challenging integral we consider in the paper, and since it is important for the Hausdorff BEM application of [9]. However, our numerical results for \(Q^h_{\Gamma ,\Gamma ,\Phi }\) also implicitly validate the quadrature rule \(Q^h_{\Gamma ,\Gamma ,t}\) defined in (48) for the integration of the singular function \(\Phi _t\), and, more fundamentally, the barycentre rule of Definition 3.5 for regular integrands.

The definition of \(Q^h_{\Gamma ,\Gamma ,\Phi }\) in Section 5 involves a parameter \(c_\mathrm{osc}>0\), which governs whether the integral \(I_{\Gamma ,\Gamma }[\Phi ]\) is treated as non-oscillatory (\(k{{\,\mathrm{diam}\,}}(\Gamma )\le c_\mathrm{osc}\)), in which case (60) is applied, or oscillatory (\(k{{\,\mathrm{diam}\,}}(\Gamma )> c_\mathrm{osc}\)), in which case (61) is used. If \(c_\mathrm{osc}\) is too small, accuracy will deteriorate because the singularity will not be properly captured, while if \(c_\mathrm{osc}\) is too large, accuracy will also deteriorate because the splitting (59) is being used outside of its range of applicability. Our experience, following a detailed numerical investigation, suggests that a value of \(c_\mathrm{osc}=2\pi\) gives acceptable performance across all the examples we considered, and this is the value of \(c_\mathrm{osc}\) we use throughout this section. This means we classify the integral \(I_{\Gamma ,\Gamma }[\Phi ]\) to be oscillatory (and use (61) rather than (60)) whenever the diameter of \(\Gamma\) is larger than one wavelength.

6.1 Cantor sets

We first consider the calculation of \(I_{\Gamma ,\Gamma }[\Phi ]\) in the case where \(\Gamma \subset \mathbb {R}\) is a Cantor set, defined by (11) for some \(\rho \in (0,1/2)\), and \(\mu =\mathcal {H}^d|_\Gamma\). In this case \(\Gamma\) is homogeneous, with \(d=\log {2}/\log {(1/\rho )}\) and \(\mathcal {H}^d(\Gamma )=1\) (see e.g. [18, p. 53]), and hull-disjoint, with \(R_{\Gamma ,\mathrm {Hull},h}=R_{\gamma ,\mathrm {Hull}}=R_\Gamma =1-2\rho\), for \(0<h<{{\,\mathrm{diam}\,}}(\Gamma )=1\). In Fig. 5 we plot absolute and relative errors for the quadrature rule \(Q^h_{\Gamma ,\Gamma ,\Phi }\) as a function of \(N=|L_h(\Gamma )|=2^\ell\), for \(\ell =2,\ldots ,9\), \(k=5\) and \(\rho \in \{1/3, 0.1, 0.01, 0.001\}\). The reference solution \(I^\mathrm{ref}_{\Gamma ,\Gamma }[\Phi ]\) in each case is computed using the quadrature rule \(Q^h_{\Gamma ,\Gamma ,\Phi }\) with \(N=8192\) (\(\ell =13\)). We also plot on the same axes the corresponding theoretical convergence rate \(N^{-2/d}\) (which differs for each value of \(\rho\)) predicted by Theorem 5.7. For all choices of \(\rho\), we see excellent agreement with the theory. Moreover, both the absolute and relative errors for a given N clearly decrease as \(\rho \searrow 0\) (equivalently, \(d\searrow 0\)), in line with the observations of Remark 5.9.

Fig. 5
figure 5

Convergence of \(Q_{\Gamma ,\Gamma ,\Phi }^h\) for a collection of Cantor sets with parameters \(\rho\) approaching 0

6.2 Cantor dusts

Next we consider the case where \(\Gamma\) is a Cantor dust, defined as in the first line of Table 1 with \(\rho \in (0,1/2)\) , and \(\mu =\mathcal {H}^d|_\Gamma\). Again, \(\Gamma\) is homogeneous, now with \(d=\log 4/\log (1/\rho )\), and hull-disjoint, with \(R_{\Gamma ,\mathrm {Hull},h}=R_{\gamma ,\mathrm {Hull}}=R_\Gamma =1-2\rho\), for \(0<h<{{\,\mathrm{diam}\,}}(\Gamma )=\sqrt{2}\). In this case the Hausdorff measure \(\mathcal {H}^d(\Gamma )\) is not known exactly, so the double integral \(I_{\Gamma ,\Gamma }[\Phi ]\) can only be computed up to the unknown factor \(\mathcal {H}^d(\Gamma )^2\). In Fig. 6 we present absolute (scaled by \(\mathcal {H}^d(\Gamma )^2\)) and relative errors for \(k=5\) and \(\rho \in \{1/3,0.26,0.251,0.2501\}\), plotted against \(N=4^\ell\), \(\ell =3,4,5\), along with the corresponding theoretical convergence rate \(N^{-2/d}\). The reference solution \(I^\mathrm{ref}_{\Gamma ,\Gamma }[\Phi ]\) in each case is computed using the quadrature rule \(Q^h_{\Gamma ,\Gamma ,\Phi }\) with \(N=16384\) (\(\ell =7\)). The behaviour as \(N\rightarrow \infty\) is clearly consistent with the theoretical convergence rates. Moreover, as \(\rho \searrow 1/4\) (equivalently, as \(d\searrow 1\)), the absolute error grows, while the relative error remains bounded, as predicted in Remark 5.9.

Fig. 6
figure 6

Convergence of \(Q_{\Gamma ,\Gamma ,\Phi }^h\) for a collection of Cantor dusts with parameters \(\rho\) approaching 1/4

6.3 Vanishing separation limit

Next we consider the behaviour of our quadrature rules as the parameter \(R_{\Gamma ,\mathrm {Hull}}\) tends to 0. In Fig. 7a, we show absolute errors for \(Q_{\Gamma ,\Gamma ,\Phi }^h\) with with \(k=5\) at three values of N, for \(\Gamma \subset \mathbb {R}\) a Cantor set, defined by (11), with \(\rho =(1-R_\Gamma )/2\), where \(R_{\Gamma }=1-2\rho \in \{0.1,0.01,0.001,0.0001,0.00001\}\) , and \(\mu =\mathcal {H}^d|_\Gamma\). The reference solution is as for Fig. 5. In Remark 5.10, we observed that as \(R_{\Gamma ,\mathrm {Hull}}\rightarrow 0\) our theory predicts blow-up of the error like \(R_{\Gamma ,\mathrm {Hull}}^{n+1}\), i.e. like \(R_{\Gamma }^{2}\) in this case. However, the numerical results suggest that, at least in this case, the theoretical prediction is overly pessimistic, since the error appears to be bounded as \(R_{\Gamma ,\mathrm {Hull}}\rightarrow 0\). In fact, the integral for the non-disjoint case \(\rho =1/2\) (so \(\Gamma =[0,1]\), \(d=1\) and \(R_{\Gamma }=0\)) can be computed using our method, and the corresponding errors appear to follow the same \(N^{-2/d}\) behaviour (in this case, \(N^{-2/d}=N^{-2}\) since \(d=1\)) with respect to increasing N as for the case \(0<\rho <1/2\) (see the dashed lines in the figure). To further investigate the non-disjoint case \(\rho =1/2\) (with \(\Gamma =[0,1]\), \(d=1\) and \(R_{\Gamma }=0\)), in Fig. 7b we plot the absolute error in the quadrature rule \(Q_{\Gamma ,\Gamma ,0}^{h}\approx I_{\Gamma ,\Gamma }[\Phi _0]\) for this case, for which we have the exact result

$$\begin{aligned} I_{\Gamma ,\Gamma }[\Phi _0] = \int _0^1 \int _0^1 \log {|x-y|} \,\mathrm {d}\mathcal {H}^1(y)\,\mathrm {d}\mathcal {H}^1(y) = \int _0^1 \int _0^1 \log {|x-y|} \,\mathrm {d}y\,\mathrm {d}x = -\frac{3}{2}, \end{aligned}$$
(69)

where we used the fact that \(\mathcal {H}^1\) coincides with the Lebesgue measure on \(\mathbb {R}\).

Fig. 7
figure 7

a Absolute error for \(Q_{\Gamma ,\Gamma ,\Phi }^{h}\) for a collection of Cantor sets with parameters \(\rho\) approaching 1/2, i.e. \(R_\Gamma =R_{\Gamma ,\mathrm {Hull}}\) approaching 0, for three different values of N and \(k=5\). The dashed lines indicate the value of \(Q_{\Gamma ,\Gamma ,\Phi }^{h}\) in the case \(\rho =1/2\) (\(R_\Gamma =R_{\Gamma ,\mathrm {Hull}}=0\)), in which case \(\Gamma =[0,1]\). b Absolute error for \(Q_{\Gamma ,\Gamma ,0}^{h}\) for a Cantor set with \(\rho =1/2\) (\(R_\Gamma =R_{\Gamma ,\mathrm {Hull}}=0\)), i.e. \(\Gamma =[0,1]\). In this case we have an exact value \(I_{\Gamma ,\Gamma }[\Phi _0]=-3/2\) with which to compute errors (see (69))

6.4 Non-disjoint, non-hull-disjoint and non-homogeneous examples

The results in Fig. 7 suggest that our assumption that \(\Gamma\) should be hull-disjoint, or even disjoint at all, may not be necessary in Theorem 5.7. To investigate this further, we compute \(Q_{\Gamma ,\Gamma ,\Phi }^h\) for two non-hull-disjoint examples and \(\mu =\mathcal {H}^d|_\Gamma\): example (II) in Table 1, which is disjoint but not hull-disjoint, and example (IV) in Table 1, which is not disjoint. Both attractors are shown in Fig. 1. Absolute errors (scaled by \(\mathcal {H}^d(\Gamma )^2\)) for these cases for \(k=2\) and a range of h values are presented in Fig. 8a, and for both examples it seems we obtain \(O(h^2)\) convergence, even though our theoretical error analysis does not cover these cases. Results for the middle-third Cantor dust (example (I) in Table 1) are included in the same figure for reference.

Fig. 8
figure 8

a Convergence of \(Q_{\Gamma ,\Gamma ,\Phi }^h\) with \(k=2\) for examples (I) (homogeneous and hull-disjoint), (II) (homogeneous and disjoint but not hull-disjoint) and (IV) (homogeneous and not disjoint) from Table 1, along with the attractor of (70) (hull-disjoint but non-homogeneous). The values of N corresponding to (i) the largest h value shown, (ii) the smallest h value shown and (iii) the reference solution are (16, 4096, 65536) for (I), (16, 16384, 65536) for (II), (25, 15625, 78125) for (IV) and (19, 14209, 75316) for (70). b An approximation of the attractor defined by (70), produced by plotting \(s^6(E)\), with s defined by (8), with E a set of ten random points in \([0,1]^2\)

In Fig. 8a, we also include results for a hull-disjoint but non-homogeneous IFS with \(M=4\) and

$$\begin{aligned} s_1(x) = \frac{1}{4}x,\quad s_2(x)= & {} \frac{1}{4}Ax + \Bigg (\begin{matrix}3/4\\ 0\end{matrix}\Bigg ),\quad s_3(x) = \frac{1}{4}Ax+ \Bigg (\begin{matrix}0\\ 3/4\end{matrix}\Bigg ),\quad \nonumber \\ s_4(x)= & {} \frac{1}{2}x+ \Bigg (\begin{matrix}1/2\\ 1/2\end{matrix}\Bigg ), \end{aligned}$$
(70)

for the rotation matrix \(A =\left( \begin{array}{cc} 0&{}-1\\ 1&{} 0\end{array}\right)\). The attractor \(\Gamma\) for this IFS is sketched in Fig. 8b and has Hausdorff dimension \(d = \log ((1 + \sqrt{13})/2)/\log 2\approx 1.20\) and diameter \({{\,\mathrm{diam}\,}}(\Gamma )=\sqrt{2}\). For such non-homogeneous hull-disjoint cases, our current analysis only provides an O(h) convergence result (see Theorem 5.11). But the results in Fig. 8 for the IFS (70) suggest that, at least in this case, our analysis may not be sharp in this respect, since we seem to obtain \(O(h^2)\) convergence in practice. We leave further investigation of this to future work.

6.5 Comparison against chaos-game quadrature

In this section, we compare the barycentre rule (25) with the “chaos game” rule described, e.g. in [19, eqn (3.22)–(3.23)] and [26, Section 6.3.1]. This consists of (i) choosing some \(x_0\in \mathbb {R}^n\) (we take \(x_0=x_\Gamma\) in the numerical example below), (ii) selecting a realisation of the sequence \(\{m_j\}_{j\in \mathbb N}\) of i.i.d. random variables taking values in \(\{1,\ldots ,M\}\) with probabilities \(\{p_1,\ldots ,p_M\}\), (iii) constructing the stochastic sequence \(x_j=s_{m_j}(x_{j-1})\) for \(j\in \mathbb N\), and (iv) approximating the integral of a continuous function f as

$$\begin{aligned} Q_\Gamma ^{CG}[f] =\frac{1}{N}\sum _{j=1}^N f(x_j)\xrightarrow {N\rightarrow \infty } \int _\Gamma f(x)\mathrm {d}\mu (x). \end{aligned}$$

We first consider the case where \(\Gamma \subset \mathbb {R}^2\) is the Koch snowflake, the attractor of an non-homogeneous non-disjoint IFS with \(M=7\) whose parameters are given in Fig. 3. We consider integration of the (smooth) function \(f(x)=\cos |x|/(1+|x|^2)\) over \(\Gamma\) with respect to the non-Hausdorff invariant measure \(\mu\) with \(\mu (\Gamma )=1\) and the following randomly chosen weights/probabilities:

$$\begin{aligned} (p_1,p_2,p_3,p_4,p_5,p_6,p_7)=(0.052,0.214,0.104, 0.038,0.110,0.194,0.288). \end{aligned}$$

For this non-Hausdorff invariant measure it is instructive to compare how the two quadrature rules deal with the non-uniform way in which the mass of the measure is distributed across \(\Gamma\). In Fig. 9, we plot the nodes and weights for the barycentre rule for the case \(h=0.01\) (which corresponds to \(N=35,839\)) alongside those for one realisation of the chaos game rule with the same \(N=35,839\). Each node is represented by a small dot, coloured according to the corresponding quadrature weight. For the chaos game, the weights are uniform, all being equal to 1/N, but the nodes are distributed non-uniformly, being concentrated in the regions where the measure has greatest mass. In contrast, the nodes for the barycentre rule are distributed approximately uniformly, but the weights vary according to the measure.

Fig. 9
figure 9

Visual representation of barycentre rule (left) and chaos game quadrature (right) on the Koch snowflake, for a randomly chosen invariant measure. Each quadrature node is represented by a small dot, coloured according to the corresponding quadrature weight

In Fig. 10, we plot the relative quadrature errors \(|Q_\Gamma [f]-I^{\mathrm {ref}}_\Gamma [f]|/|I^{\mathrm {ref}}_\Gamma [f]|\) and \(|Q_\Gamma ^{CG}[f]-I^{\mathrm {ref}}_\Gamma [f]|/|I^{\mathrm {ref}}_\Gamma [f]|\) against the number N of point evaluations of f, for a range of values of N between 463 and 320,503. Here, the reference value \(I^{\mathrm {ref}}_\Gamma [f]\) was computed using the barycentre rule with \(N=2,876,335\) (which corresponds to \(h=10^{-3}\)). For the chaos game rule, the plots show both the individual errors for each of 1000 random realisations (thin blue lines) and the average of these individual errors (thick red line), which represents an approximation to the statistical expectation of the error for the chaos game rule. The error for the barycentre rule clearly decays like \(h^2\sim N^{-2/d}=N^{-1}\), consistently with Theorem 3.6(iii) and Remark 3.9, even if the latter does not directly apply to non-homogeneous IFSs,Footnote 1 while the average error for the chaos game rule decays like \({N^{-1/2}}\), as one expects from a Monte-Carlo-type stochastic method. So for this problem the barycentre rule clearly outperforms the chaos game rule. Comparing the convergence rates \(h^2\sim N^{-2/d}\) (for the homogeneous case and the present one) and \(N^{-1/2}\), we expect that the advantage provided by the barycentre rule over the chaos game rule is even stronger for the lower-dimensional attractors considered in the previous numerical experiments.

Fig. 10
figure 10

Convergence of the barycentre rule and the chaos game rule for integration of a smooth integrand with respect to a non-Hausdorff invariant measure on the Koch snowflake. For the chaos game rule, we show both the individual errors for each of 1000 random realisations (thin blue lines) and the average of these individual errors (thick red line)

For higher-dimensional problems, we might expect the stochastic approach to become more competitive. To investigate this, we consider the case where \(\Gamma\) is a high-dimensional Cantor dust. Specifically, we take \(\Gamma =(\Gamma _\rho )^6\subset [0,1]^6\subset \mathbb R^6\), a 6-fold Cartesian product of a homogeneous dyadic Cantor set \(\Gamma _\rho \subset \mathbb R\) (with contractions \(s_1(x)=\rho x\) and \(s_2(x)=1-\rho +\rho x\) for some \(0<\rho <1/2\)) with itself, so that \(\Gamma\) is the attractor of a homogeneous, disjoint IFS with \(M=2^6=64\) and \(d=\text{dim}_{\mathrm{H}}(\Gamma )=\log {M}/\log (1/\rho )=6\log {2}/\log (1/\rho )\). Figure 11 shows the relative quadrature errors for integration of the (smooth) integrand \(f(x)=\cos |x|/(1+|x|^2)\) with respect to the normalised Hausdorff measure \(\mu =\frac{1}{\mathcal {H}^d(\Gamma )}\mathcal {H}^d|_\Gamma\), for three different values of \(\rho\), namely \(\rho \in \{\frac{1}{4}, \frac{1}{2\sqrt{2}},\frac{1}{2^{6/5}} \}\), corresponding to \(d=\text{dim}_{\mathrm{H}}(\Gamma )\in \{3,4,5\}\) respectively. Both rules are applied with \(N\in \{64,64^2,64^3\}=\{64, 4096, 262,144\}\) and the reference value is computed using the barycentre rule with \(N=64^4=16,777,216\).

For all three values of the dimension d, the barycentre rule converges like \(h^2\sim N^{-2/d}\), as predicted by Theorem 3.6(iii), while the average error for the chaos game rule converges consistently like \(N^{-1/2}\). Hence for \(d=3\) the barycentre rule converges faster; for \(d=4\) the two methods converge at the same rate, and for \(d=5\) the chaos game rule converges faster (although we note that in this particular experiment the errors for the barycentre rule were smaller than the expected errors for the chaos game even for \(d=5\)).

Fig. 11
figure 11

Convergence of the barycentre rule and the chaos game rule for the approximation of a single smooth integral on three Cantor dusts \(\Gamma \subset \mathbb R^6\) with \(d=\text{dim}_{\mathrm{H}}(\Gamma )=3,4,5\)