1 Article Highlights

  • A tensor-based formalism is shown to yield analytical formulas for the gravitational field of polyhedrons having a polynomial density contrast

  • Analytical formulas are provided as function of the 3D coordinates of the vertices of the polyhedron and the parameters of a fourth-order polynomial density contrast

  • Singularity-free formulas for the gravitational potential and gravity vector, referred to an arbitrary position of the observation point, have been implemented in a MATLAB code

2 Introduction

Gravity modeling plays a fundamental role in interpreting gravity data sets that are measured using gravimeters based on land, in boreholes or on board satellite, marine or aircraft vessels and used to estimate locations and shapes of bodies embedded in the earth, see, e.g., Nabighian et al. (2005) for a recent historical account.

In practice gravity data may be inverted, in conjunction with geophysical data sets such as seismic data and electromagnetic induction data (Moorkamp et al. 2011; Aydemir et al. 2014; Roberts et al. 2016), in order to provide more accurate models of the earth.

Recent improvements in gravimeter efficiency and inversion algorithms allow for a wide application of the gravity methods in several geophysical and geodetic problems such as studies addressing Moho and Crustal structure (Van der Meijde et al. 2013; De Castro et al. 2014), mineral exploration (Beiki and Pedersen 2010; Martinez et al. 2013; Abtahi et al. 2016) and geoid determination (Bajracharya and Sideris 2004).

Accordingly, it is of paramount importance to efficiently and accurately approximate the true mass density variations of the earth, e.g., sedimentary basins and bedrock topography, by suitable volume discretization techniques.

To this end several approaches have been exploited over time, both numerical and analytical, and increasing levels of refinement have been adopted for the basic geometric block used to discretize the earth volume (prism, polyhedron, etc.) and for selecting the related density variation (constant, linear, exponential, etc.).

Common to all gravity forward modeling techniques is the evaluation of the so-called Newton’s integrals that can be performed either numerically or analytically, adopting in both strategies either a spatial or a spectral, of Fourier, domain (Kuhn and Seitz 2005).

Numerical strategies approximate the integrals by exploiting, e.g., the finite element method (Cai and Wang 2005; Kaftan et al. 2005), or finite difference methods (Farquharson and Mosher 2009; Jahandari and Farquharson 2013).

Alternatively, the integrand is expanded in terms of harmonic series and the potential harmonic coefficients are evaluated by different techniques (Colombo 1981; Cunningham 1970; Gottlieb 1993; Chao and Rubincam 1989; Balmino 1994; Werner 1997; Jamet and Thomas 2004; Chen et al. 2019; Jamet and Tsoulis 2020).

In the context of numerical methods Newton’s integrals are evaluated in the spectral domain by using Fast Fourier Transform (FFT) or spherical transform algorithms. A brief review of FFT-based algorithms has been provided in Wu (2016; 2018). Subsequently, both 2D and 3D Fourier-domain expressions of gravity effects due to an arbitrary polyhedron with constant or exponential density distributions have been provided in Wu (2019).

Concerning the analytical approach in the spatial domain, closed-form expressions of the integrals have been evaluated, in the case of constant density, in Nagy (1966), Banerjee and Das Gupta (1977), Cady (1980), Nagy et al. (2000), Tsoulis (2000), Jiancheng and Wenbin (2010) and D’Urso (2012), see also Plouff (1975, 1976), Won and Bevis (1987) and Montana et al. (1992) for computer codes.

Analytical expressions of the gravity anomaly for prisms have been derived by D’Urso (2016), for a linearly varying density, by Rao (1985, 1986, 1990), Rao et al. (1994), Gallardo-Delgado et al. (2003) for a quadratic density contrast, by García-Abdeslem (1992, 2005), for a cubic density variation with depth by Fukushima (2018) as well as Zhang and Jiang (2017) for density varying as an arbitrary-order polynomial function. A good collection of earlier references for 3D prisms can be found in Li and Chouteau (1998).

Non-polynomial density contrast models for 3D bodies have been considered by Cordell (1973), Chai and Hinze (1988), Litinsky (1989), Rao et al. (1990), Chakravarthi et al. (2002), Silva et al. (2006), Chakravarthi and Sundararajan (2007), Chappell and Kusznir (2008) and Zhou (2009b) while, for 2D bodies, by Gendzwill (1970), Murthy and Rao (1979), Pan (1989), Guspí (1990), Ruotoistenmäki (1992), Martín-Atienza and García-Abdeslem (1999), Zhang et al. (2001) and Zhou (2008, 2009a, 2010). For more complicated forms of the density contrast, see, e.g., Cai and Wang (2005) and Mostafa (2008).

Besides the case of prisms endowed with complicated functions describing density contrast, research has addressed the case of polyhedrons having complicated density contrast. In this respect analytical formulas for the gravimetric analysis have been contributed by Paul (1974), Barnett (1976), Strakhov (1978), Okabe (1979), Waldvogel (1979), Golizdra (1981), Strakhov et al. (1986), Götze and Lahmeyer (1988), Pohanka (1988), Murthy et al. (1989), Kwok (1991b), Werner (1994), Holstein and Ketteridge (1996), Petrović (1996), Werner and Scheeres (1997), Li and Chouteau (1998), Tsoulis (2012), D’Urso (2013a, 2014a), Conway (2015) and Werner (2017). Subsequent advancements have been only concerned with a linear density variation (Pohanka 1998; Hansen 1999; Holstein 2003; Hamayun et al. 2009; D’Urso 2014b).

Significant advancements in the evaluation of closed-form solutions for the gravitational field and gravitational contrast of polyhedral bodies having a polynomial density function of arbitrary order have been recently contributed by D’Urso and Trotta (2017), extending a similar treatment addressing the gravity anomaly of polygonal bodies D’Urso (2015), and later addressed in Chen et al. (2018) and a series of papers by Ren and coworkers (2017; 2018a; b; 2020).

Remarkably, in the last paper, the authors provide closed-form solutions of the gravitational potential and the gravitational field that are singularity-free, an issue previously discussed in Kwok (1991a), for prism-based modeling, and Tsoulis and Petrović (2001) for polyhedra.

The methodology outlined in D’Urso and Trotta (2017) is further generalized in order to derive an analytical expression of the gravitational potential and gravitational vector for polyhedral bodies having density contrast expressed as a polynomial function of arbitrary degree. The result is obtained by a version of the generalized Gauss theorem that extends to tensors of arbitrary order the result first presented in D’Urso (2012, 2013a), and subsequently applied to several problems ranging from geodesy (D’Urso 2014a, b; D’Urso and Trotta 2015; D’Urso 2016), to geomechanics (D’Urso and Marmo 2009; Sessa and D’Urso 2013; D’Urso and Marmo 2015), to geophysics (D’Urso and Marmo 2013), elasticity (Marmo and Rosati 2016; Marmo et al. 2016a, b, 2017, 2018; Trotta et al. 2016a, b, 2018) and to heat transfer (Rosati and Marmo 2014).

Specifically, the volume integral of quantities expressed as tensor products of suitable vectors is first reduced to a 2D boundary integral and subsequently written as a finite sum of 2D integrals extended to the faces of the polyhedral body \(\varOmega \). By a further application of the generalized Gauss theorem, each face integral is reduced to the sum of 1D integrals, extended to the edges of the face, that are analytically evaluated.

Due to space limitations the tensorial formalism developed in this paper is explicitly illustrated only for polynomial functions up to the fourth-order but it can be easily adapted to functions of greater order by suitably exploiting the general approach outlined in the paper. This leads to algebraic expressions of the gravitational potential and the gravity vector that are shown to be well-defined and singularity-free whatever is the position of the observation point with respect to \( \varOmega \).

The paper is organized as follows. Section 2 sets the stage for the formalism adopted in the paper by making reference to concepts and methods of tensor analysis briefly presented in Appendix A.

The gravitational potential of a polyhedral body, endowed with a polynomial density function of fourth-order as a maximum, is elaborated upon in Sect. 2.1 where Gauss’ theorem is used to provide the expression of the potential in terms of integrals extended to the boundary of the target. Being the body polyhedral such integrals are expressed in Sect. 2.2 as 2D integrals extended to each face of the target. Based on results of tensor analysis, detailed in Appendix B, and a further application of Gauss’ theorem the 2D integrals extended to each face are expressed in Sect. 2.3 in terms of 1D integrals over each edge of the generic face.

Subsequently, in Sect. 2.4, the 1D integrals are transformed into algebraic expressions, invoking the results presented in Appendix C, that depend upon the 2D coordinates of the vertices of the face expressed in a reference frame local to the face. The singularity-free nature of the final expression is proved in Sect. 2.5.

Basically the same path of reasoning is adopted for the gravity vector in Sects. 3.13.5. Section 4 shows how to express the algebraic expressions of the gravitational potential and gravity vector in terms of the 3D coordinates of the vertices of the polyhedron, while Sect. 5 is devoted to the numerical validation of the proposed approach.

Specifically, Sect. 5.1 includes a comparison with similar results presented in the literature. Sect. 5.2 shows the results of some numerical tests carried out to assess the rounding error sensitivity of the analytical formulas derived in the paper with respect to the dimensionless target distance (Holstein and Ketteridge 1996). Furthermore Sect. 5.3 validates the proposed tensorial approach by proving that the results of the formulas presented in the paper hold true irrespective of arbitrary rotations of the observation point and the target body that leave unaltered their mutual position.

Finally, the Conclusions in Sect. 6 summarize the main findings of the paper and highlight the future developments of the research.

3 Gravitational Potential of a Polyhedral Body Having a Polynomial Density

Let us consider a Cartesian reference frame having origin at an arbitrary point O and a polyhedral body \(\varOmega \) whose continuum mass distribution is assumed to have a density \( \delta (\textbf{s})\) varying as a polynomial function of the position vector \( \textbf{s}= (x,y,z)\) of an arbitrary point belonging to it:

$$\begin{aligned} \delta (\textbf{s})=\sum _{i=0}^{N}\sum _{j=0}^{N-i}\sum _{k=0}^{N-(i+j)} c_{ijk} x^i y^jz^k{.} \end{aligned}$$
(1)

In the above formula, the constants \( c_{ijk} \) with non-negative suffixes ijk are taken as known coefficients of the assumed polynomial density law while N represents the maximum power of the polynomial density function. We shall confine the treatment to the case \( N {\le } 4 \) since this will suffice to address the majority of the practical applications and, at the same time, to present our formulation with a sufficient degree of generality to deduce the cases \(N > 4\).

More explicitly, for \(N = 4\), Eq. (1) becomes

$$\begin{aligned} \begin{array}{ll} \delta (\textbf{s})&{} {=}\, c_{000} {+}\, c_{100}x{+}c_{010}y{+}c_{001}z {+}c_{200}x^2{+}c_{020}y^2{+}c_{002}z^2{+}c_{110}xy \\ &{}\quad {+}c_{011}yz{+}c_{101}xz\,\\ &{} \quad +\, c_{300}x^3+c_{030}y^3+c_{003}z^3+c_{210}x^2y+c_{021}y^2z+c_{102}xz^2\\ &{} \quad +c_{120}xy^2+c_{012}yz^2\,\\ &{} \quad +\, c_{201}x^2z+c_{111}xyz \,\\ &{} \quad +\, c_{400}x^4+c_{040}y^4+c_{004}z^4+c_{310}x^3y+c_{031}y^3z\\ &{}\quad +c_{103}xz^3+c_{130}xy^3+c_{013}yz^3\,\\ &{} \quad +\, c_{301}x^3z+c_{220}x^2y^2+c_{022}y^2z^2+c_{202}x^2z^2+c_{211}x^2yz \\ &{} \quad +c_{121}xy^2z+c_{112}xyz^2. \end{array} \end{aligned}$$
(2)

Denoting by \(\textbf{p}\) the position vector of an arbitrary point P, the gravitational potential U induced at P by the mass of \(\varOmega \) is expressed as

$$\begin{aligned} U(P)=U(\textbf{p})=G\int \limits _{\varOmega }\frac{\delta (\textbf{s})}{[(\textbf{p}-\textbf{s})\cdot (\textbf{p}-\textbf{s})]^{1/2}} \textrm{d}V(\textbf{s}){,} \end{aligned}$$
(3)

where G is the gravitational constant and the function \(\delta \) is given by (1).

In order to simplify the previous expression it is convenient to introduce the relative position \( \textbf{r}=\textbf{s}-\textbf{p}\) of an arbitrary point of \(\varOmega \) with respect to \( \textbf{p}\), see, e.g., Fig. 1. Accordingly, we express the function \(\delta \) as follows

$$\begin{aligned} \delta (\textbf{s}) = \delta _o + \mathcal {C}^{(1)}\cdot \mathcal {D}_{\textbf{s}}^{(1)}+ \mathcal {C}^{(2)}\cdot \mathcal {D}_{\textbf{s}}^{(2)} + \mathcal {C}^{(3)}\cdot \mathcal {D}_{\textbf{s}}^{(3)} + \mathcal {C}^{(4)}\cdot \mathcal {D}_{\textbf{s}}^{(4)}{,} \end{aligned}$$
(4)

where \( \delta _o = c_{000} \) is the density at \( \textbf{s}=\textbf{o}\), i.e., at the origin of the reference frame, \( \mathcal {D}_{\textbf{s}}^{(1)}=\textbf{s}\) while \( \mathcal {D}_{\textbf{s}}^{(2)} \), \( \mathcal {D}_{\textbf{s}}^{(3)} \) and \( \mathcal {D}_{\textbf{s}}^{(4)} \) are defined in the formulas (204), (207) and (210), respectively, of Appendix A. Matrix representation of \( \mathcal {C}^{(1)} \), \( \mathcal {C}^{(2)} \), \( \mathcal {C}^{(3)} \) and \( \mathcal {C}^{(4)} \) is provided in the formulas (229) and (232) while the dot product between tensors is defined in formula (227).

In conclusion, setting \( \textbf{r}=\textbf{s}-\textbf{p}\) in (3) and exploiting (4) the gravitational potential of a polyhedral body \(\varOmega \) whose density varies as in (1) is given by

$$\begin{aligned} U(\textbf{p})=G\int \limits _{\varOmega }\frac{\delta _o + \sum _{k=1}^{4} \mathcal {C}^{(k)}\cdot \mathcal {D}_{\textbf{s}}^{(k)}}{( \textbf{r}\cdot \textbf{r})^{1/2}} \textrm{d}V(\textbf{s})=\sum _{k=0}^{4} U^{(k)}(\textbf{p}){,} \end{aligned}$$
(5)

where \( U^{(k)}(\textbf{p}) \) denotes the contribution to the gravitational potential associated with the k-th power of the polynomial law representing the density variation.

In order to actually compute the gravitational potential in (5) we notice that the statement of \( U^{(0)}(\textbf{p}) \) is elementary

$$\begin{aligned} U^{(0)}(\textbf{p})=G \delta _o \int \limits _{\varOmega }\frac{ \textrm{d}V}{( \textbf{r}\cdot \textbf{r})^{1/2}}{,} \end{aligned}$$
(6)

since it amounts to consider a polyhedron of constant density; on the contrary, the evaluation of the additional terms \( U^{(i)}(\textbf{p}) \) in (5), \( i\in [1,4] \), requires further manipulations. Actually, recalling the definition of \( \mathcal {D}^{(i)}_{\textbf{s}} \), provided in (204), (207) and (210), for i = 2, 3 and 4, respectively, one has to consider tensors in which some of the building blocks require some integration.

To set the stage, let us first consider the trivial case \( i =1 \)

$$\begin{aligned} U^{(1)}(\textbf{p})=G \ \mathcal {C}^{(1)} \cdot \int \limits _{\varOmega }\frac{\textbf{s}\ \textrm{d}V(\textbf{s})}{(\textbf{r}\cdot \textbf{r})^{1/2}}=G \ \mathcal {C}^{(1)} \cdot \Bigg [\int \limits _{\varOmega }\frac{\textbf{r}\ \textrm{d}V}{(\textbf{r}\cdot \textbf{r})^{1/2}}+\textbf{p}\int \limits _{\varOmega }\frac{\textrm{d}V}{(\textbf{r}\cdot \textbf{r})^{1/2}} \Bigg ]{.} \end{aligned}$$
(7)

Hence, setting

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(m, 1/2)}= \int \limits _{\varOmega }\frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{1/2}} \textrm{d}V \quad m=0,1,\ldots \quad {,} \end{aligned}$$
(8)

where

$$\begin{aligned}{}[\otimes \textbf{r},m]=\left\{ \begin{array}{ll} 1 \quad &{} \text {if } \quad m=0 \\ \textbf{r}\quad &{} \text {if }\quad m=1 \\ \textbf{r}\otimes \textbf{r}\quad &{} \text {if }\quad m=2\\ \ldots \ldots \ldots &{} \ldots \ldots \ldots \ldots \\ \underbrace{\textbf{r}\otimes \textbf{r}\otimes \cdots \otimes \textbf{r}}_{m \,\,\,times} &{} \text {if }\quad m>2 \end{array}{,} \right. \end{aligned}$$
(9)

one has

$$\begin{aligned} U^{(1)}(\textbf{p})= G \ \mathcal {C}^{(1)} \cdot \bigg [ \mathcal {R}_{\varOmega }^{(1, 1/2)} + \mathcal {R}_{\varOmega }^{(0, 1/2)} \ \textbf{p}\bigg ]{.} \end{aligned}$$
(10)

Accordingly, recalling (204), we can set:

$$\begin{aligned} U^{(2)}(\textbf{p})= G \ \mathcal {C}^{(2)} \cdot \bigg [ (\textbf{p}\otimes \textbf{p}) \mathcal {R}_{\varOmega }^{(0, 1/2)} +\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1, 1/2)}+\mathcal {R}_{\varOmega }^{(1, 1/2)}\otimes \textbf{p}+\mathcal {R}_{\varOmega }^{(2, 1/2)} \bigg ]{.} \nonumber \\ \end{aligned}$$
(11)

Similarly, on account of (207), (208) and (209) one has

$$\begin{aligned} \displaystyle U^{(3)}(\textbf{p}) \displaystyle{} & {} =G \ \mathcal {C}^{(3)} \cdot \bigg [ (\textbf{p}\otimes \textbf{p}\otimes \textbf{p}) \mathcal {R}_{\varOmega }^{(0, 1/2)}+\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1, 1/2)}\nonumber \\{} & {} \quad +\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1, 1/2)}\otimes \textbf{p}+\mathcal {R}_{\varOmega }^{(1, 1/2)}\otimes \textbf{p}\otimes \textbf{p}\nonumber \\{} & {} \quad +\displaystyle \mathcal {R}_{\varOmega }^{(2, 1/2)}\otimes \textbf{p}+\mathcal {R}_{\varOmega }^{(2, 1/2)}\otimes _{132}\textbf{p}+\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2, 1/2)} +\mathcal {R}_{\varOmega }^{(3, 1/2)} \bigg ]{,} \end{aligned}$$
(12)

where the meaning of the symbol \(\otimes _{132}\) is detailed in Appendix A.

Finally, based on (210), (211), (212) and (213), it turns out to be

$$\begin{aligned} U^{(4)}(\textbf{p}) =G \ \mathcal {C}^{(4)} \cdot \bigg [ \mathcal {A}^{(4)}_{\textbf{p}}+\mathcal {A}^{(3)}_{\textbf{p}}+\mathcal {A}^{(2)}_{\textbf{p}}+\mathcal {A}^{(1)}_{\textbf{p}}+\mathcal {R}_{\varOmega }^{(4, 1/2)} \bigg ]{,} \end{aligned}$$
(13)

where

$$\begin{aligned} \mathcal {A}^{(4)}_{\textbf{p}}= & {} \Big (\textbf{p}\otimes \textbf{p}\otimes \textbf{p}\otimes \textbf{p}\Big )\mathcal {R}_{\varOmega }^{(0, 1/2)} \end{aligned}$$
(14)
$$\begin{aligned} \displaystyle \mathcal {A}^{(3)}_{\textbf{p}}= & {} \displaystyle \textbf{p}\otimes \textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1, 1/2)}+\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1, 1/2)}\otimes \textbf{p}+\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1, 1/2)}\otimes \textbf{p}\otimes \textbf{p}\nonumber \\{} & {} +\mathcal {R}_{\varOmega }^{(1, 1/2)}\otimes \textbf{p}\otimes \textbf{p}\otimes \textbf{p}\end{aligned}$$
(15)
$$\begin{aligned} \displaystyle \mathcal {A}^{(2)}_{\textbf{p}}= & {} \textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2, 1/2)}+ \displaystyle \Big (\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2, 1/2)}\Big )_{1324}+\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2, 1/2)}\otimes \textbf{p}\nonumber \\{} & {} \displaystyle + \Big (\mathcal {R}_{\varOmega }^{(2, 1/2)}\otimes \textbf{p}\otimes \textbf{p}\Big )_{1423} +\Big (\mathcal {R}_{\varOmega }^{(2, 1/2)}\otimes \textbf{p}\otimes \textbf{p}\Big )_{1324}+\mathcal {R}_{\varOmega }^{(2, 1/2)}\otimes \textbf{p}\otimes \textbf{p}\nonumber \\ \end{aligned}$$
(16)
$$\begin{aligned} \mathcal {A}^{(1)}_{\textbf{p}}= & {} \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(3, 1/2)}+ \mathcal {R}_{\varOmega }^{(3, 1/2)}\otimes _{1342}\textbf{p}+\mathcal {R}_{\varOmega }^{(3, 1/2)}\otimes _{1243}\textbf{p}+ \mathcal {R}_{\varOmega }^{(3, 1/2)}\otimes \textbf{p}{,} \end{aligned}$$
(17)

the symbol \(\otimes _{1243}\) and the analogous ones being specified in Appendix A.

3.1 Analytical Expression of the Gravitational Potential (GP) in Terms of 2D Integrals

It is apparent from the previous formulas that the only real burden required to compute the generic addend \( U^{(i)}(\textbf{p}) \) is that associated with the evaluation of the integrals \( \mathcal {R}_{\varOmega }^{(m, 1/2)} \) in (8). This has already been done in D’Urso (2013a), for \( m=0 \) and \( m=1 \).

However, to illustrate a more general approach, we prove the following preliminary result

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(m, 1/2)}=\int \limits _{\varOmega } \frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}V= \frac{1}{m+2}\int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}A \quad m=0,1,\ldots \quad {,} \end{aligned}$$
(18)

where \(\textbf{n}\) is the 3D outward unit normal to the boundary \( \partial \varOmega \) of the polyhedral body.

To fix the ideas, we shall prove the identity (18) for \(m=2\)

$$\begin{aligned} \int \limits _{\varOmega } \frac{\textbf{r}\otimes \textbf{r}}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}V = \frac{1}{4}\int \limits _{\partial \varOmega } \frac{(\textbf{r}\otimes \textbf{r})(\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}A{,} \end{aligned}$$
(19)

since it allows us to illustrate our approach to a degree of generality sufficient to extend the final result to all integrals in (18).

Recalling the differential identity (255) reported in Appendix B it turns out to be

$$\begin{aligned} \begin{array}{rl} \displaystyle \text {div}&{}\displaystyle \Biggl [(\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r})\otimes \frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ]\\ =&{}\displaystyle \Biggl [(\textbf{r}\otimes \textbf{r})\otimes \frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ] \text {grad}\,(\textbf{r}\cdot \textbf{r})+(\textbf{r}\cdot \textbf{r}) \Biggl [(\text {grad}\, \textbf{r})\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ]\otimes \textbf{r}\\ &{}+\displaystyle (\textbf{r}\cdot \textbf{r})\textbf{r}\otimes \Biggl [(\text {grad}\,\textbf{r})\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ]+ (\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r}) \,\text {div}\,\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}. \end{array} \end{aligned}$$
(20)

Applying the further identity (250) one has \( \text {grad}\,(\textbf{r}\cdot \textbf{r})=2\, \textbf{r}\) since \(\text {grad}\,\textbf{r}=\mathcal {I}^{(2)}\), being \(\mathcal {I}^{(2)}\) the rank-two identity tensor. Hence, formula (20) becomes

$$\begin{aligned} \begin{array}{rl} \displaystyle \text {div}&{}\displaystyle \Biggl [(\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r})\otimes \frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ]\\ =&{}\displaystyle 2\Biggl [(\textbf{r}\otimes \textbf{r})\otimes \frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ]\textbf{r}+(\textbf{r}\cdot \textbf{r})\Biggl [\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\otimes \textbf{r}+ \textbf{r}\otimes \frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ]\\ &{} \displaystyle +(\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r}) \,\text {div}\,\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}} = 4 \frac{\textbf{r}\otimes \textbf{r}}{(\textbf{r}\cdot \textbf{r})^{1/2}} + (\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r})\,\text {div}\,\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}. \end{array} \end{aligned}$$
(21)

Finally, integrating the previous identity over \(\varOmega \) yields

$$\begin{aligned} \int \limits _\varOmega \frac{\textbf{r}\otimes \textbf{r}}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}V= & {} \frac{1}{4}\Biggl \{ \int \limits _\varOmega \text {div}\Biggl [(\textbf{r}\otimes \textbf{r})\otimes \frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{1/2}}\Biggr ] \textrm{d}V \nonumber \\{} & {} - \int \limits _\varOmega (\textbf{r}\cdot \textbf{r}) (\textbf{r}\otimes \textbf{r}) \,\text {div}\,\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}} \textrm{d}V\,\Biggr \}. \end{aligned}$$
(22)

The second integral on the right-hand side can be computed by means of the general result Tang (2006)

$$\begin{aligned} \int \limits _\varOmega \varphi (\textbf{r})\text {div}\,\Biggl [\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ]\textrm{d}V= \left\{ \begin{array}{ccc} 0 &{} \quad \text{ if } &{} \quad \textbf{o}\not \in \varOmega \\ \alpha (\textbf{o})\,\varphi (\textbf{o}) &{} \quad \text{ if } &{} \quad \textbf{o}\in \varOmega \end{array} \right. , \end{aligned}$$
(23)

where \(\varphi \) is a continuous scalar field and the quantity \(\alpha \) represents the angular measure, expressed in steradians, of the intersection between \(\varOmega \) and a spherical neighborhood of the singularity point \(\textbf{r}=\textbf{o}\), see, e.g., D’Urso (2012, 2013a, 2014a) for additional details. The previous expression can be extended to arbitrary tensors by applying it to each scalar component of the tensor.

On account of (23) one infers that the second integral on the right-hand side of (22) is the null rank-two tensor \(\textbf{O}\) since

$$\begin{aligned} \displaystyle \int \limits _\varOmega (\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r}) \,\text {div}\,\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}} \textrm{d}V = \left\{ \begin{array}{ll} {\textbf{O}} \quad &{} \text {if } \quad \textbf{o}\not \in \varOmega \\ \left[ (\textbf{r}\cdot \textbf{r}) \textbf{r}\otimes \textbf{r}\right] _{\textbf{r}=\textbf{o}}\alpha (\textbf{o}) \quad &{} \text {if }\quad \textbf{o}\in \varOmega \end{array}{.} \right. \end{aligned}$$
(24)

However, the expression \([(\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r})]_{\textbf{r}=\textbf{o}}\) amounts to evaluating the quantity \((\textbf{r}\cdot \textbf{r})(\textbf{r}\otimes \textbf{r})\) at the singularity point \(\textbf{r}=\textbf{o}\), that yields trivially the null tensor \(\textbf{O}\). Hence, according to (24), the last integral in (22) is always the null tensor, independently of the position of singularity point \(\textbf{r}=\textbf{o}\) with respect to the domain \(\varOmega \) of integration.

Upon application of Gauss’ theorem to the second integral in (22), we finally infer the identity (19), according to which the singularity at \(\textbf{r}=\textbf{o}\) of the integrand function appearing on the left-hand side, can be actually ignored. Furthermore, it is not difficult to rephrase the path of reasoning detailed in formulas (2024) so as to prove the more general formula (18).

In conclusion, we have proved that the expression (5) of the gravitational potential is well-defined whatever is the order of the polynomial law expressing the density variation of \(\varOmega \) in the sense that it exhibits no singularity whatever is the position of the point \( \textbf{p}\) with respect to \(\varOmega \). It should be mentioned, however, that the algebraic counterparts of the integrals (18) do contain further singularities; nevertheless, it will be proved in Sect. 2.5 that such singularities are removable. They can be made ineffective from a computational point of view provided that the above-mentioned algebraic expressions are suitably programmed.

To actually compute the generic addend \( U^{(i)}(\textbf{p}) \) in (5) we exploit formula (18) to express the generic integral \( \mathcal {R}_{\varOmega }^{(m,1/2)} \) in (5) by means of boundary integrals

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(m,1/2)}= & {} \int \limits _{\varOmega } \frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}V= \frac{1}{m+2}\int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}A=\frac{1}{m+2} \mathcal {R}_{\partial \varOmega }^{(m,1/2)}\nonumber \\{} & {} \quad m=0,1,\ldots \quad {,} \end{aligned}$$
(25)

However, the previous expressions, and hence those expressing \( U^{(i)}(\textbf{p}) \), can be further elaborated upon to transform 2D integrals to 1D integrals.

3.2 Analytical Expression of the GP in Terms of Face Integrals

In order to derive an expression suitable for programming, we specialize formula (25) to polyhedral domains since this is by far the most general case for practical applications.

For a polyhedral body characterized by \(N_F\) faces, the generic integral in (25) can be written as

$$\begin{aligned} \mathcal {R}_{\partial \varOmega }^{(m,1/2)}=\int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}A= \sum _{i=1}^{N_F}\int \limits _{F_i} \frac{[\otimes \textbf{r}_i,m](\textbf{r}_i\cdot \textbf{n}_i)}{(\textbf{r}_i\cdot \textbf{r}_i)^{1/2}}\textrm{d}A_i{,} \end{aligned}$$
(26)

where \( \textbf{r}_i \) represents the generic vector spanning the i-th face \( F_i \) of \(\varOmega \) and \( \textbf{n}_i \) the unit vector, orthogonal to \( F_i \), pointing outwards \( \varOmega \). However the previous integrals can be further simplified as follows

$$\begin{aligned} \mathcal {R}_{\partial \varOmega }^{(m,1/2)}=\int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{1/2}}\textrm{d}A=\sum _{i=1}^{N_F}\int \limits _{F_i} \frac{[\otimes \textbf{r}_i,m](\textbf{r}_i\cdot \textbf{n}_i)}{(\textbf{r}_i\cdot \textbf{r}_i)^{1/2}}\textrm{d}A_i=\sum _{i=1}^{N_F} \ d_i \ \mathcal {R}_{F_{i}}^{(m,1/2)}{,}\nonumber \\ \end{aligned}$$
(27)

where \( d_i=\textbf{r}_i\cdot \textbf{n}_i=\textbf{r}^{\perp }_i\cdot \textbf{n}_i \).

The 2D integrals above can be transformed to a line integral by a further application of Gauss’ theorem. To this end we denote by \(O_i\) the orthogonal projection on \(F_i\) of the observation point P and assume \(O_i\) as origin of a 2D reference frame local to the face.

Fig. 1
figure 1

Polyhedral domain \(\varOmega \) and decomposition of the position vector of a point on a face

Furthermore, we express \( \textbf{r}_i \) as

$$\begin{aligned} \textbf{r}_i=\textbf{r}_i^\perp +\textbf{r}_i^\parallel =(\textbf{r}_i\cdot \textbf{n}_i)\textbf{n}_i+\textbf{r}_i^\parallel =d_i\textbf{n}_i+\textbf{T}_{F_i}{\varvec{\rho }}_i{,} \end{aligned}$$
(28)

where the vector \({\varvec{\rho }}_i=(\xi _i,\eta _i)\) represents the position vector of a generic point of the i-th face with respect to \(O_i\) and

$$\begin{aligned} \textbf{T}_{F_i}= \left[ \begin{array}{c@{\;\;\;}c} u_{i1}&{}v_{i1}\\ u_{i2}&{}v_{i2}\\ u_{i3}&{}v_{i3} \end{array} \right] \end{aligned}$$
(29)

is the linear operator mapping the 2D vector \({\varvec{\rho }}_i\) to the 3D one \(\textbf{r}_i^\parallel \). In turn \(\textbf{u}_i\) and \(\textbf{v}_i\) represent two distinct, yet arbitrary, 3D unit vectors coplanar with \(F_i\).

Accordingly, being \( \textbf{r}_i \cdot \textbf{r}_i ={\varvec{\rho }}_i \cdot {\varvec{\rho }}_i +d^{2}_i \), we are thus led to computing the following integrals

$$\begin{aligned} \displaystyle \mathcal {R}_{F_i}^{(0,1/2)}= & {} \displaystyle \int \limits _{F_i} \frac{\textrm{d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}} =\textrm{P}_{F_i}^{(0,1/2)}{,} \end{aligned}$$
(30)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i}^{(1,1/2)}= & {} \displaystyle \int \limits _{F_i} \frac{d_i\textbf{n}_i+\textbf{T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}\textrm{d}A_i =d_i\,\textbf{n}_i\,\textrm{P}_{F_i}^{(0,1/2)}+\textbf{T}_{F_i} \textrm{P}_{F_i}^{(1,1/2)}{,} \end{aligned}$$
(31)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i}^{(2,1/2)}= & {} \displaystyle \int \limits _{F_i} \frac{(d_i\textbf{n}_i+\textbf{T}_{F_i}{\varvec{\rho }}_i)\otimes (d_i\textbf{n}_i+\textbf{T}_{F_i}{\varvec{\rho }}_i)}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}\textrm{d}A_i \nonumber \\ \displaystyle \quad= & {} \displaystyle d_i^2\,\textbf{n}_i\otimes \textbf{n}_i\,\textrm{P}_{F_i}^{(0,1/2)}+d_i(\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\otimes \textbf{n}_i+ \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)})+\textbf{T}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\textbf{T}^T_{F_i} \,{,} \nonumber \\ \end{aligned}$$
(32)

where we have introduced the symbol

$$\begin{aligned} \textrm{P}_{F_i}^{(m,1/2)}=\int \limits _{F_i} \frac{[\otimes {\varvec{\rho }}_i,m]}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}\textrm{d}A_i\quad m=0,1,\ldots \quad {.} \end{aligned}$$
(33)

To simplify the following expressions we further introduce the formal operator \(\mathbb {T}_{F_i}^{(m)}\) that transforms a rank-m tensor of order 2 to the corresponding rank-m tensor of order 3. Notice that, being the definite integral a kind of sum, the operator \(\mathbb {T}_{F_i}^{(m)}\) and the integral sign can be interchanged. For instance, observing that \(\mathbb {T}_{F_i}^{(1)}=\textbf{T}_{F_i}\), one has

$$\begin{aligned} \mathbb {T}_{F_i}^{(2)} \textrm{P}_{F_i}^{(2,1/2)}= \mathbb {T}_{F_i}^{(2)} \int \limits _{F_i}\frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}} \textrm{d}A_i= \int \limits _{F_i}\frac{\textbf{T}_{F_i}{\varvec{\rho }}_i \otimes \textbf{T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}} \textrm{d}A_i= \textbf{T}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\textbf{T}_{F_i}^T, \nonumber \\ \end{aligned}$$
(34)

so that (32) can also be written as

$$\begin{aligned} \mathcal {R}_{F_i}^{(2,1/2)}=d_i^2\textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,1/2)}+d_i\biggl [\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\otimes \textbf{n}_i+\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\biggr ]+\mathbb {T}_{F_i}^{(2)} \textrm{P}_{F_i}^{(2,1/2)}{.} \nonumber \\ \end{aligned}$$
(35)

Hence

$$\begin{aligned} \begin{array}{ll} \displaystyle \mathcal {R}_{F_i}^{(3,1/2)}=\,&{} \displaystyle d_i^3\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,1/2)}\\ &{}\,+d_i^2\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}+\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\otimes \textbf{n}_i+\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ] \\ &{}\,+d_i\biggl [\textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\otimes _{132}\textbf{n}_i+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\otimes \textbf{n}_i\biggr ]\\ &{}\,+\mathbb {T}^{(3)}_{F_i} \textrm{P}_{F_i}^{(3,1/2)}{,} \end{array} \nonumber \\ \end{aligned}$$
(36)

and

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(4,1/2)}=&\displaystyle \mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,4)}+\mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,3)}+\mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,2)}+\mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,1)}+ \mathbb {T}^{(4)}_{F_i} \textrm{P}_{F_i}^{(4,1/2)}{,} \end{array} \end{aligned}$$
(37)

where

$$\begin{aligned} \mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,4)}= & {} d_i^4\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,1/2)}{,} \end{aligned}$$
(38)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,3)}= & {} \displaystyle d_i^3\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}+\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\otimes \textbf{n}_i \nonumber \\{} & {} \displaystyle \, +\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i+\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,1/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ]{,} \end{aligned}$$
(39)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,2)}= & {} \displaystyle d_i^2\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}+\Big (\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\Big )_{1324} \nonumber \\{} & {} \displaystyle \, +\textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\otimes \textbf{n}_i+\Big (\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\Big )_{1423}\nonumber \\{} & {} \displaystyle \,+\Big (\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\Big )_{1324}+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,1/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ]{,} \end{aligned}$$
(40)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i\,\textbf{n}_i}^{(4,1/2,1)}= & {} \displaystyle d_i\biggl [\textbf{n}_i\otimes \mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,1/2)}+\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,1/2)}\otimes _{1342}\textbf{n}_i\nonumber \\{} & {} \displaystyle +\,\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,1/2)}\otimes _{1243}\textbf{n}_i+\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,1/2)}\otimes \textbf{n}_i\biggr ]{.} \end{aligned}$$
(41)

In conclusion, recalling (5), the expression of \( U^{(i)}(\textbf{p}) \) reported in (6), (10), (11), (12) and (13), as well as that of \( \mathcal {R}_{\partial \varOmega }^{(m, 1/2)} \) in (26), we are finally led to compute the 2D integrals in (33). This will be addressed in the following subsections.

3.3 Analytical Expression of Face Integrals Related to the GP in Terms of 1D Integrals

It has been shown in the previous subsections that the actual evaluation of the gravitational potential in (5) ultimately amounts to evaluating the 2D integrals (33). However, they can be computed by simpler 1D integrals invoking once more the generalized Gauss theorem Tang (2006). As a matter of fact this has already been done for \( m=0 \) and \( m=1 \) in previous papers D’Urso (2013a, 2014a, 2014b); for \( m>1 \) it has been carried out in Appendix B.

For the sake of clarity the expressions of the integral (33) are reported in the sequel for increasing values of m while the relevant proofs, as well as the related notation, is detailed in Appendix B.

To help the reader fully grasp the notation used with forthcoming formulas we also introduce the following notation

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2) \, 0]}= & {} \displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}\,{\varvec{\nu }}_i(s_i)\,\textrm{d}s_i{,} \end{aligned}$$
(42)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot ]}= & {} \displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2} {\varvec{\rho }}_i(s_i) \cdot {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i{,}\nonumber \\ \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,2\cdot ]}= & {} \displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2} {\varvec{\rho }}_i(s_i) \Bigl [{\varvec{\rho }}_i(s_i) \cdot {\varvec{\nu }}_i(s_i)\Bigr ]\,\textrm{d}s_i{,}\nonumber \\ \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,3\cdot ]}= & {} \displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2} \Bigl [{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \Bigr ]\,{\varvec{\rho }}_i(s_i) \cdot {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i{,} \end{aligned}$$
(43)

and

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2) \, 1\otimes ]}= & {} \displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}\,{\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i{,}\nonumber \\ \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,2\otimes ]}= & {} \displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2} {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i{,}\nonumber \\ \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,3\otimes ]}= & {} \displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2} {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i{,} \end{aligned}$$
(44)

where \(\nu _i \) represents the 2D vector belonging to the face and normal to the edge.

Some of the previous quantities will be also combined to produce expressions that will be tensorially multiplied by the rank-two tensor \( \mathcal {I}^{(2)} \). For this reason we also introduce the following symbols

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}= & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot ]} +d_i^2 \bigl (\textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot , 1]}-\alpha _i\,|d_i|\bigr ){,}\nonumber \\ \textrm{P}_{\partial F_i}^{1 \, \mathcal {I}}= & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,2\cdot ]} +d_i^2 \textrm{P}_{\partial F_i}^{[(1/2)\,0]}{,}\nonumber \\ \displaystyle \textrm{P}_{\partial F_i}^{2 \, \mathcal {I}}= & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,3\cdot ]} +d_i^2 \Bigl [\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}-\frac{\mathcal {I}^{(2)}}{3}\,\textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}\Bigr ]{,} \end{aligned}$$
(45)

where

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot , 1]}= \displaystyle \int \limits _{\partial F_i} \frac{\Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}\,{\varvec{\rho }}_i(s_i) \cdot {\varvec{\nu }}_i(s_i)}{{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)}\,\textrm{d}s_i{.} \end{aligned}$$
(46)

By means of the previous notation we can set

  • Integral (33) for \( m=0 \), see, e.g., formula (20) in D’Urso (2013a)

    $$\begin{aligned} \displaystyle \textrm{P}_{F_i}^{(0,1/2)}=\displaystyle \int \limits _{F_i} \frac{\textrm{d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}=\displaystyle \textrm{P}_{\partial F_i}^{[(1/2)1\cdot ,1]}-\alpha _i |d_i|{.} \end{aligned}$$
    (47)
  • Integral (33) for \( m=1 \), see, e.g., formula (19) in D’Urso (2014b)

    $$\begin{aligned} \textrm{P}_{F_i}^{(1,1/2)}= & {} \displaystyle \int \limits _{F_i} \frac{{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}\textrm{d}A_i =\displaystyle \int \limits _{\partial F_i} \Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}\,{\varvec{\nu }}_i(s_i)\,\textrm{d}s_i \nonumber \\= & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2) \, 0]}{.} \end{aligned}$$
    (48)
  • Integral (33) for \( m=2 \), on account of formula (266) in Appendix B

    $$\begin{aligned} \textrm{P}_{F_i}^{(2,1/2)}=\int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}\textrm{d}A_i =\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}-\frac{\mathcal {I}^{(2)}}{3}\,\textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}{.} \end{aligned}$$
    (49)
  • Integral (33) for \( m=3 \), on account of formula (272) in Appendix B.

    $$\begin{aligned} \textrm{P}_{F_i}^{(3,1/2)}=\int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}\textrm{d}A_i=\textrm{P}_{\partial F_i}^{[(1/2)2\otimes ]}- \frac{1}{4}\Biggl [\mathcal {I}^{(2)}\otimes _{132} \textrm{P}_{\partial F_i}^{1\,\mathcal {I}}+\textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\Biggr ]{.} \nonumber \\ \end{aligned}$$
    (50)
  • Integral (33) for \( m=4 \), on account of formula (278) in Appendix B.

Recalling the definition (45) for \(\textrm{P}_{\partial F_i}^{2\,\mathcal {I}}\),we get

$$\begin{aligned} \displaystyle \textrm{P}_{F_i}^{(4,1/2)}= & {} \displaystyle \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}}\textrm{d}A_i=\displaystyle \textrm{P}_{\partial F_i}^{[(1/2)3\otimes ]}\nonumber \\{} & {} -\frac{1}{5} \Biggl [\mathcal {I}^{(2)}\otimes _{1423} \textrm{P}_{\partial F_i}^{2\,\mathcal {I}}+\textrm{P}_{\partial F_i}^{2\,\mathcal {I}}\otimes _{1243} \mathcal {I}^{(2)}+\textrm{P}_{\partial F_i}^{2\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\Biggr ]{.} \end{aligned}$$
(51)

Accordingly, all integrals in (33) have been evaluated by means of boundary integrals.

3.4 Algebraic Expression of Face Integrals Related to the GP in Terms of 2D Vectors

At this stage of the formulation we have expressed the domain integrals \( \mathcal {R}_{F_i}^{(m,1/2)} \), \( m= 1,..., 4 \), appearing in the expression (5) of the potential as function of integrals \( \mathcal {R}_{\partial \varOmega }^{(m,1/2)} \) extended to the boundary \(\partial \varOmega \) by means of formula (25).

In turn each of the integral \( \mathcal {R}_{\partial \varOmega }^{(m,1/2)} \), extended to the face \( F_i \) of \(\partial \varOmega \) for a polyhedral body, has been expressed as function of the 2D integrals \( \mathcal {R}_{ F_i}^{(m,1/2)}\), see, e. g., formula (27), and each of them further specialized to the expressions (32), (36) and (37) depending upon the integrals \( \textrm{P}_{ F_i}^{(m,1/2)}\) introduced in formula (33).

Finally, the 2D integrals \( \textrm{P}_{ F_i}^{(m,1/2)}\) have been converted to 1D integrals by exploiting formulas (47), (48), (49), (50) and (51) detailed above.

Hence our next step is to express the boundary integrals in formulas (4246) as sums extended to the \( N_{E_i} \) edges defining the boundary \(\partial F_i\). Actually, a suitable parameterization of the j-th edge of \(\partial F_i\) allows us to transform each 1D integral to an integral of a real variable scaled by a suitable combination of the vectors \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) that define the position vectors of the end vertices of the edge in the 2D reference frame local to \(F_i\).

In particular we set

$$\begin{aligned} \hat{{\varvec{\rho }}}_i(\lambda _j)={\varvec{\rho }}_j+\lambda _j({\varvec{\rho }}_{j+1}-{\varvec{\rho }}_j)={\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j{,} \end{aligned}$$
(52)

where the function \(\hat{{\varvec{\rho }}_i}\) associates the position vector spanning the j-th edge with each value of the adimensional abscissa

$$\begin{aligned} \lambda _j= s_j/l_j. \end{aligned}$$
(53)

The quantity \(s_j\), \(s_j\in [0,\;l_j]\), is the curvilinear abscissa along the j-th edge and \(l_j = |{\varvec{\rho }}_{j+1}-{\varvec{\rho }}_j|\) is the edge length. The position vector spanning the j-th edge of \(F_i\) can also be expressed as function of \(s_j\) and a new function \({\varvec{\rho }}_i\), fulfilling the condition \({\varvec{\rho }}_i(s_i)=\hat{{\varvec{\rho }}}_i(\lambda _j)\). Hence

$$\begin{aligned} {\varvec{\rho }}_i(s_j)\cdot {\varvec{\rho }}_i(s_j)=\hat{{\varvec{\rho }}}_i(\lambda _j)\cdot \hat{{\varvec{\rho }}}_i(\lambda _j)=p_j\lambda _j^2+2q_j\lambda _j+u_j = P_u(\lambda _j){,} \end{aligned}$$
(54)

where, according to (52)

$$\begin{aligned} p_j=\varDelta {\varvec{\rho }}_j\cdot \varDelta {\varvec{\rho }}_j{\,=l_j}\qquad q_j={\varvec{\rho }}_j\cdot \varDelta {\varvec{\rho }}_j \qquad u_j={\varvec{\rho }}_j\cdot {\varvec{\rho }}_j. \end{aligned}$$
(55)

Furthermore

$$\begin{aligned} {\varvec{\rho }}_i(s_j)\cdot {\varvec{\rho }}_i(s_j)+d_i^2=p_j\lambda _j^2+2q_j\lambda _j+v_j{,} \end{aligned}$$
(56)

where \(v_j=u_j+d_i^2\). We shall also set \(P_v(\lambda _j)=P_u(\lambda _j)+d_i^2\).

We shall also express the outward unit normal \({\varvec{\nu }}_j\) to the j\(-th \) edge, normal contained within the face \( F_i \), according to the formula

$$\begin{aligned} \displaystyle {\varvec{\nu }}_j= \frac{\left( {\varvec{\rho }}_{j+1} - {\varvec{\rho }}_j\right) ^\perp }{l_j} = \frac{\varDelta {\varvec{\rho }}_{j}^\perp }{l_j}\,{,} \end{aligned}$$
(57)

where the symbol \((\cdot )^\perp \) denotes a clockwise rotation of the 2D vector \((\cdot )\) with respect to the normal to \( F_i \).

In turn such a clockwise rotation depends on the convention adopted to circulate along the boundary \(\partial F_i\). In particular, we have assumed that the vertices of each face have been numbered consecutively by circulating along \(\partial F_i\) in a counter-clockwise sense with respect to the unit outward normal \(\textbf{n}_i\) to the face. Thus

$$\begin{aligned} \varDelta {\varvec{\rho }}_j=\left[ \begin{array}{c} \varDelta \xi _j\\ \varDelta \eta _j\end{array}\right] \Rightarrow \varDelta {\varvec{\rho }}_j^\perp =\left[ \begin{array}{c} \varDelta \eta _j \\ -\varDelta \xi _j\end{array}\right] = \left[ \begin{array}{cc} 0&{}1 \\ -1&{}0\end{array}\right] \varDelta {\varvec{\rho }}_j. \end{aligned}$$
(58)

In conclusion one can write for the integral in (46)

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot ,1]} =&\displaystyle \int \limits _{\partial F_i}\frac{\Big [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Big ]^{1/2} {\varvec{\rho }}(s_i) \cdot {\varvec{\nu }}(s_i)}{{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)} \textrm{d}s_i =\sum _{j=1}^{N_{E_i}} \bigl ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^{\perp }\bigr ) I_j^{(1/2\cdot 0,1)}{,} \end{array} \nonumber \\ \end{aligned}$$
(59)

where the expression of the definite integral \( I_j ^{(1/2\cdot 0,1)} \) is detailed in the formula (282) of Appendix C.

Analogously, with reference to the integral in (43)\(_1\), one has

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,0]} =&\displaystyle \int \limits _{\partial F_i} \Big [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Big ]^{1/2} {\varvec{\nu }}(s_i) ds_i=\sum _{j=1}^{N_{E_i}} \varDelta {\varvec{\rho }}_j^{\perp } I_j^{(1/2\cdot 0)}{,} \end{array} \end{aligned}$$
(60)

see, e.g., formula (283) of Appendix C, while the integral (44)\(_1\) by

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]} =&{} \displaystyle \int \limits _{\partial F_i}\Bigr [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl ]^{1/2} {\varvec{\rho }}_i (s_i) \otimes {\varvec{\nu }}(s_i) \textrm{d}s_i\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}} \Biggl \{\int \limits _{0}^{1} \Bigl [\hat{{\varvec{\rho }}}_j(\lambda _j)\cdot \hat{{\varvec{\rho }}}_j(\lambda _j)+d_i^2\Bigr ]^{1/2}\left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) l_j\,\textrm{d}\lambda _j\otimes {\varvec{\nu }}_j\Biggr \}{;} \end{array} \end{aligned}$$
(61)

hence that one has

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]} =&{}\displaystyle \sum _{j=1}^{N_{E_i}} \Biggl \{\Biggl [\int \limits _{0}^{1} \bigl (p_j\lambda _j^2+2q_j\lambda _j+v_j\bigr )^{1/2}d\lambda _j\Biggr ] {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp } \\ &{} \displaystyle +\Biggl [\int \limits _{0}^{1} \bigl (p_j\lambda _j^2+2q_j\lambda _j+v_j\bigr )^{1/2}\lambda _jd\lambda _j\Biggr ] \varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp }\Biggr \}\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}} \Biggl [I_j^{(1/2\cdot 0)}{\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp }+I_j^{(1/2\cdot 1)}\varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp }\Biggr ]{,} \end{array} \end{aligned}$$
(62)

the quantities \( I_j ^{(1/2\cdot 0)} \) and \( I_j ^{(1/2\cdot 1)} \) being detailed in formulas (283) and (284) of Appendix C, respectively. Notice that the additional boundary integral appearing in formula (43)\( _2 \) is simply the trace (tr) of the previous expression; hence one has

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot ]} =&\displaystyle \int \limits _{\partial F_i}\Bigr [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl ]^{1/2} {\varvec{\rho }}_i (s_i) \cdot {\varvec{\nu }}_i(s_i) ds_i=\sum _{j=1}^{N_{E_i}}I_j^{(1/2\cdot 0)}{\varvec{\rho }}_j\cdot \varDelta {\varvec{\rho }}_j^{\perp }{,} \end{array} \end{aligned}$$
(63)

since tr\((\varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp })=\varDelta {\varvec{\rho }}_j\cdot \varDelta {\varvec{\rho }}_j^{\perp }\).

To simplify the ensuing developments we introduce the following notation

$$\begin{aligned} \hat{{\varvec{\rho }}}(\lambda _j)\otimes \hat{{\varvec{\rho }}}(\lambda _j)=\mathcal {E}^{(2)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j}+\lambda _j\,\mathcal {E}^{(2)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+\lambda _j^2\,\mathcal {E}^{(2)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}{,} \end{aligned}$$
(64)

where

$$\begin{aligned} \mathcal {E}^{(2)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j}={\varvec{\rho }}_j\otimes {\varvec{\rho }}_j \qquad \mathcal {E}^{(2)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}={\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j+\varDelta {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j \qquad \mathcal {E}^{(2)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}=\varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j{,} \nonumber \\ \end{aligned}$$
(65)

and

$$\begin{aligned} \hat{{\varvec{\rho }}}(\lambda _j)\otimes \hat{{\varvec{\rho }}}(\lambda _j)\otimes \hat{{\varvec{\rho }}}(\lambda _j)=\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}+\lambda _j\,\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+\lambda _j^2\,\mathcal {E}^{(3)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+\lambda _j^3\,\mathcal {E}^{(3)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}{,}\nonumber \\ \end{aligned}$$
(66)

being

$$\begin{aligned} \displaystyle \mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}= & {} {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j\nonumber \\ \mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}= & {} {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j+{\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j+\varDelta {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j{,}\nonumber \\ \displaystyle \mathcal {E}^{(3)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}= & {} {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j+\varDelta {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j+\varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j\otimes {\varvec{\rho }}_j{,} \nonumber \\ \displaystyle \mathcal {E}^{(3)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}= & {} \varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j{.} \end{aligned}$$
(67)

Accordingly, we can set for the integral (44)\( _2 \)

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,2\otimes ]} =&{} \displaystyle \int \limits _{\partial F_i}\Bigr [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl ]^{1/2} {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i) \textrm{d}s_i\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}}\Bigl [I_j^{(1/2\cdot 0)}\mathcal {E}^{(2)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j}+I_j^{(1/2\cdot 1)}\mathcal {E}^{(2)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(1/2\cdot 2)}\mathcal {E}^{(2)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\Bigr ]\otimes \varDelta {\varvec{\rho }}_j^{\perp }{,} \end{array} \end{aligned}$$
(68)

where \( I_j ^{(1/2\cdot 0)}\), \( I_j ^{(1/2\cdot 1)}\) and \( I_j ^{(1/2\cdot 2)}\) are given by the formulas (283), (284) and (285) of Appendix C, respectively.

The integral \(\textrm{P}_{\partial F_i}^{[(1/2)\,2\cdot ]}\) in (43)\( _3 \) can be computed as follows:

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,2\cdot ]} =&{} \displaystyle \int \limits _{\partial F_i}\Bigr [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl ]^{1/2} \bigl [{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i)\bigr ] {\varvec{\nu }}_i(s_i) \textrm{d}s_i\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}}\Bigl [I_j^{(1/2\cdot 0)}\mathcal {E}^{(2)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j}+I_j^{(1/2\cdot 1)}\mathcal {E}^{(2)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(1/2\cdot 2)}\mathcal {E}^{(2)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\Bigr ]\varDelta {\varvec{\rho }}_j^{\perp }{,} \end{array} \end{aligned}$$
(69)

while \(\textrm{P}_{\partial F_i}^{[(1/2)\,3\cdot ]}\) is given by

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,3\cdot ]}= & {} \displaystyle \int \limits _{\partial F_i}\Bigr [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl ]^{1/2} \bigl [{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i)\bigr ] {\varvec{\nu }}_i(s_i) \textrm{d}s_i\nonumber \\= & {} \displaystyle \sum _{j=1}^{N_{E_i}}\Bigl [I_j^{(1/2\cdot 0)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}+I_j^{(1/2\cdot 1)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(1/2\cdot 2)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\nonumber \\{} & {} +I_j^{(1/2\cdot 3)}\mathcal {E}^{(3)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\Bigr ]\,\varDelta {\varvec{\rho }}_j^{\perp }{.} \end{aligned}$$
(70)

Finally, we need to compute the integral in(44)\( _3 \)

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,3\otimes ]}= & {} \displaystyle \int \limits _{\partial F_i}\Bigr [{\varvec{\rho }}_i (s_i) \cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl ]^{1/2} {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i)\otimes {\varvec{\rho }}_i(s_i)\otimes {\varvec{\nu }}_i(s_i) \textrm{d}s_i\nonumber \\= & {} \displaystyle \sum _{j=1}^ {N_{E_i}}\Bigl [I_j^{(1/2\cdot 0)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}+I_j^{(1/2\cdot 1)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\nonumber \\{} & {} +I_j^{(1/2\cdot 2)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(1/2\cdot 3)}\mathcal {E}^{(3)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\Bigr ]\otimes \varDelta {\varvec{\rho }}_j^{\perp }{,} \end{aligned}$$
(71)

where \( I_j ^{(1/2\cdot 3)}\) is given by the formulas (286).

In conclusion, all the integrals in (43), (44) and (46), and hence in (45) and (4751), can be explicitly computed as combination of scalar quantities multiplied by suitable tensor products of \( {\varvec{\rho }}_j \), \( \varDelta {\varvec{\rho }}_j \) and \( \varDelta {\varvec{\rho }}_j^{\perp } \).

3.5 Removable Singularities of the Algebraic Expressions of the Gravity Potential

It is already been shown that the analytical expression (5) of the gravity potential is obtained as sum of the integrals \( \mathcal {R}_{F_i}^{(m,1/2)} \), defined in (26), that are singularity-free whatever is the position of the observation point P with respect to \( \varOmega \).

However, the algebraic counterparts of the integrals \( \mathcal {R}_{F_i}^{(m,1/2)} \), expressed as function of the line integrals \( \textrm{P}_{\partial F_i} \) defined in the formulas (4351) and of the relevant algebraic expressions reported in the previous section, do include further singularities.

They are associated with the expression of the line integrals \( I_j\) reported in Appendix C since they can become singular when the generic \( F_i \) of the boundary \(\partial \varOmega \) contains the observation point or the projection of the observation point \( F_i \) belongs to the line containing the j-th edge of the boundary \( \partial F_i \).

However, it will be proved that the contribution of the singular line integral vanishes in the computation of the associated domain integral. Hence, the singularity of the j-th line integral pertaining to a generic face \( F_i \) does not have any harmful effect.

To prove the results of interest we shall set

$$\begin{aligned} v_j=u_j+d_i^2=|\textbf{r}_j|^2 \qquad p_j+2q_j+v_j={\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}+d_i^2=|\textbf{r}_{j+1}|^2{,} \end{aligned}$$
(72)

where \( p_j \), \( q_j \) and \( u_j \) have been defined in formula (55), and

$$\begin{aligned} -\varDelta _j=p_ju_j-q_j^2=({\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1})({\varvec{\rho }}_j\cdot {\varvec{\rho }}_j)-({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1})^2\ge 0{,} \end{aligned}$$
(73)

whose positive value is consequence of the Cauchy-Schwartz inequality (Tang 2006).

To show which are the line integrals that can become singular we indicate in the sequel the set of formulas required to compute each integral \( \mathcal {R}_{F_i}^{(m,1/2)} \), \( m= 0,..., 4 \), by concisely reporting the sequence to be used. For instance

$$\begin{aligned} \mathcal {R}_{F_i}^{(0,1/2)} \leftrightarrow (30)\rightarrow (47)\rightarrow (59)\rightarrow (282){,} \end{aligned}$$
(74)

meaning that the computation of \( \mathcal {R}_{F_i}^{(0,1/2)} \) requires the evaluation of the integrals \( I_j^{(1/2\cdot 0,1)} \), expressed in the formula (282), over the edges of \( \partial F_i \).

Analogously

$$\begin{aligned} \mathcal {R}_{F_i}^{(1,1/2)}\leftrightarrow (31)\rightarrow [(47),(48)]\rightarrow [(59),(60)]\rightarrow [(282),(283)]{,} \end{aligned}$$
(75)

meaning that the integral \( I_j^{(1/2\cdot 0)} \) in the formula (283) needs to be computed in addition to \( I_j^{(1/2\cdot 0,1)} \). This is a general rule in the sense the computation of the integral \( \mathcal {R}_{F_i}^{(m+1,1/2)} \) requires to evaluate an additional integral with respect to those associated with \( \mathcal {R}_{F_i}^{(m,1/2)} \). Actually

$$\begin{aligned} \displaystyle \mathcal {R}_{F_i}^{(2,1/2)}\leftrightarrow{} & {} \displaystyle (32)\rightarrow [(47),(48), (49)-(45)_1]\nonumber \\{} & {} \rightarrow \displaystyle {[}(59),(60),(62)-(63)]\rightarrow [(282),(283),(283)]{,} \end{aligned}$$
(76)

requires to compute \( I_j^{(1/2\cdot 1)} \) in addition to \( I_j^{(1/2\cdot 0,1)} \) and \( I_j^{(1/2\cdot 0)} \).

Furthermore

$$\begin{aligned} \displaystyle \mathcal {R}_{F_i}^{(3,1/2)}\leftrightarrow{} & {} \displaystyle (36)\rightarrow [(47),(48),(49)-(45)_1,(50)-(45)_2]\nonumber \\{} & {} \rightarrow \displaystyle [(59),(60),(62)-(63),(68)-(69)]\rightarrow [(282),(283),(284),(285)]{,} \nonumber \\ \end{aligned}$$
(77)

requires the extra calculation of \( I_j^{(1/2\cdot 2)} \) while for

$$\begin{aligned} \displaystyle \mathcal {R}_{F_{i}}^{(4,1/2)}\leftrightarrow \displaystyle (37)\rightarrow & {} [(47),(48),(49)-(45)_1,(50)-(45)_2,(51)-(45)_3]\nonumber \\{} & {} \rightarrow \displaystyle {[}(59),(60),(62)-(63),(68)-(69),(71)-(70)]\nonumber \\{} & {} \rightarrow \displaystyle {[}(282),(283),(284),(285),(286)]{,} \end{aligned}$$
(78)

the evaluation of \( I_j^{(1/2\cdot 3)} \) is also needed.

In conclusion the computation of the integrals \( \mathcal {R}_{F_i}^{(m,1/2)} \), \( m= 0,..., 4 \), requires the evaluation of the five integrals \( I_j^{(1/2\cdot 0,1)} \), \( I_j^{(1/2\cdot 0)} \), \( I_j^{(1/2\cdot 1)} \), \( I_j^{(1/2\cdot 2)} \) and \( I_j^{(1/2\cdot 3)} \). They can become singular when the projection of P over the face is a such that \({\varvec{\rho }}_j=0\) or \({\varvec{\rho }}_{j+1}=0\) or belongs to the segment [\(\,{\varvec{\rho }}_j, {\varvec{\rho }}_{j+1}\)]. For what concerns \( I_j^{(1/2\cdot 0,1)} \) this may happen independently from the value of \( d_i \), i.e., whether or not the i-th face \( F_i \) does contain the observation point. Conversely, the additional four integrals are always well defined if \( d_i\ne 0 \).

The singularity-free nature of \( I_j^{(1/2\cdot 0,1)} \) and \( I_j^{(1/2\cdot 0)} \) has been proved in Sections 4.1 and 4.2 of D’Urso and Trotta (2017) which the interested reader is referred to.

To prove the well-posedness of the additional three integrals we exploit the expression

$$\begin{aligned} \begin{array}{rl} \displaystyle LN_j=\ln k_j=&\displaystyle \ln \frac{{\varvec{\rho }}_{j+1}\cdot \varDelta {\varvec{\rho }}_j+{l_j}|\textbf{r}_{j+1}|}{{\varvec{\rho }}_j\cdot \varDelta {\varvec{\rho }}_j+{l_j}|\textbf{r}_j|}{,} \end{array} \end{aligned}$$
(79)

reported in formula (73) of D’Urso (2014b), where \( \textbf{r}_j \) and \( \textbf{r}_{j+1} \) are defined in (72). Actually, according to (72), \( LN_j \) is always well defined when \( d_i\ne 0 \) independently of the values of \({\varvec{\rho }}_i\) and \({\varvec{\rho }}_{i+1}\) since both the numerator and denominator are the algebraic counterparts of positive integrands.

Conversely, should it be \( d_i=0 \) and \({\varvec{\rho }}_j=\textbf{o}\) or \({\varvec{\rho }}_{j+1}=\textbf{o}\) or \({\varvec{\rho }}_{j+1}=\beta _j {\varvec{\rho }}_j \,\,(\beta _j<0)\), \( LN_j \) becomes indefinite. However, its evaluation can be skipped since \( LN_j \) is scaled by coefficients that tend to zero with a greater order. Actually, the last addend of formula (284) for \( I_j^{(1/2\cdot 1)} \) reads

$$\begin{aligned} \begin{array}{rl} \displaystyle +\frac{q_j^3-p_jq_jv_j}{2p_j^{5/2}} LN_j=&\displaystyle q_j \frac{q_j^2-p_jv_j}{2p_j^{5/2}} LN_j=q_j \frac{\varDelta _j}{2p_j^{5/2}} LN_j{.} \end{array} \end{aligned}$$
(80)

Hence, if \({\varvec{\rho }}_j=\textbf{o}\) or \({\varvec{\rho }}_{j+1}=\textbf{o}\) or \({\varvec{\rho }}_{j+1}=\beta _j {\varvec{\rho }}_j \,\,(\beta _j<0)\), \(\varDelta _j\) tends to zero quadratically while \( LN_j \) tends to infinity with an arbitrary low degree. Stated equivalently, the contribution of the addend including \( LN_j \) can be ignored.

Exactly the same does occur for the last addend of formula (285) for \( I_j^{(1/2\cdot 2)} \)

$$\begin{aligned} \begin{array}{rl} \displaystyle \frac{(q_j^2-p_jv_j)(5q_j^2-p_jv_j)}{8p_j^{7/2}} LN_j{,} \end{array} \end{aligned}$$
(81)

in which the coefficient of \( LN_j \) can tend to zero with a degree equal at least to two.

For what concerns the last addend of the formula (286) for \( I_j^{(1/2\cdot 3)} \) it turns out to be

$$\begin{aligned} \begin{array}{rl} \displaystyle \frac{7q_j^5-10p_j q_j^3 v_j+3p_j^2q_jv_j^2}{8p_j^{9/2}}LN_j&\displaystyle =\frac{q_j(q_j^2-p_jv_j)(7q_j^2-3p_jv_j)}{8p_j^{9/2}}LN_j{,} \end{array} \end{aligned}$$
(82)

so that, also in this case, the coefficient scaling \( LN_j \) can tend to zero with a degree not less than two.

In conclusion, edges characterized by singularity of \( LN_j \) can be actually skipped in the computation of the relevant integral.

4 Gravity Vector of Polyhedral Body Having a Polynomial Density

The gravity vector, i.e., the derivative of the gravitational potential, is obtained by differentiating the expression (5) with respect to \( \textbf{p}\).

$$\begin{aligned} \textrm{d}_{\textbf{p}}U(\textbf{p})=G\textrm{d}_{\textbf{p}}\int \limits _{\varOmega }\frac{\delta _o + \sum _{k=1}^{4} \mathcal {C}^{{\textbf {{(k)}}}}\cdot \mathcal {D}_{\textbf{s}}^{{\textbf {{(k)}}}}}{( \textbf{r}\cdot \textbf{r})^{1/2}} \textrm{d}V(\textbf{s}){.} \end{aligned}$$
(83)

It has been proved by Kellogg (1929) that the potential U and its gradient exist and are continuous whatever is the position of the point P with respect to \(\varOmega \) provided that the density \(\delta \) is continuous and \(\varOmega \) is bounded; these properties are certainly fulfilled since \(\delta \) is polynomial and \(\varOmega \) is polyhedral. Hence the derivative can be moved inside the integral so that, being \( \textrm{d}_{\textbf{p}}=-\textrm{d}_{\textbf{r}} \), we can write

$$\begin{aligned} \textrm{d}_{\textbf{p}}U(\textbf{p})=-G\int \limits _{\varOmega }\textrm{d}_{\textbf{r}}\frac{\delta _o + \sum _{k=1}^{4} \mathcal {C}^{{\textbf {{(k)}}}}\cdot \mathcal {D}_{\textbf{s}}^{{\textbf {{(k)}}}}}{( \textbf{r}\cdot \textbf{r})^{1/2}} \textrm{d}V(\textbf{r})=\sum _{k=0}^{4} \textrm{d}_{\textbf{p}}U^{(k)}(\textbf{p}){,} \end{aligned}$$
(84)

where \( \mathcal {D}_{\textbf{s}}^{(1)}=\textbf{s}\) and the symbols \( \mathcal {D}_{\textbf{s}}^{(k)}\), \( k=2, 3, 4\), have been defined in (204), (207) and (210).

At this stage two different approaches can be exploited for the computation of \( \textrm{d}_{\textbf{p}}U(\textbf{p}) \), each one having pros and cons. The first one amounts to performing the derivatives on the right-hand side of the previous formula and allows one to prove, by following a path of reasoning detailed in Sect. 5.1, that the gravity vector of a polyhedral body endowed with a polynomial density is non-singular whatever is the position of the observation point.

Such an approach leads to particularly compact expressions although it requires a significant amount of mathematical manipulations and the necessity of computing further 2D integrals with respect to those required for the computation of the potential.

The second approach for evaluating the gravity vector is to apply a further variant of the Gauss theorem to the first integral in formula (84) so as to directly obtain boundary integrals. This approach leads to formulas containing a greater number of addends with respect to the ones associated with the first approach but include most of the integrals that are required for the computation of the potential.

Space limitations do not allow us to show the formulas associated with the second approach; hence, an answer on which is the most convenient approach to be adopted will be given in a forthcoming paper on the basis of numerical experiments and of theoretical considerations since the second approach considerably simplifies the computation of second and higher-order derivatives of the potential.

In conclusion, in this paper we shall limit ourselves to adopt the first approach and we proceed to evaluate the derivatives in (84) on the basis of the expressions of \(U^{(k)}\), k=0,...,4, detailed in (6), (7), (11), (12) and (13), respectively. In turn, this requires the preliminary evaluation of \(\textrm{d}_{\textbf{p}}\mathcal {R}_{\varOmega }^{(m,1/2)}\) where this last symbol has been defined in (8).

Introducing the additional symbol

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(m, 3/2)}= \int \limits _{\varOmega }\frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{3/2}} \textrm{d}V \quad m=1,\ldots \quad {,} \end{aligned}$$
(85)

and exploiting the differential identities (252) - (257) one has

$$\begin{aligned}{} & {} \displaystyle \textrm{d}_{\textbf{p}}\mathcal {R}_{\varOmega }^{(0,1/2)}=\displaystyle -\int \limits _{\varOmega }\textrm{d}_{\textbf{r}} \frac{1}{(\textbf{r}\cdot \textbf{r})^{1/2}}dV=\mathcal {R}_{\varOmega }^{(1,3/2)}{,} \end{aligned}$$
(86)
$$\begin{aligned}{} & {} \displaystyle \textrm{d}_{\textbf{p}}\mathcal {R}_{\varOmega }^{(1,1/2)}=\displaystyle \mathcal {R}_{\varOmega }^{(2,3/2)}-\mathcal {R}_{\varOmega }^{(0,1/2)} \mathcal {I}^{(2)}{,} \end{aligned}$$
(87)
$$\begin{aligned}{} & {} \displaystyle \textrm{d}_{\textbf{p}}\mathcal {R}_{\varOmega }^{(2,1/2)}= \displaystyle \mathcal {R}_{\varOmega }^{(3,\, 3/2)}- \mathcal {I}^{(2)}\otimes _{132}\mathcal {R}_{\varOmega }^{(1,\, 1/2)}-\mathcal {R}_{\varOmega }^{(1,\, 1/2)}\otimes \mathcal {I}^{(2)}{,} \end{aligned}$$
(88)
$$\begin{aligned}{} & {} \displaystyle \textrm{d}_{\textbf{p}}\mathcal {R}_{\varOmega }^{(3,1/2)}= \displaystyle \mathcal {R}_{\varOmega }^{(4,\, 3/2)}- \bigg (\mathcal {I}^{(2)}\otimes \mathcal {R}_{\varOmega }^{(2,\, 1/2)}\bigg )_{1423}-\bigg (\mathcal {R}_{\varOmega }^{(2,\, 1/2)}\otimes \mathcal {I}^{(2)}\bigg )_{1324}-\mathcal {R}_{\varOmega }^{(2,\, 1/2)}\otimes \mathcal {I}^{(2)}{,}\nonumber \\ \end{aligned}$$
(89)
$$\begin{aligned}{} & {} \displaystyle \textrm{d}_{\textbf{p}}\mathcal {R}_{\varOmega }^{(4,1/2)}= \displaystyle \mathcal {R}_{\varOmega }^{(5,\, 3/2)}- \bigg (\mathcal {I}^{(2)}\otimes \mathcal {R}_{\varOmega }^{(3,\, 1/2)}\bigg )_{15234}-\bigg (\mathcal {R}_{\varOmega }^{(3,\, 1/2)}\otimes \mathcal {I}^{(2)}\bigg )_{13425}\nonumber \\{} & {} \quad \displaystyle -\bigg (\mathcal {R}_{\varOmega }^{(3,\, 1/2)}\otimes \mathcal {I}^{(2)}\bigg )_{12435}-\mathcal {R}_{\varOmega }^{(3,\, 1/2)}\otimes \mathcal {I}^{(2)}{.} \end{aligned}$$
(90)

Finally, to evaluate the contributions \(\textrm{d}_{\textbf{p}}U^{(k)}(\textbf{p})\), k=0,...,4, we need the following identity, holding for \( m\ge 1 \)

$$\begin{aligned} \text {grad}(\mathcal {A}^{(m)}\cdot \mathcal {B}^{(m)})= \text {grad}(\mathcal {A}^{(m)})\cdot _{1,\ldots ,m} \mathcal {B}^{(m)} +\mathcal {A}^{(m)}\cdot _{1,\ldots ,m} \text {grad}(\mathcal {B}^{(m)}){,} \end{aligned}$$
(91)

according to which the vector field resulting from the differentiation of the scalar field \(\mathcal {A}^{(m)}\cdot \mathcal {B}^{(m)}\) is obtained by contracting in the product \(\cdot _{1,\ldots ,m} \) the first m indices of the rank \( m+1 \) tensor on the left (right) with the m indices of the rank m tensor on the right (left). The previous formula is extended to the case \( m=0 \) by using the identity (250). In conclusion we have from formula (6)

$$\begin{aligned} \textrm{d}_{\textbf{p}}U^{(0)}(\textbf{p})=G \delta _o \mathcal {R}_{\varOmega }^{(1,3/2)}{,} \end{aligned}$$
(92)

from formula (10),

$$\begin{aligned} \textrm{d}_{\textbf{p}}U^{(1)}(\textbf{p}) \displaystyle =G \Bigg [\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1,3/2)} +\mathcal {R}_{\varOmega }^{(2,3/2)}\Bigg ]\mathcal {C}^{(1)}{,} \end{aligned}$$
(93)

from formula (11),

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{d}_{\textbf{p}}U^{(2)}(\textbf{p}) =G \Bigg [\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1,\, 3/2)}+ \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2,\, 3/2)}+\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\otimes _{132} \textbf{p}+\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\Bigg ]\cdot _{12} \mathcal {C}^{(2)}{,} \end{array} \nonumber \\ \end{aligned}$$
(94)

from formula (12)

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{d}_{\textbf{p}}U^{(3)}(\textbf{p}) =G &{}\displaystyle \Bigg [(\textbf{p}\otimes \textbf{p}\otimes \textbf{p})\otimes \mathcal {R}_{\varOmega }^{(1,\, 3/2)}+\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2,\, 3/2)}+\bigg (\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{1324}\\ &{}\displaystyle +\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\otimes \textbf{p}\otimes \textbf{p}\bigg )_{1423}+\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(3,\, 3/2)}+\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\otimes \textbf{p}\bigg )_{1342}\\ &{}\displaystyle +\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\otimes \textbf{p}\bigg )_{1243}+\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\Bigg ]\cdot _{123} \mathcal {C}^{(3)}{,} \end{array} \end{aligned}$$
(95)

and, finally, from formula (13)

$$\begin{aligned} \begin{array}{ll} \displaystyle \textrm{d}_{\textbf{p}}U^{(4)}(\textbf{p})=G&\displaystyle \Bigg [\mathcal {B}_{\textbf{p}}^{(4)}+\mathcal {B}_{\textbf{p}}^{(3)}+\mathcal {B}_{\textbf{p}}^{(2)}+\mathcal {B}_{\textbf{p}}^{(1)}+\mathcal {R}_{\varOmega }^{(5,\, 3/2)}\Bigg ]\cdot _{1234} \mathcal {C}^{(4)} {,} \end{array} \end{aligned}$$
(96)

where

$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}}^{(4)}= & {} \textbf{p}\otimes \textbf{p}\otimes \textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(1,\, 3/2)}{,} \end{aligned}$$
(97)
$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}}^{(3)}= & {} \textbf{p}\otimes \textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2,\, 3/2)}+\bigg (\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2,\, 3/2)}\otimes \textbf{p}\bigg )_{12354}\nonumber \\{} & {} \displaystyle +\bigg (\textbf{p}\otimes \mathcal {R}_{\varOmega }^{(2,\, 3/2)}\otimes \textbf{p}\otimes \textbf{p}\bigg )_{12534}+\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\otimes \textbf{p}\otimes \textbf{p}\otimes \textbf{p}\bigg )_{15234}{,} \end{aligned}$$
(98)
$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}}^{(2)}= & {} \displaystyle \textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(3,\, 3/2)}+\bigg (\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{13245}+\bigg (\textbf{p}\otimes \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{14235}\nonumber \\{} & {} \displaystyle +\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\otimes \textbf{p}\otimes \textbf{p}\bigg )_{14523}+\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\otimes \textbf{p}\otimes \textbf{p}\bigg )_{13524}+\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\otimes \textbf{p}\otimes \textbf{p}\bigg )_{12534}{,} \end{aligned}$$
(99)
$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}}^{(1)}= & {} \displaystyle \textbf{p}\otimes \mathcal {R}_{\varOmega }^{(4,\, 3/2)}+\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\otimes \textbf{p}\bigg )_{15342}+\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\otimes \textbf{p}\bigg )_{12543}\nonumber \\{} & {} +\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\otimes \textbf{p}\bigg )_{12354} {.} \end{aligned}$$
(100)

It is worth emphasizing that the derivation of the formulas (95) and (96) is far from trivial and the reader should not be cheated by the fact that \(\textrm{d}_{\textbf{p}}U^{(3)}\) \((\textrm{d}_{\textbf{p}}U^{(4)})\) contains the same number of terms as \(U^{(3)}\) \((U^{(4)})\). Actually the eight (sixteen) terms in \(\textrm{d}_{\textbf{p}}U^{(3)}\) \((\textrm{d}_{\textbf{p}}U^{(4)})\) obtained during the differentiation result from the cancellation of 24 (64) addends of formulas (12) and (13), whose expressions originally contained 32 and 80 addends, respectively.

For this reason, in order to the help the interested reader to trace back the manipulations required to get the final expressions (95) and (96), we also report their counterparts expressed in terms of components

$$\begin{aligned} \displaystyle \bigg (\textrm{d}_{\textbf{p}}U^{(3)}\bigg )_{l}= & {} G \displaystyle \Bigg [\textbf{p}_i\textbf{p}_j\textbf{p}_k\bigg (\mathcal {R}_{\varOmega }^{(1,\, 3/2)}\bigg )_l+\textbf{p}_i\textbf{p}_j\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{kl}+\textbf{p}_i\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{jl}\textbf{p}_k\nonumber \\{} & {} +\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{il}\textbf{p}_j\textbf{p}_k\nonumber \\{} & {} \displaystyle +\textbf{p}_i\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{jkl}+\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{ikl}\textbf{p}_j+\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{ijl}\textbf{p}_k\nonumber \\{} & {} +\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\bigg )_{ijkl}\Bigg ]\,\mathcal {C}^{(3)}_{ijk}{,} \end{aligned}$$
(101)
$$\begin{aligned} \displaystyle \bigg (\textrm{d}_{\textbf{p}}U^{(4)}\bigg )_{q}= & {} G \displaystyle \Bigg [\mathcal {B}_{\textbf{p}\,ijklq}^{(4)}+\mathcal {B}_{\textbf{p}\,ijklq}^{(3)}+\mathcal {B}_{\textbf{p}\,ijklq}^{(2)}+\mathcal {B}_{\textbf{p}\,ijklq}^{(1)}+\bigg (\mathcal {R}_{\varOmega }^{(5,\, 3/2)}\bigg )_{ijklq}\Bigg ]\ \mathcal {C}^{(4)}_{ijkl} {,} \nonumber \\ \end{aligned}$$
(102)

where

$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}\,ijklq}^{(4)}= & {} \displaystyle \textbf{p}_i\textbf{p}_j\textbf{p}_k\textbf{p}_l\bigg (\mathcal {R}_{\varOmega }^{(1,\, 3/2)}\bigg )_q {,} \end{aligned}$$
(103)
$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}\,ijklq}^{(3)}= & {} \displaystyle \textbf{p}_i\textbf{p}_j\textbf{p}_k\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{lq}+\textbf{p}_i\textbf{p}_j\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{kq}\textbf{p}_l+\textbf{p}_i\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{jq}\textbf{p}_k\textbf{p}_l\nonumber \\{} & {} +\bigg (\mathcal {R}_{\varOmega }^{(2,\, 3/2)}\bigg )_{iq}\textbf{p}_j\textbf{p}_k\textbf{p}_l{,} \end{aligned}$$
(104)
$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}\,ijklq}^{(2)}= & {} \displaystyle \textbf{p}_i\textbf{p}_j\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{klq}+\textbf{p}_i\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{jlq}\textbf{p}_k+\textbf{p}_i\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{jkq}\textbf{p}_l\nonumber \\{} & {} \displaystyle +\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{ilq}\textbf{p}_j\textbf{p}_k+\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{ikq}\textbf{p}_j\textbf{p}_l+\bigg (\mathcal {R}_{\varOmega }^{(3,\, 3/2)}\bigg )_{ijq}\textbf{p}_k\textbf{p}_l {,} \end{aligned}$$
(105)
$$\begin{aligned} \displaystyle \mathcal {B}_{\textbf{p}\,ijklq}^{(1)}= & {} \displaystyle \textbf{p}_i\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\bigg )_{jklq}+\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\bigg )_{iklq}\textbf{p}_j+\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\bigg )_{ijlq}\textbf{p}_k+\bigg (\mathcal {R}_{\varOmega }^{(4,\, 3/2)}\bigg )_{ijkq}\textbf{p}_l{.}\nonumber \\ \end{aligned}$$
(106)

In particular the component expressions are useful for programming.

4.1 Analytical Expression of the Gravity Vector (GV) in Terms of 2D Integrals

In order to evaluate the generic \(\textrm{d}_{\textbf{p}}U^{(k)})\) we need to analytically compute the integrals in \(\mathcal {R}_{\varOmega }^{(m,\, 3/2)}\) (85). This has already been done in D’Urso (2014b) for \( m=0 \) and \( m=1 \) by means of an approach based on the use of the following formula

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(m,3/2)}=\int \limits _{\varOmega } \frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{3/2}}dV= \frac{1}{m}\int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{3/2}}\textrm{d}A \quad m=1,\ldots \quad {,} \end{aligned}$$
(107)

where \( \textbf{n}\) is the 3D outward unit normal to the boundary \( \partial \varOmega \) of the polyhedral body.

Proof of the above formula is based on the identity

$$\begin{aligned} \begin{array}{rl} \displaystyle \text {div}&\displaystyle \Biggl [[\otimes \textbf{r},m]\otimes \frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}\Biggr ] = m \frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{3/2}}+[\otimes \textbf{r},m]\,\text {div}\,\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}}, \end{array} \end{aligned}$$
(108)

a result that can be obtained by adopting an approach similar to that leading to (20).

Integrating the previous identity over \( \varOmega \) one has

$$\begin{aligned} \int \limits _\varOmega \frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{3/2}}\textrm{d}V = \frac{1}{m}\Biggl \{\, \int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{3/2}}\textrm{d}A - \int \limits _\varOmega {[}\otimes \textbf{r},m]\,\text {div}\,\frac{\textbf{r}}{(\textbf{r}\cdot \textbf{r})^{3/2}} \textrm{d}V\,\Biggr \}, \end{aligned}$$
(109)

leading to formula (107), since the second integral on the right-hand side vanishes on account of (24) applied componentwise to each entry of the tensors \( [\otimes \textbf{r},m] \). In particular, formula (109) allows us to prove that the integrals \(\mathcal {R}_{\varOmega }^{(m,\, 3/2)}\) are well defined, for each m, independently from the position of the point \( \textbf{r}=\textbf{o}\) with respect to \( \varOmega \).

Hence we can write, for \(m\ge 1 \),

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(m,3/2)}=\int \limits _{\varOmega } \frac{[\otimes \textbf{r},m]}{(\textbf{r}\cdot \textbf{r})^{3/2}}\textrm{d}V= \frac{1}{m}\int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{3/2}}\textrm{d}A=\frac{1}{m} \mathcal {R}_{\partial \varOmega }^{(m,3/2)} \quad m=1,\ldots \quad {,} \nonumber \\ \end{aligned}$$
(110)

by obtaining expressions that are well defined whatever is the position of the observation point with respect to \( \varOmega \).

4.2 Analytical Expression of the GV in Terms of Face Integrals

Let us now specialize formula (110) to the significant case of a polyhedral domain by writing

$$\begin{aligned} \mathcal {R}_{\partial \varOmega }^{(m,3/2)}= & {} \int \limits _{\partial \varOmega } \frac{[\otimes \textbf{r},m](\textbf{r}\cdot \textbf{n})}{(\textbf{r}\cdot \textbf{r})^{3/2}}\textrm{d}A=\sum _{i=1}^{N_F}\int \limits _{F_i} \frac{[\otimes \textbf{r}_i,m](\textbf{r}_i\cdot \textbf{n}_i)}{(\textbf{r}_i\cdot \textbf{r}_i)^{3/2}}\textrm{d}A_i\nonumber \\= & {} \sum _{i=1}^{N_F} \ d_i \ \mathcal {R}_{F_{i}}^{(m,3/2)} \quad m=1,\ldots \quad {,} \end{aligned}$$
(111)

where, as in (26), \( \textbf{r}_i \) represents the generic vector spanning the i-th face \( F_i \) of \( \varOmega \), \( \textbf{n}_i \) the unit vector orthogonal to \( F_i \), pointing outwards \( \varOmega \) and \( d_i=\textbf{r}_i\cdot \textbf{n}_i\).

To compute \( \mathcal {R}_{F_{i}}^{(m,3/2)} \) we follow a procedure analogous to that adopted for \(\mathcal {R}_{F_{i}}^{(m,1/2)}\). Thus, recalling also the decomposition (28) we have

$$\begin{aligned} \begin{array}{lcl} \displaystyle \mathcal {R}_{F_i}^{(1,3/2)}= & {} \displaystyle \int \limits _{F_i} \frac{d_i\textbf{n}_i+\textbf{T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\textrm{d}A_i =d_i\,\textbf{n}_i\,\textrm{P}_{F_i}^{(0,3/2)}+\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}{,} \end{array} \end{aligned}$$
(112)

where we have introduced the symbol

$$\begin{aligned} \displaystyle \textrm{P}_{F_i}^{(m,3/2)}=\displaystyle \int \limits _{F_i} \frac{[\otimes {\varvec{\rho }}_i,m]}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\textrm{d}A_i \quad m=1,2,\ldots \quad {,} \end{aligned}$$
(113)

analogous to that introduced in formula (33).

Furthermore, using the terminology introduced in Sect. 2.2, we have

$$\begin{aligned} \mathcal {R}_{F_i}^{(2,3/2)}= & {} d_i^2\textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,3/2)} +d_i\biggl [\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i +\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\biggr ]+\mathbb {T}_{F_i}^{(2)} \textrm{P}_{F_i}^{(2,3/2)}{,} \nonumber \\ \end{aligned}$$
(114)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i}^{(3,3/2)}= & {} \displaystyle d_i^3\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,3/2)}\nonumber \\{} & {} +d_i^2\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}+\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i+\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ] \nonumber \\{} & {} +d_i\biggl [\textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes _{132}\textbf{n}_i+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i\biggr ]+\mathbb {T}^{(3)}_{F_i} \textrm{P}_{F_i}^{(3,3/2)}{,} \nonumber \\ \end{aligned}$$
(115)

and

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(4,3/2)}=&\displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,4)}+\mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,3)}+\mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,2)}+\mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,1)}+ \mathbb {T}^{(4)}_{F_i,\textbf{n}_i} \textrm{P}_{F_i}^{(4,3/2)}{,} \end{array} \end{aligned}$$
(116)

where

$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,4)}= & {} \displaystyle d_i^4\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,3/2)}{,} \end{aligned}$$
(117)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,3)}= & {} \displaystyle d_i^3\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}+\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\nonumber \\{} & {} \displaystyle +\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i+\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ]{,} \end{aligned}$$
(118)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,2)}= & {} \displaystyle d_i^2\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}+\textbf{n}_i\otimes \textbf{n}_i\otimes _{1324}\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\nonumber \\{} & {} \displaystyle +\textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes _{1432}\textbf{n}_i\otimes \textbf{n}_i\nonumber \\{} & {} \displaystyle +\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes _{1324}\textbf{n}_i\otimes \textbf{n}_i+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ]{,} \end{aligned}$$
(119)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(4,3/2,1)}= & {} \displaystyle d_i\biggl [\textbf{n}_i\otimes \mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}+\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes _{1432}\textbf{n}_i\nonumber \\{} & {} \displaystyle +\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes _{1243}\textbf{n}_i+\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes \textbf{n}_i\biggr ]{.} \end{aligned}$$
(120)

To derive the formula relevant to \(\mathcal {R}_{F_i}^{(5,3/2)}\) we need to extend the terminology introduced in Appendix A to the fifth-order tensors obtained by combining two vectors. Namely we shall set

$$\begin{aligned} \mathcal {D}^{(5)}_{\textbf{n}_i\textbf{n}_i\textbf{n}_i\textbf{n}_i\textbf{n}_i}= & {} \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i{,} \end{aligned}$$
(121)
$$\begin{aligned} \displaystyle \mathcal {D}^{(5)}_{\textbf{n}_i\textbf{n}_i\textbf{n}_i\textbf{n}_i{\varvec{\rho }}_i}= & {} \displaystyle \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i+\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i \nonumber \\{} & {} \displaystyle +\,\textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i+\textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\nonumber \\{} & {} +{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i{,} \end{aligned}$$
(122)
$$\begin{aligned} \displaystyle \mathcal {D}^{(5)}_{\textbf{n}_i\textbf{n}_i\textbf{n}_i{\varvec{\rho }}_i{\varvec{\rho }}_i}= & {} \displaystyle \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i+\textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\nonumber \\{} & {} +\textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} \displaystyle +\,\textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i+\textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} +{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\nonumber \\{} & {} \displaystyle +\,{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i+\textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\nonumber \\{} & {} +{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\nonumber \\{} & {} \displaystyle +\,{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i{,} \end{aligned}$$
(123)
$$\begin{aligned} \displaystyle \mathcal {D}^{(5)}_{\textbf{n}_i\textbf{n}_i{\varvec{\rho }}_i{\varvec{\rho }}_i{\varvec{\rho }}_i}= & {} \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i+\textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} +{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} \displaystyle +\,\textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i+\textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} +{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\nonumber \\{} & {} \displaystyle +\,{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i+{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i+{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} \displaystyle +\,{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes \textbf{n}_i{,} \end{aligned}$$
(124)
$$\begin{aligned} \mathcal {D}^{(5)}_{\textbf{n}_i{\varvec{\rho }}_i{\varvec{\rho }}_i{\varvec{\rho }}_i{\varvec{\rho }}_i}= & {} \displaystyle \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i+{\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} \displaystyle +\,{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i+{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i\otimes {\varvec{\rho }}_i\nonumber \\{} & {} +{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes \textbf{n}_i{,} \end{aligned}$$
(125)
$$\begin{aligned} \mathcal {D}^{(5)}_{{\varvec{\rho }}_i{\varvec{\rho }}_i{\varvec{\rho }}_i{\varvec{\rho }}_i{\varvec{\rho }}_i}= & {} \displaystyle {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i{.} \end{aligned}$$
(126)

Please notice that the order of the elements in the six groups of fifth-order tensors above is not casual. Actually, grouping the six tensors in three groups of complementary tensors, e.g., \(\mathcal {D}^{(5)}_{\textbf{n}_i\textbf{n}_i\textbf{n}_i{\varvec{\rho }}_i{\varvec{\rho }}_i} \) and \(\mathcal {D}^{(5)}_{{\varvec{\rho }}_i{\varvec{\rho }}_i{\varvec{\rho }}_i\textbf{n}_i\textbf{n}_i} \), the k-th element of the first tensor in each group is obtained from the \((N-k)\)-th element of the complementary tensor, N being the total number of elements in each tensor, by exchanging \(\textbf{n}_i\) and \({\varvec{\rho }}_i\).

According to the general rule illustrated above, we finally have

$$\begin{aligned} \begin{array}{ll} \displaystyle \mathcal {R}_{F_i}^{(5,3/2)}=&\displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,5)}+\mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,4)}+\mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,3)}+\mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,2)}+\mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,1)}+ \mathbb {T}^{(5)}_{F_i} \textrm{P}_{F_i}^{(5,3/2)}\,{,} \end{array} \nonumber \\ \end{aligned}$$
(127)

where

$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,5)}= & {} \displaystyle d_i^5\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,3/2)}{,} \end{aligned}$$
(128)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,4)}= & {} \displaystyle d_i^4\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}+\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\nonumber \\{} & {} \displaystyle +\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i+\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\nonumber \\{} & {} \displaystyle +\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ]{,} \end{aligned}$$
(129)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,3)}= & {} \displaystyle d_i^3\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}+(\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)})_{12543}\nonumber \\{} & {} \displaystyle +(\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)})_{12435}+(\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)})_{14352}\nonumber \\{} & {} \displaystyle +(\textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)})_{14325}+(\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i)_{14325}\nonumber \\{} & {} \displaystyle +(\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i)_{15342}+(\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i)_{32145}\nonumber \\{} & {} \displaystyle +(\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i)_{13245}+\mathbb {T}^{(2)}_{F_i}\textrm{P}_{F_i}^{(2,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ]{,} \end{aligned}$$
(130)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,2)}= & {} \displaystyle d_i^2\biggl [\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}+(\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)})_{13245}\nonumber \\{} & {} \displaystyle +(\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)})_{32145}+(\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)})_{15342}\nonumber \\{} & {} \displaystyle +(\textbf{n}_i\otimes \textbf{n}_i\otimes \mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)})_{14325}+(\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i)_{14325}\nonumber \\{} & {} \displaystyle +(\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i)_{15342}+(\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i)_{12435}\nonumber \\{} & {} \displaystyle +(\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i)_{12543}+\mathbb {T}^{(3)}_{F_i}\textrm{P}_{F_i}^{(3,3/2)}\otimes \textbf{n}_i\otimes \textbf{n}_i\biggr ]{,} \end{aligned}$$
(131)
$$\begin{aligned} \displaystyle \mathcal {R}_{F_i,\textbf{n}_i}^{(5,3/2,1)}= & {} \displaystyle d_i\biggl [\textbf{n}_i\otimes \mathbb {T}^{(4)}_{F_i}\textrm{P}_{F_i}^{(4,3/2)}+\mathbb {T}^{(4)}_{F_i}\textrm{P}_{F_i}^{(4,3/2)}\otimes _{15342}\textbf{n}_i+\mathbb {T}^{(4)}_{F_i}\textrm{P}_{F_i}^{(4,3/2)}\otimes _{12543}\textbf{n}_i\nonumber \\{} & {} \displaystyle +\mathbb {T}^{(4)}_{F_i}\textrm{P}_{F_i}^{(4,3/2)}\otimes _{12354}\textbf{n}_i+\mathbb {T}^{(4)}_{F_i}\textrm{P}_{F_i}^{(4,3/2)}\otimes \textbf{n}_i\biggr ]{.} \end{aligned}$$
(132)

In conclusion, replacing formulas (112), (114), (115), (116) and (127) in (92), (93), (94), (95) and (96), we realize that the computation of \(\textrm{d}_{\textbf{p}} U^{(k)}\) amounts to evaluating the 2D integrals (113), an issue addressed in the following subsection.

4.3 Analytical Expression of Face Integrals Related to the GV in Terms of 1D Integrals

The 2D integrals (113) required to evaluated the gravity vector in formulas (92), (93), (94), (95) and (96) can be further simplified by using the generalized Gauss theorem (Tang 2006) and transforming them to simpler 1D integrals. This has already been done for \( m=0, 1, 2 \) in D’Urso (2014b) and D’Urso and Trotta (2017); the additional formulas required in the cases \( m=3, 4, 5 \) are reported in Appendix D. They make use of the following additional notation

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[1\cdot , 1(1/2)]}= & {} \displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\rho }}_i(s_i) \cdot {\varvec{\nu }}_i(s_i)}{\Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)\Bigr ]\Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}}\,\textrm{d}s_i{,} \end{aligned}$$
(133)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[0,1/2]}= & {} \displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\nu }}_i(s_i)}{\Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}}\,\textrm{d}s_i{,} \end{aligned}$$
(134)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[1\otimes ,\,1/2]}= & {} \displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i}{({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2)^{1/2}}{,} \end{aligned}$$
(135)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[2\otimes ,\,1/2]}= & {} \displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i}{({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2)^{1/2}}{,} \end{aligned}$$
(136)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[3\otimes ,\,1/2]}= & {} \displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i}{({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2)^{1/2}}{,} \end{aligned}$$
(137)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{[4\otimes ,\,1/2]}= & {} \displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)\,\textrm{d}s_i}{({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2)^{1/2}}{.} \end{aligned}$$
(138)

For the reader’s convenience the formulas expressing the integrals (113) as function of boundary integrals are reported in the sequel

  • Integral (113), for \( m=0 \), see, e.g., formula (37) of D’Urso (2014b)

    $$\begin{aligned} \displaystyle \textrm{P}_{F_i}^{(0,3/2)}=\int \limits _{F_i} \frac{\textrm{d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}=\frac{\alpha _i}{|d_i|}-\textrm{P}_{\partial F_i}^{[1\cdot , 1(1/2)]}{.} \end{aligned}$$
    (139)
  • Integral (113), for \( m=1 \), see, e.g., formula (38) of D’Urso (2014b)

    $$\begin{aligned} \displaystyle \textrm{P}_{F_i}^{(1,3/2)}= & {} \int \limits _{F_i} \frac{{\varvec{\rho }}_i\,\textrm{d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\nonumber \\= & {} -\textrm{P}_{\partial F_i}^{[0,1/2]}{.} \end{aligned}$$
    (140)
  • Integral (113), for \( m=2 \), see, e.g., formula (40) of D’Urso (2014b)

    $$\begin{aligned} \displaystyle \textrm{P}_{F_i}^{(2,3/2)}= & {} \displaystyle \int \limits _{F_i} \frac{{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\textrm{d}A_i\nonumber \\= & {} -\textrm{P}_{\partial F_i}^{(1\otimes , 1/2)}+\mathcal {I}^{(2)}\Bigl [\textrm{P}_{\partial F_i}^{[(1/2)1\cdot ,1]}-\alpha _i |d_i|\Bigr ]{.} \end{aligned}$$
    (141)
  • Integral (113), for \( m=3 \), on account of formula (299)

    $$\begin{aligned} \displaystyle \textrm{P}_{F_i}^{(3,3/2)}= & {} \displaystyle \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\textrm{d}A_i\nonumber \\= & {} -\textrm{P}_{\partial F_i}^{(2\otimes ,\,1/2)}+ \mathcal {I}^{(2)}\otimes _{132}\textrm{P}_{\partial F_i}^{[(1/2)\,0]} +\textrm{P}_{\partial F_i}^{[(1/2)\,0]}\otimes \mathcal {I}^{(2)}{.} \end{aligned}$$
    (142)
  • Integral (113), for \( m=4 \), on account of formula (301)

    $$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{F_i}^{(4,3/2)}=&{}\displaystyle \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\textrm{d}A_i\\ =&{}\displaystyle -\textrm{P}_{\partial F_i}^{[3\otimes ,\,1/2]}+\mathcal {I}^{(2)} \otimes _{1423}\Biggl [\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}-\frac{\mathcal {I}^{(2)}}{3}\,\textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}\Biggr ]\\ &{}\displaystyle +\mathcal {I}^{(2)} \otimes _{1243}\Biggl [\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}-\frac{\mathcal {I}^{(2)}}{3}\,\textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}\Biggr ]+\Biggl [\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}-\frac{\mathcal {I}^{(2)}}{3}\,\textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}\Biggr ]\otimes \mathcal {I}^{(2)}{.} \end{array} \end{aligned}$$
    (143)
  • Integral (113), for \( m=5 \), on account of formula (304)

    $$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{F_i}^{(5,3/2)}=&{}\displaystyle \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\textrm{d}A_i\\ =&{}\displaystyle -\textrm{P}_{\partial F_i}^{[4\otimes ,\,1/2]}+\textrm{P}_{\partial F_i}^{(5,\,3/2,A)}+\textrm{P}_{\partial F_i}^{(5,\,3/2,B)}+\textrm{P}_{\partial F_i}^{(5,\,3/2,C)}+\textrm{P}_{\partial F_i}^{(5,\,3/2,D)}{,} \end{array} \end{aligned}$$
    (144)

where

$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{(5,\,3/2,A)}= & {} \displaystyle +\mathcal {I}^{(2)} \otimes _{15234}\textrm{P}_{\partial F_i}^{[(1/2)2\otimes ]}\nonumber \\{} & {} - \frac{1}{4}\Biggl [\Biggl (\mathcal {I}^{(2)}\otimes \mathcal {I}^{(2)}\otimes \textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\Biggr )_{15243}+\Biggl (\mathcal {I}^{(2)}\otimes \textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\Biggr )_{15234}\Biggr ]{,} \end{aligned}$$
(145)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{(5,\,3/2,B)}= & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)2\otimes ]}\otimes _{13425}\mathcal {I}^{(2)}\nonumber \\{} & {} - \frac{1}{4}\Biggl [\Biggl (\mathcal {I}^{(2)}\otimes \textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\Biggr )_{14325}+\Biggl (\textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\otimes \mathcal {I}^{(2)}\Biggr )_{13425}\Biggr ]{,} \end{aligned}$$
(146)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{(5,\,3/2,C)}= & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)2\otimes ]}\otimes _{12435}\mathcal {I}^{(2)}\nonumber \\{} & {} - \frac{1}{4}\Biggl [\Biggl (\mathcal {I}^{(2)}\otimes \textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\Biggr )_{14235}+\Biggl (\textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\otimes \mathcal {I}^{(2)}\Biggr )_{12435}\Biggr ]{,} \end{aligned}$$
(147)
$$\begin{aligned} \displaystyle \textrm{P}_{\partial F_i}^{(5,\,3/2,D)}= & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)2\otimes ]}\otimes \mathcal {I}^{(2)}- \frac{1}{4}\Biggl [\Biggl (\mathcal {I}^{(2)}\otimes \textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\Biggr )_{13245}+\textrm{P}_{\partial F_i}^{1\,\mathcal {I}}\otimes \mathcal {I}^{(2)}\otimes \mathcal {I}^{(2)}\Biggr ]{.} \nonumber \\ \end{aligned}$$
(148)

4.4 Algebraic Expression of the Face Integrals Related to the GV in Terms of 2D Vectors

There are now available formulas that express the integrals (113) as function of 1D integrals. There have been derived to facilitate the computation of the integrals \(\textrm{P}_{F_i}^{(m,3/2)}\), \( m=0,\ldots ,5 \), appearing in the formulas (112), (32), (36), (37) and (127) for \(\mathcal {R}_{F_i}^{(m,3/2)}\), \( m=1,\ldots ,5 \).

In turn such integrals are required to compute \(\textrm{d}_{\textbf{p}} U^{(k)}, k=0,\ldots ,4,\) by means of formulas (92), (93), (94), (95) and (96).

Our next step is to further simplify the evaluation of the boundary integrals entering the formulas for \(\textrm{P}_{F_i}^{(m,3/2)}\) by expressing them as sums over the \(N_{E_i}\) edges defining the boundary \(\partial F_i\). Specifically, adopting the parameterization (52) for the j-th edge of the face \(F_i\) and the notation introduced in Sect. (2.4). Specifically, with reference to the integral (133) appearing in formula (139), it turns out to be

$$\begin{aligned} \begin{array}{rcl} \displaystyle \textrm{P}_{\partial F_i}^{[1\cdot , 1(1/2)]}= & {} \displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\rho }}_i(s_i) \cdot {\varvec{\nu }}_i(s_i)}{\Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)\Bigr ]\Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}}\,\textrm{d}s_i= \sum _{j=1}^{N_{E_i}}\big ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \big ) I_j^{[0,1(1/2)]}{,} \end{array} \nonumber \\ \end{aligned}$$
(149)

where the symbols \( p_j \), \( q_j \), \( u_j \) and \( v_j \) are defined in (55) and (56) while \( ATN1_j \), \( ATN2_j \) in the expression (287) of \( I_j^{[0,1(1/2)]} \) are defined in (280) and (281), respectively.

Concerning the integral (134) we have

$$\begin{aligned} \begin{array}{rcl} \displaystyle \textrm{P}_{\partial F_i}^{[0,1/2]}&{}=&{}\displaystyle \int \limits _{\partial F_i} \frac{{\varvec{\nu }}_i(s_i)}{\Bigl [{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\Bigr ]^{1/2}}\,\textrm{d}s_i\\ &{}=&{}\displaystyle \sum _{j=1}^{N_{E_i}}\varDelta {\varvec{\rho }}_{j}^\perp \int \limits _{0}^{1} \frac{d\lambda _j}{\bigl (p_j \lambda ^2 + 2q_j \lambda _j + v_j\bigr )^{1/2}}=\sum _{j=1}^{N_{E_i}} I_j^{(0,1/2)}\,\varDelta {\varvec{\rho }}_{j}^\perp {,} \end{array} \end{aligned}$$
(150)

where the integral \( I_j^{(0,1/2)}\) is evaluated in (288).

The integral (135) is obtained by the formula

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[1\otimes ,\,1/2]} =&{} \displaystyle \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)}{\Bigr ({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl )^{1/2}} \textrm{d}s_i\\ =&{}\sum _{j=1}^{N_{E_i}} \Biggl [\int \limits _{0}^{1}\frac{{\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j}{\Bigl (p_j\lambda ^2_j+2q_j\lambda _j+v_j\Bigr )^{1/2}} l_j\,\textrm{d}\lambda _j\Biggr ]\otimes {\varvec{\nu }}_j\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}} \Biggl [I_j^{(0,1/2)}{\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp }+I_j^{(1,1/2)}\varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp }\Biggr ]{,} \end{array} \end{aligned}$$
(151)

where the integral \( I_j^{(0,1/2)}\) and \( I_j^{(1,1/2)}\) are defined in (288) and (289), respectively.

The integral (136) is given by

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[2\otimes ,\,1/2]} =&{} \displaystyle \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)}{\Bigr ({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl )^{1/2}} \textrm{d}s_i\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}} \Biggl [\int \limits _{0}^{1}\frac{\left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) \otimes \left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) }{\Bigl (p_j\lambda ^2_j+2q_j\lambda _j+v_j\Bigr )^{1/2}} l_j\,\textrm{d}\lambda _j\Biggr ]\otimes {\varvec{\nu }}_j\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}}\Bigl [I_j^{(0,1/2)}\mathcal {E}^{(2)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j}+I_j^{(1,1/2)}\mathcal {E}^{(2)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(2,1/2)}\mathcal {E}^{(2)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\Bigr ]\otimes \varDelta {\varvec{\rho }}_j^{\perp }{,} \end{array} \end{aligned}$$
(152)

where the symbols \(\mathcal {E}^{(2)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j}\), \(\mathcal {E}^{(2)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\), and \(\mathcal {E}^{(2)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\) are defined in (65) and the integrals \(I_j^{(0,1/2)}\), \(I_j^{(1,1/2)}\) and \(I_j^{(2,1/2)}\) are reported in the formulas (288), (289) and (290), respectively.

The integral (137) reads

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[3\otimes ,\,1/2]} =&{} \displaystyle \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)}{\Bigr ({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl )^{1/2}} \textrm{d}s_i\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}} \Biggl [\int \limits _{0}^{1}\frac{\left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) \otimes \left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) \otimes \left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) }{\Bigl (p_j\lambda ^2_j+2q_j\lambda _j+v_j\Bigr )^{1/2}} l_j\,\textrm{d}\lambda _j\Biggr ]\otimes {\varvec{\nu }}_j\\ =&{}\displaystyle \sum _{j=1}^{N_{E_i}}\Bigl [I_j^{(0,1/2)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}+I_j^{(1,1/2)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\\ &{}\quad +I_j^{(2,1/2)}\mathcal {E}^{(3)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(3,1/2)}\mathcal {E}^{(3)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\Bigr ]\otimes \varDelta {\varvec{\rho }}_j^{\perp }{,} \end{array} \end{aligned}$$
(153)

where the symbols \(\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}\), \(\mathcal {E}^{(3)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\), \(\mathcal {E}^{(3)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\) and \(\mathcal {E}^{(3)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\) are defined in (67) and \(I_j^{(0,1/2)}\), \(I_j^{(1,1/2)}\), \(I_j^{(2,1/2)}\) and \(I_j^{(3,1/2)}\) are reported in the formulas (288), (289), (290) and (291), respectively.

Finally the integral (138) has the following expression

$$\begin{aligned}{} & {} \displaystyle \textrm{P}_{\partial F_i}^{[4\otimes ,\,1/2]} = \displaystyle \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\rho }}_i(s_i) \otimes {\varvec{\nu }}_i(s_i)}{\Bigr ({\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i (s_i)+d_i^2\Bigl )^{1/2}} \textrm{d}s_i\nonumber \\{} & {} \quad =\displaystyle \sum _{j=1}^{N_{E_i}} \Biggl [\int \limits _{0}^{1}\frac{\left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) \otimes \left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) \otimes \left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) \otimes \left( {\varvec{\rho }}_j+\lambda _j\varDelta {\varvec{\rho }}_j\right) }{\Bigl (p_j\lambda ^2_j+2q_j\lambda _j+v_j\Bigr )^{1/2}} l_j\,\textrm{d}\lambda _j\Biggr ]\nonumber \\{} & {} \quad \otimes {\varvec{\nu }}_j{,} \end{aligned}$$
(154)

or equivalently

$$\begin{aligned}{} & {} \displaystyle \textrm{P}_{\partial F_i}^{[4\otimes ,\,1/2]} = \displaystyle \sum _{j=1}^{N_{E_i}}\Bigl [I_j^{(0,1/2)}\mathcal {E}^{(4)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}+I_j^{(1,1/2)}\mathcal {E}^{(4)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\nonumber \\{} & {} \quad \displaystyle +I_j^{(2,1/2)}\mathcal {E}^{(4)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(3,1/2)}\mathcal {E}^{(4)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}+I_j^{(4,1/2)}\mathcal {E}^{(4)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\Bigr ]\otimes \varDelta {\varvec{\rho }}_j^{\perp }{,} \nonumber \\ \end{aligned}$$
(155)

where

$$\begin{aligned} \begin{array}{rl} \mathcal {E}^{(4)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j}={\varvec{\rho }}_j \otimes {\varvec{\rho }}_j \otimes {\varvec{\rho }}_j \otimes {\varvec{\rho }}_j \qquad \mathcal {E}^{(4)}_{\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}=\varDelta {\varvec{\rho }}_j \otimes \varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j {,} \end{array}\nonumber \\ \end{aligned}$$
(156)

and the expressions of the symbols \(\mathcal {E}^{(4)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\), \(\mathcal {E}^{(4)}_{{\varvec{\rho }}_j{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j} \) and \(\mathcal {E}^{(4)}_{{\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j\varDelta {\varvec{\rho }}_j}\) can be inferred from the symbols \(\mathcal {D}^{(4)}_{\textbf{p}\textbf{p}\textbf{p}\textbf{r}}\), \(\mathcal {D}^{(4)}_{\textbf{p}\textbf{p}\textbf{r}\textbf{r}}\) and \(\mathcal {D}^{(4)}_{\textbf{p}\textbf{r}\textbf{r}\textbf{r}}\) in (211), (212) and (213), respectively, by replacing \( \textbf{p}\) with \({\varvec{\rho }}_j\) and \( \textbf{r}\) with \(\varDelta {\varvec{\rho }}_j\). Furthermore, the expressions of \(I_j^{(0,1/2)}\), \(I_j^{(1,1/2)}\), \(I_j^{(2,1/2)}\), \(I_j^{(3,1/2)}\) and \(I_J^{(4,1/2)}\) are reported in the formulas (288), (289), (290), (291) and (292), respectively.

4.5 Removable Singularities of the Algebraic Expressions of the Gravity Vector

It has been proved in formula (107) that expression of the integrals \( \mathcal {R}_{\varOmega }^{(m,3/2)} \), \( m=1,\ldots ,5 \), entering formula (9296) for the addends \( \textrm{d}_{\textbf{p}}U^{(k)}\), \( k=0,\ldots ,4 \), of the gravity vector are singularity-free independently from the position of the observation point P with respect to \(\varOmega \).

Nevertheless, the algebraic counterparts \( \mathcal {R}_{F_i}^{(m,3/2)} \) can include integrals extended to the generic edge of the face \( F_i \) that can exhibit singularities whenever the observation point belongs to \( F_i \) or when its projection over \( F_i \) belongs to an edge defining its boundary.

However, this possible singularity of the generic integral \( I_j \) extended to the j-th edge of \( \partial F_i \) is actually ineffective from the computational point of view since it will be proved by analytical arguments that its contribution to the integral \( \mathcal {R}_{F_i}^{(m,3/2)} \) is null.

To prove the results of interest we shall make use of the notation introduced it in the formulas (55) and (72) and observe that the combination of the formulas (110) and (111) yields

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(m,3/2)}=\frac{1}{m} \sum _{i=1}^{N_F} \ d_i \ \mathcal {R}_{F_{i}}^{(m,3/2)} \qquad m=1,\ldots ,5\quad {,} \end{aligned}$$
(157)

when the expression of \( \mathcal {R}_{F_i}^{(m,3/2)} \), \( m=1,\ldots ,5 \), are provided in the formulas (112), (114116) and (127). In turn, they depend upon the integrals \( \textrm{P}_{F_i}^{(m,3/2)} \) defined in (113) whose value is computed as a sum of the integrals (133138) extended to the boundary \( \partial F_i \).

Due to the intricate combination of integrals to be evaluated it is convenient to indicate the set of formulas required to compute \( \mathcal {R}_{F_i}^{(m,3/2)} \) by concisely reporting the sequence of formulas to be invoked. For instance

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(1,3/2)}\leftrightarrow &{}\displaystyle (112)\rightarrow [(139),(140)]\rightarrow [(133),(134)]\\ &{}\rightarrow \displaystyle [(149),(150)]\rightarrow [(287),(288)]{,} \end{array} \end{aligned}$$
(158)

meaning that the computation of \( \mathcal {R}_{\varOmega }^{(1,3/2)} \) requires the evaluation of the integrals \( I_j^{[0,1(1/2)]} \) and \( I_j^{(0,1/2)} \) over the edges of \( \partial F_i \).

Analogously,

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(2,3/2)}\leftrightarrow &{}\displaystyle (114)\rightarrow [(139),(140),(141)]\rightarrow [(133),(134),(135)-(59)]\\ &{}\displaystyle \rightarrow [(149),(150),(151)]\rightarrow [(287),(288),(289)]{,} \end{array} \end{aligned}$$
(159)

so that one needs to compute the integrals \( I_j^{(1,1/2)} \) in addition to those required for computing \( \mathcal {R}_{\varOmega }^{(2,3/2)} \). As a matter of fact this represents are general rule in the sense that the computation of the integral \( \mathcal {R}_{F_i}^{(m+1,3/2)} \) requires to evaluate an additional integral with respect to those associated with \( \mathcal {R}_{F_i}^{(m,3/2)} \). Actually

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(3,3/2)}\leftrightarrow &{}\displaystyle (115)\rightarrow [(139), (140), (141), (142)]\\ &{}\displaystyle \rightarrow [(133),(134),(135)- (59),(136)]\\ &{}\displaystyle \rightarrow {[}(149),(150),(151),(152)]\rightarrow [(287),(288),(289),(290)]{,} \end{array} \end{aligned}$$
(160)

what requires computation of \( I_j^{(2,1/2)} \) in addition to the previously indicated integrals.

Furthermore

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(4,3/2)}\leftrightarrow &{}\displaystyle (116)\rightarrow [(139), (140),(141),(142),(143)]\\ &{}\displaystyle \rightarrow [(133),(134),(135)-(59), (136),(137)-(62)-(59)-(63)]\\ &{}\displaystyle \rightarrow [(149),(150),(151),(152),(153)]\\ &{}\displaystyle \rightarrow [(287),(288),(289),(290),(291)]{,} \end{array} \end{aligned}$$
(161)

requires the extra calculation of \( I_j^{(3,1/2)} \) while

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(5,3/2)}\leftrightarrow &{}\displaystyle (127)\rightarrow [(139),( 140),(141),(142),(143),(144)]\\ &{}\displaystyle \rightarrow [(133),(134),(135)-(59),(136),(137)-(62)-(59)-(63),(138)]\\ &{}\displaystyle \rightarrow [(149),(150),(151),(152),(153),(155)]\\ &{}\displaystyle \rightarrow [(287),(288),(289),(290),(291),(292)]{,} \end{array} \end{aligned}$$
(162)

needs to evaluate the additional integral \( I_j^{(4,1/2)} \).

To sum up, the computation of the integrals \( \mathcal {R}_{F_i}^{(m,3/2)} \), \( m=1,\ldots ,5 \), requires the computation of the six integral \( I_j^{[0,1(1/2)]} \), \( I_j^{(m,1/2)} \), \( m=0,\ldots ,4 \). It has been anticipated that they can become singular when \( d_i=0 \), i.e., the observation point P belongs to the face \( F_i \), or the projection of P over the face, i.e., when \( d_i\ne 0 \), is such that \( {\varvec{\rho }}_j=\textbf{o}\), \( {\varvec{\rho }}_{j+1}=\textbf{o}\) or belongs to the segment [\({\varvec{\rho }}_j\)\({\varvec{\rho }}_{j+1}\)].

Let us first show that, independently from the value of \( d_i \), the integral \(\mathcal {R}_{\varOmega }^{(1,3/2)}\) is always well-defined. Actually, on account of (157), (111) and (112) it turns out to be

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{\varOmega }^{(1,3/2)}&\displaystyle = \sum _{i=1}^{N_F} \ d_i \biggl [d_i\textbf{n}_i\,\textrm{P}_{F_i}^{(0,3/2)}+ \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\biggr ]. \end{array} \end{aligned}$$
(163)

Hence, one has to prove both \(\textrm{P}_{F_i}^{(0,3/2)}\) and \(\textrm{P}_{F_i}^{(1,3/2)}\) are well-defined. Equivalently, according to (139) and(140), it has to be proved that \(\textrm{P}_{\partial F_i}^{[1\cdot , 1(1/2)]}\) and \(\textrm{P}_{\partial F_i}^{[0,1/2]} \) are non-singular. To this end it is convenient to invoke formulas (139) and(140) to express (163) as follows

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{\varOmega }^{(1,3/2)}&{}= \displaystyle \sum _{i=1}^{N_F} \ d_i \biggl [d_i\textbf{n}_i\,\left( \frac{\alpha _i}{|d_i|}-\textrm{P}_{\partial F_i}^{[1\cdot , 1(1/2)]}\right) - \textbf{T}_{F_i}\textrm{P}_{\partial F_i}^{[0, 1/2]}\biggr ]\\ &{}= \displaystyle \sum _{i=1}^{N_F} \ d_i \left\{ \textbf{n}_i \left[ sgn(d_i)\,\alpha _i-d_i \sum _{j=1}^{N_{E_i}}\big ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \big ) I_j^{[0,1(1/2)]} \right] - \textbf{T}_{F_i} I_j^{(0,1/2)}\,\varDelta {\varvec{\rho }}_{j}^\perp \right\} , \end{array} \end{aligned}$$
(164)

where sgn denotes the signum function and the last equality follows from (149) and(150).

To ascertain the well-posedness of the integral \( I_j^{[0,1(1/2)]} \) if \( d_i\ne 0 \) we proceed as follows. Such an integral can be computed, on the basis of the formula (287) and invoking formula (55), by defining

$$\begin{aligned} \displaystyle A_j=-\frac{\varDelta _j}{p_j^2}=\frac{p_ju_j-q_j^2}{p_j^2}\qquad B_j=\frac{p_jv_j-q_j^2}{p_j^2}=A_j + \frac{d_i^2}{p_j} = A_j + \frac{d_i^2}{l_j^2}, \end{aligned}$$
(165)

and setting \( t=\lambda _j+\frac{q_j}{p_j} \). Hence, one obtains

$$\begin{aligned} \begin{array}{rl} \displaystyle I_j^{[0,1(1/2)]}&=\displaystyle \int \limits _{q_j/p_j}^{1+q_j/p_j} \frac{d\,t}{\bigl (t^2 + A_j\bigr )\sqrt{t^2 + B_j}}. \end{array} \end{aligned}$$
(166)

Notice that the denominator in (166) is positive if \(-\varDelta _j=A_j>0\). Accordingly, the previous integral becomes

$$\begin{aligned} \begin{array}{rl} \displaystyle I_j^{[0,1(1/2)]}&{}=\displaystyle \frac{1}{\sqrt{A_j} \sqrt{B_j-A_j} } \left[ \arctan \frac{t\,\sqrt{B_j- A_j}}{\sqrt{A_j} \sqrt{B_j+t^2}}\right] _{q_j/p_j}^{1+q_j/p_j}\\ &{}\displaystyle =\displaystyle \frac{l_j}{|d_i| \sqrt{-\varDelta _j}}\left[ \arctan \frac{|d_i|\,t}{|l_j| \sqrt{-\varDelta _j} \sqrt{B_j+t^2}}\right] _{q_j/p_j}^{1+q_j/p_j}. \end{array} \end{aligned}$$
(167)

Being \( B_j>0 \) the previous expression can become indefinite whenever \( \varDelta _j=0 \) or, equivalently, when \( A_j=0 \) in (167) since the integrand becomes singular at one point belonging to the interval \(\left[ \frac{q_j}{p_j},1+\frac{q_j}{p_j} \right] \). In turn, this happens at the left (right) extreme of the integration interval if \( {\varvec{\rho }}_j=\textbf{o}\) ( \( {\varvec{\rho }}_{j+1}=\textbf{o}\)) or at an internal point if \( \textbf{o}\in ]{\varvec{\rho }}_j,{\varvec{\rho }}_{j+1}[ \), i.e., \( {\varvec{\rho }}_j \) and \( \varDelta {\varvec{\rho }}_j \) have negative scalar product.

Actually if \({\varvec{\rho }}_j=\textbf{o}\) \(\Big ({\varvec{\rho }}_{j+1}=\textbf{o}\Big )\), it turns out to be \(\frac{q_j}{p_j}=0\) \(\Big (1+\frac{q_j}{p_j} =0\Big )\); hence the denominator in (166) becomes singular at the left (right) extreme of the integration interval. Furthermore, should the projection of the observation point belong to the segment \([{\varvec{\rho }}_j,\;{\varvec{\rho }}_{j+1}]\), one has \({\varvec{\rho }}_{j+1}=\beta _j{\varvec{\rho }}_j\) \((\beta _j< 0)\) where \(\frac{q_j}{p_j}=(\beta _j-1)\frac{{\varvec{\rho }}_j\cdot {\varvec{\rho }}_j}{p_j}<0\) and \(1+\frac{q_j}{p_j}=\beta _j(\beta _j-1)\frac{{\varvec{\rho }}_j\cdot {\varvec{\rho }}_j}{p_j}>0\). Accordingly, the integration interval in (166) splits in two intervals having 0 as right (left) extreme. At that point, however, \(t=0\) and \(A_j =\frac{ -\varDelta _j}{p_j^2}=0\) by assumption so that the integrand in (166) becomes singular.

However, we are going to prove that, in the previous three cases, the singularity is eliminable and that the integral attains a finite value. Let us discuss separately the three cases, namely \({\varvec{\rho }}_j=\textbf{o}\), \({\varvec{\rho }}_{j+1}=\textbf{o}\) and \({\varvec{\rho }}_{j+1}=\beta _j\,{\varvec{\rho }}_j\;\;(\beta _j<0)\).

In the first case, \({\varvec{\rho }}_j=\textbf{o}\), the integration interval is \([0,\;1]\) and we have singularity of the integrand in (166) at the left extreme. However, we recall that the computation of \( I_j^{[0,1(1/2)]} \) is required in the expression (149) of \( \textrm{P}_{\partial F_i}^{[1\cdot , 1(1/2)]} \) so that they real quantity to compute is \(({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^{\bot })\, I_j^{[0,1(1/2)]} \).

Setting \({\varvec{\rho }}_j=|{\varvec{\rho }}_j|\textbf{e}=\varepsilon \,\textbf{e}\) and observing that, on account of (73),

$$\begin{aligned} -\varDelta _j= \Big ({\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}\Big )|{\varvec{\rho }}_j|^2-\Big (|{\varvec{\rho }}_j|\textbf{e}\cdot {\varvec{\rho }}_{j+1}\Big )^2=\varepsilon ^2\Big [{\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}-\Big (\textbf{e}\cdot {\varvec{\rho }}_{j+1}\Big )^2\Big ], \nonumber \\ \end{aligned}$$
(168)

we infer that \(\sqrt{-\varDelta _j}\) is infinitesimal of the same order as \(\varepsilon =|{\varvec{\rho }}_j|\) when \(\varepsilon \rightarrow 0\), a property we state by writing \(\sqrt{-\varDelta _j}=\mathcal {O}(\varepsilon )\).

Being \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp =\mathcal {O}(\varepsilon )\) if \(\varepsilon \rightarrow 0\). one has

$$\begin{aligned} \begin{array}{rl} \displaystyle ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^{\bot })\, I_j^{[0,1(1/2)]} &{}=\displaystyle \lim \limits _{\varepsilon \rightarrow 0} \varepsilon \left[ \frac{l_j}{|d_i| \sqrt{-\varDelta _j(\varepsilon )}} \arctan \frac{|d_i|\,t}{l_j \sqrt{-\varDelta _j(\varepsilon )} \sqrt{B_j+t^2}}\right] _{\varepsilon }^{1}\\ &{}\displaystyle = \frac{l_j}{|d_i|} \left[ \frac{\pi }{2}-\frac{\pi }{4}\right] = \frac{l_j}{|d_i|} \frac{\pi }{4}\,{,} \end{array} \end{aligned}$$
(169)

where \( l_j \) = \(\sqrt{\varDelta \rho _j\cdot \varDelta \rho _j }\).

If \( {\varvec{\rho }}_{j+1}=\textbf{o}\) the quantity \(({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^{\bot })\, I_j^{[0,1(1/2)]} \) is still given by the previous expression but the integration limits are \( -1 \) and \( \varepsilon \). Hence, the final result coincides with the previous one but with the reversed sign.

Should the projection of the observation point be internal to the edge, \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) are parallel so that the product \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \) is zero. Accordingly, both \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \) and \(\sqrt{-\varDelta _j}\) are \(\mathcal {O}(\varepsilon )\), that is both of them are infinitesimal of order \(\varepsilon \) as \(\varepsilon \rightarrow 0\). Hence

$$\begin{aligned} \begin{array}{rl} \displaystyle ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^{\bot })\, I_j^{[0,1(1/2)]}=&{}\displaystyle \frac{l_j}{|d_i|}\lim \limits _{\varepsilon \rightarrow 0} \frac{\varepsilon }{\sqrt{-\varDelta _j(\varepsilon )}} \\ &{}\displaystyle \left\{ \left[ \arctan \frac{|d_i|\,t}{l_j \sqrt{-\varDelta _j(\varepsilon )} \sqrt{B_j+t^2}}\right] _{-1}^{\varepsilon }\right. \\ &{}\left. +\left[ \arctan \frac{|d_i|\,t}{l_j \sqrt{-\varDelta _j(\varepsilon )} \sqrt{B_j+t^2}}\right] _{\varepsilon }^{1}\right\} =0\,{.} \end{array} \end{aligned}$$
(170)

Actually, the arctan function attains finite and opposite values both at \(t=\varepsilon \) and \(t=\pm 1 \).

On account of the previous results we can conclude that the first two terms in (164) are zero if \( d_i =0 \) so that their computation can be skipped in this case.

For what concerns, the integral \(I_j^{(0,1/2)}\) in (164) we notice that, according to (288), its evaluation requires that of the quantity \( LN_j \) in (279) since \( p_j\) is always positive on the basis of its definition in (55). However, the equivalent expression of \( LN_j \) provided in (79) shows that it is always well-defined if \( d_i\ne 0\).

Conversely, if the projection of the point P over the face is such that if \( {\varvec{\rho }}_j=\textbf{o}\) or \( {\varvec{\rho }}_{j+1}=\textbf{o}\) or it belong to \(] {\varvec{\rho }}_j,{\varvec{\rho }}_{j+1} [\), \(LN_j\) tends to infinity with an arbitrary low degree. Since \(I_j^{(0,1/2)}\) is multiplied by \( d_i \) in (164), a quantity that has been assumed to be zero, we ultimately infer that \(\mathcal {R}_{\varOmega }^{(1,3/2)}\) is zero if \( d_i =0 \) so that its computation can be actually avoided.

In conclusion, the integral \(\mathcal {R}_{\varOmega }^{(1,3/2)}\) is well-defined if \( d_i \ne 0 \) and its computation can be avoided if \( d_i =0 \) since the relevant value is null.

Let us now prove that the integral \(\mathcal {R}_{\varOmega }^{(2,3/2)}\) is well-defined independently from the value of \(d_i\). Recalling (157), (111) and (114) one has

$$\begin{aligned} \mathcal {R}_{\varOmega }^{(2,3/2)}= & {} \frac{1}{2} \sum _{i=1}^{N_F} \ d_i\left\{ d_i^2\textbf{n}_i\otimes \textbf{n}_i\textrm{P}_{F_i}^{(0,3/2)}+d_i\biggl [\textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\otimes \textbf{n}_i+\textbf{n}_i\otimes \textbf{T}_{F_i}\textrm{P}_{F_i}^{(1,3/2)}\biggr ]\right. \nonumber \\{} & {} \left. +\mathbb {T}_{F_i}^{(2)} \textrm{P}_{F_i}^{(2,3/2)}\right\} . \end{aligned}$$
(171)

We have already proved, with reference to \(\mathcal {R}_{\varOmega }^{(1,3/2)}\), that \(\textrm{P}_{F_i}^{(0,3/2)}\) and \(\textrm{P}_{F_i}^{(1,3/2)}\) are well-defined whatever is the value of \(d_i\). Hence, \(\mathcal {R}_{\varOmega }^{(2,3/2)}\) is singularity-free provided that \(\textrm{P}_{F_i}^{(2,3/2)}\) does share this property whatever is the value of \(d_i\).

To this end we invoke formula (141), (151) and (59) to write

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{F_i}^{(2,3/2)}&{}\displaystyle =-\textrm{P}_{\partial F_i}^{(1\otimes , 1/2)}+\mathcal {I}^{(2)}\Bigl [\textrm{P}_{\partial F_i}^{[(1/2)1\cdot ,1]}-\alpha _i |d_i|\Bigr ]\\ &{}\displaystyle = -\sum _{j=1}^{N_{E_j}} \Biggl [I_j^{(0,1/2)}{\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp }+I_j^{(1,1/2)}\varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^{\perp }+\mathcal {I}^{(2)} \bigl ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^{\perp }\bigr ) I_j^{(1/2\cdot 0,1)}\Biggr ]\\ &{}\quad -\alpha _i |d_i|\mathcal {I}^{(2)}. \end{array} \nonumber \\ \end{aligned}$$
(172)

According to (289) the integral \(I_j^{(1,1/2)}\) is the sum of the algebraic quantity \((\sqrt{p_j+2q_j +v_j}-\sqrt{v_j})/p_j\), that is always well-defined independently from \(d_i\), and the projection of the observation point P over the face, and of the quantity \(q_j\,I_j^{(0,1/2)}/p_j\) where \(I_j^{0,1/2)}\) depends on \(LN_j\) on account of (288).

However both \(I_j^{(0,1/2)}\) and \(I_j^{(1,1/2)}\), being addends of \(\textrm{P}_{F_i}^{(2,3/2)}\), are multiplied by \(d_i\) in (171) so that their expressions are well-defined, whatever is the value of \(d_i\), as already shown for the product \(d_i\,LN_j\) with reference to the integral \(\mathcal {R}_{\varOmega }^{(1,3/2)}\).

For what concerns the integral \(I_j^{(1/2\cdot 0,1)}\) in (172) we infer from formula (282) that it can be expressed as

$$\begin{aligned} \displaystyle I_j^{(1/2\cdot 0,1)}= d_i^2\,I_j^{[0,1(1/2)]}+\frac{1}{\sqrt{p_j}} LN_j. \end{aligned}$$
(173)

Being this integral multiplied by \(\bigl ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^{\perp }\bigr )\) in (172) the first addends is well-defined, whatever is the value of \(d_i\), as already proved in (169) and (170).

Hence, in the special case \(d_i=0\), the integral \( I_j^{[0,1(1/2)]} \) does not even need to be computed since \(\textrm{P}_{F_i}^{(2,3/2)}\) in which \( I_j^{[0,1(1/2)]} \) does appear, is scaled by \(d_i\) in (171). The same does occur for the additional terms \(LN_j\) in (173) since it has to be multiplied by \(d_i\) in (171) producing a quantity that is well-defined if \(d_i\ne 0\) and equal to zero if \(d_i=0\). Actually, in this last case, \(d_i\) tends to zero while \(LN_j\) can tend to infinity but with are infinitesimally low rate.

It is worth noting at this stage that proving the well-posedness of \(\mathcal {R}_{\varOmega }^{(2,3/2)}\) has only required to prove the well-posedness of the integral of \(\textrm{P}_{F_i}^{(2,3/2)}\) since the additional terms entering the expression of \(\mathcal {R}_{\varOmega }^{(2,3/2)}\) are also included in the expression of \(\mathcal {R}_{\varOmega }^{(1,3/2)}\), i.e., the first integral that has been proved to be singularity-free. On the other hand this is apparent if one compares formulas (164) and (171) that are based, according (157), on formulas (112) and (114).

Hence, comparing formulas (114) and (115), this means \(\mathcal {R}_{\varOmega }^{(3,3/2)}\) is well defined if and only if \(\textrm{P}_{F_i}^{(3,3/2)}\) is singularity-free. This is certainly true since this integral, according to (142), depends upon the integrals \(\textrm{P}_{\partial F_i}^{[2\otimes ,1/2]}\) and \(\textrm{P}_{\partial F_i}^{[(1/2)0]}\). Formulas (152), refereed to the former integral, shows that one needs to compute the integrals \(I_j^{(0,1/2)}\), \(I_j^{(1,1/2)}\) and \(I_j^{(2,1/2)}\); furthermore, one infers from (60) that the integral \(I_j^{(1/2\cdot 0)}\) is required for \(\textrm{P}_{\partial F_i}^{[(1/2)0]}\). In turn formulas (288), (289) and (290) for the first three integrals, and formula (283) for the fourth one show that, apart from algebraic quantities that are always well-defined, they all depend upon the quantity \(LN_j\). However, this quantity is multiplied by \(d_i\), according to (157); hence, the product \(d_i\,LN_j\), as a previously shown, is well-defined and null if \(d_i=0\).

Basically, the same path of reasoning can be followed for \(\mathcal {R}_{\varOmega }^{(4,3/2)}\) and \(\mathcal {R}_{\varOmega }^{(5,3/2)}\) whose well-posedness depends upon the fact that \(\textrm{P}_{F_i}^{(4,3/2)}\) and \(\textrm{P}_{F_i}^{(5,3/2)}\) are singularity-free, see, e.g., formulas (110), (116) and (127).

Actually, according to formula (143), \( \textrm{P}_{F_i}^{(4,3/2)}\) depends upon \( \textrm{P}_{\partial F_i}^{[3\otimes ,\,1/2]} \), \(\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}\) and \(\textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}\). In turn the first integral depends, according to (153), upon \(I_j^{(0,1/2)}\), \(I_j^{(1,1/2)}\), \(I_j^{(2,1/2)}\) and \(I_j^{(3,1/2)}\) defined, respectively, in formulas (288), (289), (290) and (291). All of them depend upon algebraic quantities, these are non-singular whatever is the position of the observation point P with respect to the target body, and the quantity \(LN_j\). Since this quantity is multiplied by \(d_i\), see, e.g., formula (110), we conclude from the well-posedness of the quantity \(d_i\,LN_j\), an issue repeatedly addressed above, that the addend of \( \mathcal {R}_{\varOmega }^{(4,3/2)} \) related to the integral \( \textrm{P}_{\partial F_i}^{[3\otimes ,\,1/2]} \) is singularity-free and null if \(d_i=0\).

On account of (62) the integral \( \textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]} \) depends upon the integrals \(I_j^{(1/2\cdot 0)}\) and \(I_j^{(1/2\cdot 1)}\) whose expressions are provided, respectively, in formula (283) and (284). As before they are sum of algebraic quantities and an additional term depending upon \(LN_j\). Hence the considerations just discussed for \( \textrm{P}_{\partial F_i}^{[3\otimes , 1/2]} \) do apply to \(\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}\).

Finally, formula (45)\(_1\) shows that \(\textrm{P}_{\partial F_i}^{0 \, \mathcal {I}}\) depends upon the integrals \(\textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot ]}\) and \(\textrm{P}_{\partial F_i}^{[(1/2)\,1\cdot , 1]}\). The well-posedness of the latter has been already discussed in (172) while that of the former depends, according to formula (63), upon \(I_j^{(1/2\cdot 0)}\) that is one of the integrals considered with reference to \(\textrm{P}_{\partial F_i}^{[(1/2)\,1\otimes ]}\).

This proves that the integral \(\mathcal {R}_{\varOmega }^{(4,3/2)}\) is non-singular whatever is the position of the observation point with respect to the target body and null if \(d_i=0\).

Basically, the same path of reasoning can be followed for \(\mathcal {R}_{\varOmega }^{(5,3/2)}\) so that we limit ourselves to report just the sequence of formulas and/or integrals that the interested reader has to consult in order to check the well-posedness of \( \textrm{P}_{F_i}^{(5,3/2)} \), that is the only additional term to be considered with respect to terms \(\textrm{P}_{F_i}^{(m,3/2)}\), m=1, 2, 3, 4.

$$\begin{aligned} \begin{array}{rl} \displaystyle \mathcal {R}_{F_i}^{(5,3/2)}\rightarrow&\displaystyle (144)\rightarrow \textrm{P}_{\partial F_i}^{[4\otimes ,\,1/2]},\,\textrm{P}_{\partial F_i}^{(5,\,3/2,A)},\,\textrm{P}_{\partial F_i}^{(5,\,3/2,B)},\,\textrm{P}_{\partial F_i}^{(5,\,3/2,C)},\,\textrm{P}_{\partial F_i}^{(5,\,3/2,D)}, \end{array} \end{aligned}$$
(174)

where

$$\begin{aligned} \begin{array}{rl} \displaystyle \textrm{P}_{\partial F_i}^{[4\otimes ,\,1/2]}\rightarrow&\displaystyle (155)\rightarrow I_j^{(m,1/2)}\quad m=0,..., 4. \end{array} \end{aligned}$$
(175)

while the integrals \(\textrm{P}_{\partial F_i}^{(5,\,3/2,A)}\), \(\textrm{P}_{\partial F_i}^{(5,\,3/2,B)}\), \(\textrm{P}_{\partial F_i}^{(5,\,3/2,C)}\) and \(\textrm{P}_{\partial F_i}^{(5,\,3/2,D)}\) depend upon \( \textrm{P}_{\partial F_i}^{[(1/2)\,2\otimes ]} \) and \(\textrm{P}_{\partial F_i}^{1 \, \mathcal {I}}\), see, e.g., formulas (145148).

In turn

$$\begin{aligned}{} & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,2\otimes ]}\rightarrow \displaystyle (68)\rightarrow I_j^{(1/2\cdot 0)},\,I_j^{(1/2\cdot 1)},\,I_j^{(1/2\cdot 2)}, \end{aligned}$$
(176)
$$\begin{aligned}{} & {} \displaystyle \textrm{P}_{\partial F_i}^{1 \, \mathcal {I}}\rightarrow \displaystyle (45)_2 \rightarrow \textrm{P}_{\partial F_i}^{[(1/2)\,2\cdot ]},\,\textrm{P}_{\partial F_i}^{[(1/2)\,0]}, \end{aligned}$$
(177)
$$\begin{aligned}{} & {} \displaystyle \textrm{P}_{\partial F_i}^{[(1/2)\,2\cdot ]}\rightarrow \displaystyle (69)\rightarrow I_j^{(1/2\cdot 0)},\,I_j^{(1/2\cdot 1)},\,I_j^{(1/2\cdot 2)}. \end{aligned}$$
(178)

Hence, looking at Appendix C, it is easy to check that all the previous integrals are composed of an algebraic quantity and an additional one depending upon \(LN_j\). The former is always well-defined while the latter, being multiplied by \(d_i\), is non-singular and equal to zero if \(d_i=0\) as previously proved in this section.

In conclusion we can state that all integrals appearing in the expression of the gravity vector are well-defined whatever is the position of the observation point with respect to the polyhedral body.

5 Algebraic Expression of the Integrals Related to the GP and GV in Terms of 3D Vectors

It is useful at this stage to sum up the different steps carried out evaluate the gravitational potential \( U(\textbf{p}) \) by means of the expressions (5) and the gravity vector by means of (84).

Basically, we have shown that this amounts to computing the tensors \(\mathcal {R}_{\varOmega }^{(m,1/2)}\) in formula (8) and the tensors \(\mathcal {R}_{\varOmega }^{(m,3/2)}\) in formula (85). In turn, exploiting formula (25), tensors \(\mathcal {R}_{\varOmega }^{(m,1/2)}\) have been expressed as a sum of tensors \(\mathcal {R}_{\partial \varOmega }^{(m,1/2)}\) associated with the \( N_F \) faces \( F_i \) composing the polyhedral body \(\varOmega \). The same procedure has been exploited in formula (107) by replacing the volume integral \(\mathcal {R}_{\varOmega }^{(m,3/2)}\) with the boundary integral \(\mathcal {R}_{\partial \varOmega }^{(m,3/2)}\).

The target \(\varOmega \) being polyhedral, both \(\mathcal {R}_{\partial \varOmega }^{(m,1/2)}\) and \(\mathcal {R}_{\partial \varOmega }^{(m,3/2)}\) have been expressed as a sum of 2D integrals defined on the faces \( F_i \) of \( \partial \varOmega \), in formula (27) and (85), respectively, introducing the 3D tensors \(\mathcal {R}_{F_i}^{(m,1/2)}\) and \(\mathcal {R}_{F_i}^{(m,3/2)}\). In turn, the computation of these tensors is based on that of the two-dimensional tensors \(\textrm{P}_{F_i}^{(m,1/2)}\) defined in (33), and that of the tensors \(\textrm{P}_{F_i}^{(m,3/2)}\) defined in (113). Accordingly, both of them have to be mapped back to the 3D space in order to provide the correct expression of \(\mathcal {R}_{\varOmega }^{(m,1/2)}\) and \(\mathcal {R}_{\varOmega }^{(m,3/2)}\). This is trivial for \( m=0, 1, 2 \), see, e.g., formulas (32) and (114), while it is more cumbersome for \( m=3, 4 \) since the tensors \(\textrm{P}_{F_i}^{(m,1/2)}\) and \(\textrm{P}_{F_i}^{(m,3/2)}\) of rank three and four have to be combined with the formal operator \( \mathbb {T}\) to evaluate, e.g.,

$$\begin{aligned} \mathbb {T}_{F_i}^{(3)} \textrm{P}_{F_i}^{(3,1/2)} \quad \text {and}\quad \mathbb {T}_{F_i}^{(4)} \textrm{P}_{F_i}^{(4,1/2)} \end{aligned}$$
(179)

in formulas (36) and (37), respectively.

On account of (50) and (51), and related algebraic counterparts (272) and (277), we need to apply \( \mathbb {T}_{F_i}^{(3)} \) and \( \mathbb {T}_{F_i}^{(4)} \) to tensors such as \(\varvec{\alpha }\otimes \varvec{\beta }\otimes \varvec{\gamma }\), \(\varvec{\alpha }\otimes \varvec{\beta }\otimes \varvec{\gamma }\otimes \varvec{\delta }\) or tensor product of \( \mathcal {I}^{(2)} \) by \(\varvec{\alpha }\) or \(\varvec{\alpha }\otimes \varvec{\beta }\), where the two-dimensional vectors \(\varvec{\alpha }\), \(\varvec{\beta }\), \(\varvec{\gamma }\) and \(\varvec{\delta }\) stand for \( {\varvec{\rho }}_j \), \( \varDelta {\varvec{\rho }}_j \) or \( \varDelta {\varvec{\rho }}_j^{\perp } \).

To fix the ideas, let us set \(\varvec{\alpha }={\varvec{\rho }}_j\), \(\varvec{\beta }=\varDelta {\varvec{\rho }}_j\), \(\varvec{\gamma }=\varDelta {\varvec{\rho }}_j^{\perp }\). Hence

$$\begin{aligned} \mathbb {T}_{F_i}^{(3)} \varvec{\alpha }\otimes \varvec{\beta }\otimes \varvec{\gamma }=\textbf{T}_{F_i}{\varvec{\rho }}_j \otimes \textbf{T}_{F_i}\varDelta {\varvec{\rho }}_j\otimes \textbf{T}_{F_i}\varDelta {\varvec{\rho }}_j^{\perp }{,} \end{aligned}$$
(180)

an expression that can be further simplified. Actually, inverting (28), we can express the 2D coordinates of each vertex as function of the relevant 3D ones. In particular, premultiplying relation (28) by \(\textbf{T}_{F_i}^T\), where \((\cdot )^T\) stands for transpose, one obtains

$$\begin{aligned} \begin{array}{rl} \displaystyle {\varvec{\rho }}_j = \textbf{T}_{F_i}^T (\textbf{r}_j - d_i \textbf{n}_i) {,} \end{array} \end{aligned}$$
(181)

since it is easy to check that \(\textbf{T}_{F_i}^T\textbf{T}_{F_i}=\mathcal {I}^{(2)}\). Analogously

$$\begin{aligned} \varDelta {\varvec{\rho }}_j=\textbf{T}_{F_i}^T({\varvec{\rho }}_{j+1}-{\varvec{\rho }}_j)=\textbf{T}_{F_i}^T(\textbf{r}_{j+1}-\textbf{r}_i)=\textbf{T}_{F_i}^T\varDelta \textbf{r}_j \qquad \text {and} \qquad \varDelta {\varvec{\rho }}_j^\perp =\Big [\textbf{T}_{F_i}^T\,\varDelta \textbf{r}_j\Big ]^\perp . \nonumber \\ \end{aligned}$$
(182)

Accordingly, setting \( \textbf{T}_{F_i}\textbf{T}_{F_i}^T=\textbf{Z}_{F_i} \), where \( [\textbf{Z}_{F_i}] \) is a 3x3 matrix, we have

$$\begin{aligned} \textbf{T}_{F_i}{\varvec{\rho }}_j\otimes \textbf{T}_{F_i}\varDelta {\varvec{\rho }}_j\otimes \textbf{T}_{F_i}\varDelta {\varvec{\rho }}_j^{\perp }=\bigl [\textbf{Z}_{F_i}\bigl (\textbf{r}_j-d_i\textbf{n}_i\bigr )\bigr ]\otimes \bigl [\textbf{Z}_{F_i}\varDelta \textbf{r}_j\bigr ]\otimes \bigl [\textbf{T}_{F_i}\bigl (\textbf{T}_{F_i}^T\varDelta \textbf{r}_j\bigr )^\perp \bigr ]{.}\nonumber \\ \end{aligned}$$
(183)

In other words, during the evaluation of the different quantities contributing to (50) and (51), we can directly make reference to three-dimensional expressions.

For what concerns the tensor product of \( \mathcal {I}^{(2)} \) by \(\varvec{\alpha }\) or \(\varvec{\alpha }\otimes \varvec{\beta }\) we observe that \(\mathcal {I}^{(2)}={\textbf {e}}_{1}\otimes {\textbf {e}}_{2}+{\textbf {e}}_{2}\otimes {\textbf {e}}_{1}\) where \( {\textbf {e}}_{1}=(1,0)\) and \({\textbf {e}}_{2}=(0,1)\). Hence

$$\begin{aligned} \mathbb {T}_{F_i}^{(2)}\mathcal {I}^{(2)} =\textbf{T}_{F_i} ({\textbf {e}}_{1}\otimes {\textbf {e}}_{2}+{\textbf {e}}_{2}\otimes {\textbf {e}}_{1})\textbf{T}^T_{F_i}=\textbf{u}_i\otimes \textbf{u}_i+\textbf{v}_i\otimes \textbf{v}_i{,} \end{aligned}$$
(184)

where \( \textbf{u}_i \) and \( \textbf{v}_i \) are the vectors used to define the 2D reference frame on the generic face \( F_i \), see, e.g., (29).

In conclusion, setting again \(\varvec{\alpha }={\varvec{\rho }}_j\), \(\varvec{\beta }=\varDelta {\varvec{\rho }}_j\), \(\varvec{\gamma }=\varDelta {\varvec{\rho }}_j^{\perp }\) to fix the ideas, one has

$$\begin{aligned} \mathbb {T}_{F_i}^{(3)}\biggl (\mathcal {I}^{(2)}\otimes \varvec{\alpha }\biggr ) =\mathbb {T}_{F_i}^{(3)}\Biggl [\mathcal {I}^{(2)}\otimes {\varvec{\rho }}_j\Biggr ]=(\textbf{u}_i\otimes \textbf{u}_i+\textbf{v}_i\otimes \textbf{v}_i)\otimes \textbf{Z}_{F_i}(\textbf{r}_j-d_i \textbf{n}_i){,} \end{aligned}$$
(185)

and

$$\begin{aligned} \mathbb {T}_{F_i}^{(4)}\biggl (\varvec{\beta }\otimes \varvec{\gamma }\otimes \mathcal {I}^{(2)}\biggr )= & {} \mathbb {T}_{F_i}^{(4)}\Biggl [\varDelta {\varvec{\rho }}_j\otimes \varDelta {\varvec{\rho }}_j^\perp \otimes \mathcal {I}^{(2)}\Biggr ]\nonumber \\= & {} \textbf{Z}_{F_i}\varDelta \textbf{r}_j\otimes \Biggl [\textbf{T}_{F_i}\big (\textbf{T}_{F_i}^T\varDelta \textbf{r}_j\big )^T\Biggr ]\otimes (\textbf{u}_i\otimes \textbf{u}_i+\textbf{v}_i\otimes \textbf{v}_i){.}\nonumber \\ \end{aligned}$$
(186)

The transformation of additional tensor product such as \(\otimes _{132}\), \(\otimes _{1423}\) etc. can be addressed in a similar way.

6 Numerical Examples

This section illustrates the results of several numerical tests that have been carried out in order to fully validate the proposed formulation. This has been done by considering three different issues that are dealt with in separate subsections.

The first one is concerned with a comparison of the results of the current approach with those previously contributed by different authors, with a special emphasis on the results regarding the case of an observation points leading to removable singularity.

The second issue addressed in this section draws the reader’s attention on the usage limitations of the proposed formulas imposed by numerical instability. In this respect three different aspects are specifically dealt with, namely i) the separation between the origin of the reference frame and the observation point; ii) the separation between this last one and the target body; iii) the numerical effects associated with a finer subdivision of a polyhedral body.

Finally, a stress test is carried out by comparing the results presented in the first subsection with those obtained by considering arbitrary reference frame whose axes are not necessarily aligned with the edges of the polyhedral bodies considered in the examples retrieved from the literature.

In all examples, the test platform is a personal computer with 2.7GHz Intel core i7 CPU and 16GB RAM; version R2022b has been used for the MATLAB software.

Fig. 2
figure 2

García-Abdeslem (2005) prism model (a). A triangular prism model (b) is constructed from García-Abdeslem (2005) prism model by omitting the two vertices whose coordinates satisfy \(x=y=20\). The coordinate units are measured in km

6.1 Comparison of Results Between the Current Approach and Those Available in the Literature

The singularity-free analytical formulas developed in the previous sections have been validated by comparing the results obtained by a home-made MATLAB code with those refereed to a classical example reported in the literature, i.e., the García-Abdeslem (2005) prism model, and to a triangular prism model, obtained by halving the latter, considered in Ren et al. (2017) they are shown in Fig. 2a, b, respectively.

Two different cases of polynomial density functions have been considered for the model in Fig. 2a, namely a third-order vertically varying density contrast and a purely quartic density function. To address more severe test cases, a density contrast varying in both vertical and horizontal directions has been assumed for the more complicated geometry represented by the triangular prism in Fig. 2b.

We emphasize that the Cartesian reference frame can be arbitrary in the sense that it does not necessarily coincide with the observation point since its actual position is explicitly taken into account in the formulas presented in the paper. Hence, there is no need to make the origin of the reference frame coincide with the observation point and thus no need to assume different reference frames as the observation point changes.

6.1.1 A Prismatic Body with Vertically Varying Density Contrast

Let us consider the prism in Fig. 2a whose dimensions range as follows: x \(\in \) [10 km, 20 km], y \(\in \) [10 km, 20 km], z \(\in \) [0 km, 8 km]. The density contrast is taken from García-Abdeslem (2005) and reads

$$\begin{aligned} \delta (\textbf{s})= -747.7 + 203.435z - 26.764 z^2 + 1.4247 z^3{,} \end{aligned}$$
(187)

where density is expressed in kg m\( ^{-3} \) and z in km; the value of the gravitational constant G is \(6,673 \,\cdot 10^{-11} \) m\(^3\) kg\(^{-1}s^{-2}\). Hence, one can set c\( _{000} \) = \(-\)747.7, c\( _{001} \) = 203.435, c\( _{002} \) = - 26.764 and c\( _{003} \) = 1.4247 in (2).

Table 1 Vertical component of the gravity field (mgal) for the prism model in Fig. 2a considering separately the four addressed of the density contrast in (187) and observation points characterized by y = 15 km and z = \(-\)0.15 m
Table 2 Vertical component of the gravity field (mgal) for the prism model in Fig. 2a considering separately the four addressed of the density contrast in (187) and observation points characterized by y = 15 km and z = 0

Three different combinations of the observation point are considered. The first one assumes y = 15 km, z = \(-\)0.15 m, so as to avoid the singularity of the formulas reported in García-Abdeslem (2005), while x assumes three different values in the interval [9.99995, 10.00005].

Table 1 shows the comparison of the vertical gravity field provided by our solution with those by García-Abdeslem (2005) and Ren et al. (2017) in four different cases corresponding to the cases of constant, linear, quadratic and cubic density contrast represented by the four addends in the formula (187).

Table 2 is similar to Table 1 with the only difference that z = 0, meaning that the observation point belongs to the plane containing the upper face of the prism. It is worth noting that both for z = \(-\)0.15 m, Table 1, and z = 0, Table 2, our results do coincide with those reported in the literature when x = 9.99995 km and x = 10 km. Conversely, for x = 10.00005 km, our solution coincides with those due to García-Abdeslem (2005) and Ren et al. (2017) only up to the second/third significant digit, a condition that has been considered worth of further investigation on account of the fact that the coordinates x = 10.00005, y = 15, z = 0 are indicative of an observation point that belongs to the body, thus excluding any sort of singularity.

For this reason we have computed the vertical gravity field at points characterized by slightly increasing values of x, viz. x = 10.0001 and x = 10.00015, in order to check a smooth variation of the field for values of x ranging in the interval [9.99995,10.00015]. This property is apparent for our solution in the last column of Table 2 while there is a sudden change, for x = 10.00005, in the values of the gravity field published in García-Abdeslem (2005) and Ren et al. (2017); in these last papers the results pertaining to the values x = 10.0001 and x = 10.00015 are not available.

Furthermore, we have checked our solution numerically, by evaluating the integrals by the Gauss rule, and compared it with the analytical results in Table 3. Numerical solutions have been obtained by adopting \(5 \times 5 \times 5\) rule in four, eight and twelve subdomains in which the faces parallel to the planes of the reference frame have been divided. This resulted in a total of \(100 \times 100 \times 100\), \(200 \times 200 \times 200\) and \(300 \times 300 \times 300\) Gauss points, respectively; in particular, Fig. 3 displays the faces \(10 \times 10\) and \(8 \times 10\) and the actual distribution of Gauss point corresponding to a partition of each face in four subdomains.

By examining the results in Table 3 it is apparent that, apart from the constant density distribution, the correctness of the numerical results does not necessary improve as the number of Gauss points increases when the observation point does belong to the target body. Actually, as witnessed by a series of further experiments not reported for brevity, the accuracy of the Gauss integration depends on how much integration points lie close to, or distance from, points of the domain of integration in which the field to be computed tends to become singular, see, e.g., the expression (83) of the gravity field.

Fig. 3
figure 3

Layout of Gauss points adopting a \(5 \times 5 \times 5\) integration rule in four subdomains of the cross sections parallel to the xy-zx planes (a) and to the yz plane (b)

In the last numerical test for the prism model in Fig. 2a, similar to that presented in Ren et al. (2017), the observation point coincides with the corner of the prism having coordinates x = 20 km, y = 10 km, z = 0 km, or is slightly above it (z = \(-\)0.15 m). The relevant results are compared in Tables 4 and 5, respectively, with those by García-Abdeslem (2005) and Ren et al. (2017). It is apparent that the agreement of our results with the existing ones is quite good in all cases.

Table 3 Vertical component of the gravity field (mgal) for the prism model in Fig. 2a considering separately the four addends of the density contrast in (187) and the observation point having coordinates [10.00005, 15, 0]: numerical solution by Gauss integration
Table 4 Vertical component of the gravity field (mgal) for the prism model in Fig. 2a at the observation point x = 20 km, y = 10 km, z = 0 m considering separately the four addends of the density contrast in (187)
Table 5 Vertical component of the gravity field (mgal) for the prism model in Fig. 2a at the observation point x = 20 km, y = 10 km, z = \(-\)0.15 m considering separately the four addends of the density contrast in (187)

6.1.2 A Prismatic Body with Quartic Density Contrast

We consider again the prism in Fig. 2a but now endowed with the quartic density contrast

$$\begin{aligned} \delta (\textbf{s})=z^4\, \end{aligned}$$
(188)

already considered in Ren et al. (2017).

Fifteen observation points are considered, all characterized by y = 15 km, z = 0 m as coordinates, and values of x progressively increasing from 0 to 15 km.

The relevant results in terms of vertical gravity are reported in Table 6 and compared with those reported in Table 8 of Ren et al. (2017). The quite good agreement of our results with those contributed by Ren et al. (2017) confirms the correctness of the proposed approach, particularly when the removable singularity comes into play (x= 10).

In accordance with what has been shown in Table 3, there is some evidence that the Gaussian approximation yields higher error than the analytical methods when the observation point is near the target, x \(\in \) [8,15], while the opposite may be true when the observation points are further away, due to increasingly destructive numerical cancellation errors when using analytical formulas. This issue will be specifically addressed in Sect. 5.2.2.

Table 6 Vertical component of the gravity field (mgal) for the prism model in Fig. 2a assuming y = 15 km, z = 0 m and the density contrast in (188)

6.1.3 A Prismatic Body with an Arbitrary Density Contrast

Let us now address the polyhedron in Fig. 2b and the density contrast

$$\begin{aligned} \delta (\textbf{s})=10^4x^2yz\,{,} \end{aligned}$$
(189)

so as to consider a function varying in both the vertical and horizontal direction.

This case is simulated by assuming \( c_{211}=10^4 \) in formula (2) and setting to zero \( \delta _o\) as well as the entries of \( \mathcal {C}^{(1)} \), \( \mathcal {C}^{(2)} \), \( \mathcal {C}^{(3)} \) in formula (4). Three different observation points are considered, namely one at the barycenter of the upper face (P\( _3 \)), one at median point of the edge (P\( _2 \)) and one coincident with the vertex (P\( _1 \)).

The relevant results are reported in Table 7 and compared with those obtained by Gauss integration with a total number of \(72 \times 72 \times 72\) quadrature points and 200x200x200 quadrature points, respectively, referred to the domains obtained by dividing the base of the prism in three irregular quadrilaterals by halving each edge, see, e.g., Fig. 4.

Table 7 Vertical component of the gravity field (m s\( ^{-2} \)) for the prism model in Fig. 2b endowed with the density contrast in (189)

6.2 Usage Limitations Imposed by Numerical Instability

Aim of this subsection is to present the results of some numerical tests aimed at testing the sensitivity of the analytical formulas presented thus for with respect to several effects associated with geometric quantities involved. in the computation of the gravitational potential and gravity vector.

Specifically, with reference to error control under finite length arithmetic, we shall investigate in three separate subsections the consequences of adopting large offsets of the origin from the observation point, of considering large distances of the observation point from the target body and of subdividing a given polyhedron in smaller polyhedra.

Fig. 4
figure 4

Layout of Gauss points adopting a \(5 \times 5 \times 5\) integration rule

Fig. 5
figure 5

Prism model analogous to that of Fig. 2a with: a increasing distances between the origin of the reference frame and the observation point (\(y = 10\) km, \(y = 100\) km, \(y = 1000\) km); b increasing separation between the observation point and the target body (\(x = 10\) km, \(x = 100\) km, \(x = 1000\) km)

6.2.1 Origin-Observation Point Separation

In order to evaluate the effects of large offsets between the origin of the reference frame and the observation point on the accuracy of the formulas derived in the paper we consider the prism in fig. 5a and evaluate the potential and the vertical component of the gravity vector at observation points \(P = [0, y, 0]\) having progressively increasing values of y. Specifically, Table 8 shows the values of the gravitational potential for \(y = \)15 km, \(y =\) 105 km and \(y =\) 1005 km separately for the four contributions of the density contrast. Similar computations have been carried out for the vertical component of the gravity vector and the relevant results are reported in Table 9

Table 8 Gravitational potential (m\( ^2 \)s\( ^{-2} \)) for the prism model in Fig. 5a considering separately the four addends of the density contrast in (187). Observation point [\(x = 0, y, z = 0\)]
Table 9 Vertical component of the gravity field (mgal) for the prism model in Fig. 5a considering separately the four addends of the density contrast in (187). Observation point [\(x = 0, y, z = 0\)]

Inspection of Tables 8 and 9 shows that the results are unaffected by the separation between the origin and the observation point. This is quite reasonable since the computational of the gravity effects depends upon the relative position between the observation point and the target body, an issue that will be further addressed in the following two subsections.

6.2.2 Observation Point—Target Body Separation

In a seminal paper Holstein and Ketteridge (1996) showed that analytical formulas for the gravity anomaly of a uniform polyhedral body are subjected to numerical error that increases with distance from the target. This leads to a limited range of target distances in which the formulas are effective, beyond which the calculations are dominated by rounding error. Clearly, this range is precision dependent in the sense that, if the floating point precision were higher, then the range would increase.

Table 10 Gravitational potential (m\(^2\)s\(^{-2}\)) for the prism model in Fig. 5b considering separately the four addends of the density contrast in (187). Observation point [\(x, y = 15\) km, \(z = 0\)]: Gauss integration with \(200 \times 200 \times 200\) quadrature points vs analytical solutions for \(x = 10\) km, \(x = 100\) km, \(x = 1000\) km

In particular, Holstein and Ketteridge (1996) expressed their estimates on the relative error of the analytical computation by introducing the so-called aspect ratio \( \gamma =\alpha /\delta \) between the typical linear dimension \(\alpha \) of the target body and the typical distance \(\delta \) of the target from the observation point. In particular, defining the dimensionless target distance \(\varGamma =1/\gamma \), they proved that, for the constant density case, analytical formulas for the potential expressed in terms of line integrals leads to terms that are \(\mathcal {O}(\delta ^3/\alpha ^3)=\mathcal {O}(\varGamma ^3)\) larger than the result. Hence, differently from a Gaussian integration in which no numerical cancellation does occur, if \(\delta>>\alpha \) destructive cancellation will take place and the relative error of the analytical computation will grow with \(\varGamma \).

Table 11 Vertical component of the gravity field (mgal) for the prism model in Fig. 5b considering separately the four addends of the density contrast in (187) Observation point [\(x, y = 15\) km, \(z = 0\)]: Gauss integration with 200x200x200 quadrature points vs analytical solutions for \(x = 10\) km, \(x = 100\) km, \(x = 1000\) km

For polyhedral bodies having a spatially linear density (Pohanka 1998) and (Hansen 1999) noted that the analytical formulas for the gravitational field at increasing target distances produced results characterized by larger numerical errors than those associated with the corresponding uniform polyhedral formulas. This property was confirmed by (Holstein 2003) who proved that analytical formulas for the linear density case leads to terms that are \(\mathcal {O}(\varGamma ^{3+1})\) larger than the result.

Hence, for the maximum density variation considered in this paper, i.e., of fourth-order, a magnification by \(\mathcal {O}(\varGamma ^4)\) of the largest term in the analytical formulas with respect to the smallest is expected, making an overall growth factor of \(\mathcal {O}(\varGamma ^{3+4})\) of the summed term compared to the result.

Furthermore, the calculation of the vertical component of gravity of a finite target at increasing horizontal distances induces a further level of destructive cancellation, since we are seeking the vertical component and the field is primarily horizontal. For the constant case, this induces relative error growth proportional to \(\varGamma ^4\) in the constant density case, or \(\varGamma ^{4+4}\) in the quartic density case. One would therefore expect g\( {_z} \) to be more rapidly corrupted than the potential, at increasing target distances.

Fig. 6
figure 6

Log–log plot of the quantity (190) evaluated by considering the results in Table 10 (a) and Table 11 (b)

Motivated by the previous considerations this subsection presents the results of some numerical tests aimed at testing the sensitivity of the analytical formulas presented thus far with respect to the dimensionless target distance.

To this end we consider the prism model in Fig. 5b and a progressively increasing distance between the observation point P = [0, 15 km, 0] and the target body by assuming for the vertices of the left face the values \(x = 10\) km, \(x = 100\) km, \(x = 1000\) km and for those of the right face \(x = 20\) km, \(x = 110\) km, \(x = 1010\) km. In this way the dimensionless target distance \(\varGamma \) assumes value approximatively equal to 1, 10 and 100. The values of the gravitational potential and of vertical component of the gravity vector are reported in Tables 10 and 11, respectively.

Assuming the result obtained by Gauss integration as correct, a comparison of the values presented in Table 10 and 11 is reported in Fig. 6 by plotting on log–log axes the quantity

$$\begin{aligned} E_\varGamma = \frac{|\textrm{result} [V(x)]-\textrm{result}[V(Gauss)]|}{|\textrm{result}[V(Gauss)]|}{,} \end{aligned}$$
(190)

where V stands for value of the gravitational potential or the vertical component of the gravity vector.

The results reported in Tables 10 and 11 show that the values of the gravitational potential and of the gravity vector computed analytically become more and more unreliable as the offset between the observation point and the target body increases due to numerical cancellation errors. Moreover the error associated with the use of the analytical formulas has a rate of increase that is by far more pronounced for the gravity vector.

6.2.3 Effects of a Subdivision of the Target Body

It is of some interest to understand to what extent the computation of gravity fields associated with a polyhedral body is influenced by a finer subdivision of the polyhedron in smaller polyhedra. Actually, this produces an inhomogeneous distribution of the dimensionless target distance \(\varGamma \) that can significantly increase for smaller polyhedra more distant from the observation point, even if the value of \(\varGamma \) can be sufficiently low when the target body is modeled as a unique polyhedron.

Fig. 7
figure 7

Prism model of Fig. 2a and related subdivision in smaller subprisms

Table 12 Gravitational potential (m\(^2\) s\(^{-2} \)) obtained analytically for the prism model in Fig. 7b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]
Table 13 Gravitational potential (m\(^2\) s\(^{-2} \)) obtained by Gauss integration for the prism model in Fig. 7b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]
Table 14 Vertical component of the gravity vector (mgal) obtained analytically for the prism model in Fig. 7b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]
Table 15 Vertical component of the gravity vector (mgal) obtained by Gauss integration for the prism model in Fig. 7b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]

In the first test the target body is left at a very low dimensionless distance, \(\varGamma \simeq 1\) considering the prism as a whole, but this value is increased and made inhomogeneous by dividing the prism model of Fig. 7a in smaller subprisms by increasing the number of subdivisions of each edge of the original prism.

In this way the subprisms more distant from the observation point, namely those near the bottom right vertex of the prism, are characterized by greater dimensionless target distance. For instance, for N=100, the linear dimensions \(\alpha \) of the subprism is 10/100=0.1 km and the distance \(\delta \) from the observation point is \(\simeq \)20, yielding a value of \(\varGamma =200\).

This is sufficient to provide values of the gravitational potential whose precision, for an assigned type of density variation, degradates with N, see, e.g., Table 12, in which the first four columns refer to the four addends in (187) while the results of the last column have been obtained by considering the density contrast in (188). It is also worth being emphasized in Table 12 that the number of significant digits decreases as the order of the density variation increases.

Conversely, as shown in Table 13, such a phenomenon is not experienced by adopting a Gauss integration in which the number of Gauss point for each subprism has been chosen so as to keep approximately constant, and equal to \(200 \times 200 \times 200\), the number of Gauss points pertaining to the prism as a whole.

The above-mentioned properties of the solution are experienced as well in the computation of the vertical component of the gravity vector, see, e. g., Tables 14 and 15.

The error in the analytical solutions increases dramatically when the prism model is placed at a very long distance from the observation point as show in Fig. 8 in which the prism of Fig. 2a is shifted by 1000 km along the x axis. In this case \(\varGamma >100\) and its value increases even further with N (Tables 16, 17).

Table 16, referred to the gravitational potential, and Table 18, referred to the vertical component of the gravity vector, show that the number of significant digits decreases with increasing order of the density variation. For the cubic and quartic cases, the order of magnitude of the solution is obtained only for \(N=1\), 10, 20 and, in a rather unpredictable way, for other values of N.

Hence, the only reliable solution is obtained by Gauss integration, as shown in Table 17 for the gravitational potential and Table 19 for the vertical component of the gravity vector.

Fig. 8
figure 8

Prism model obtained by shifting the prism model in Fig. 2a of 1000 km along the x axis and related subdivision in smaller subprisms

Table 16 Gravitational potential (m\(^2\) s\(^{-2} \)) obtained analytically for the prism model in Fig. 8b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]
Table 17 Gravitational potential (m\(^2\) s\(^{-2} \)) obtained numerically for the prism model in Fig. 8b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]
Table 18 Vertical component of the gravity vector (mgal) obtained analytically for the prism model in Fig. 8b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]
Table 19 Vertical component of the gravity vector (mgal) obtained by Gauss integration for the prism model in Fig. 8b as a function of the number of subdivisions of each edge of the prism. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]

It is worth noting that the increase in the \(\varGamma \) values associated with grid refinement produces instability of the numerical results characterized by different properties with respect to those described in the previous subsection. Actually, the most distant polyhedra undoubtedly have the highest relative error but their absolute anomaly is much smaller since they are more distant with respect to the polyhedra nearest to the observation point. Consequently, the most distant polyhedra, even if characterized by low or no correct significant figures, just contribute noise when combined with the nearest ones.

This means that the overall anomaly may not be substantially affected so that the most distant polyhedra can be ignored if the observation point is shifted for from the discretized body; in this case also the nearest polyhedra would be affected by numerical instability as shown in Table 16.

6.3 Invariance of the Results Under Arbitrary Rotations of the Reference Frame

In order to fully exploit the tensorial approach developed in the paper, that makes the applications coordinate invariant, it has been decided to express the models in Fig. 2 endowed with the density function (187), (188) and (189). In this way the faces are no longer aligned with the reference axis and density functions expressed in the rotated frame are no longer a function of one variable alone.

In particular, computing the potential in rotated reference frame would (theoretically) give results identical to the unrotated case but, in this case, the full algorithmic steps for a general cubic in xyz would be used if one adopts the density function (187). Analogously, a much more general 4-th degree function is addressed by considering the density functions in formulas (188) and (189).

Fig. 9
figure 9

New reference frame for the prism in Fig. 2a obtained by rotating the old one around the unit vector defined by (195) by a rotation \(\theta =-60^\circ \). New coordinates of the vertices of the prism are reported in the table

To this end we remind that the rotation of a vector of an arbitrary angle \(\theta \) around an axis defined by the unit vector \( \textbf{u}\) is governed by the orthogonal tensor

$$\begin{aligned} \textbf{R}_{\textbf{u}\theta } = \cos \theta \,\textbf{I}+\sin \theta \, \textbf{W}_{\textbf{u}} + (1-\cos \theta )\, \textbf{u}\otimes \textbf{u}{,} \end{aligned}$$
(191)

where \( \textbf{W}_{\textbf{u}} \) is the skew-symmetric tensor associated with \( \textbf{u}\), i.e., \( \textbf{W}_{\textbf{u}}\,\textbf{a}=\textbf{u}\times \textbf{a}, \,\forall \textbf{a}\).

Denoting by

$$\begin{aligned} \displaystyle \textbf{e}_1= \left[ \begin{array}{ccc} 1 \\ 0 \\ 0 \end{array}\right] , \hspace{6ex} \textbf{e}_2= \left[ \begin{array}{ccc} 0 \\ 1 \\ 0 \end{array}\right] , \hspace{6ex} \textbf{e}_3= \left[ \begin{array}{ccc} 0 \\ 0 \\ 1 \end{array}\right] \end{aligned}$$
(192)

the unit vectors directed along the axes x, y and z, respectively, the relevant rotated axes will be

$$\begin{aligned} \textbf{e}_1^*=\textbf{R}_{\textbf{u}\theta }\,\textbf{e}_1 \qquad \textbf{e}_2^*=\textbf{R}_{\textbf{u}\theta }\,\textbf{e}_2 \qquad \textbf{e}_3^*=\textbf{R}_{\textbf{u}\theta }\,\textbf{e}_3 \end{aligned}$$
(193)

and the matrix representation of \( \textbf{R}_{\textbf{u}\theta } \) in the original reference frame

$$\begin{aligned} \displaystyle [\textbf{R}_{\textbf{u}\theta }]= \left[ \begin{array}{c} \textbf{e}_1^*\,|\,\textbf{e}_2^*\,|\,\textbf{e}_3^*\end{array}\right] = \left[ \begin{array}{ccc} E_{11} &{} E_{12} &{} E_{13} \\ E_{21} &{} E_{22} &{} E_{23} \\ E_{31} &{} E_{32} &{} E_{33} \end{array}\right] \,{.} \end{aligned}$$
(194)

As an example Fig. 9 shows the new reference frame that is obtained by rotating the old one around the axis defined by the unit vector

$$\begin{aligned} \displaystyle \textbf{u}=\frac{1}{\sqrt{3}} \left[ \begin{array}{ccc} 1 \\ 1 \\ 1 \end{array}\right] \end{aligned}$$
(195)

by a rotation of \(\theta =-60^\circ \). This is equivalent to rotate the old reference frame around -\( \textbf{u}\) by \(\theta =60^\circ \).

The coordinates \([\textbf{s}]^*=(x^*,y^*,z^*)\) of a generic point \( \textbf{s}\) in the new reference frame can been expressed as function of the original coordinates \([\textbf{s}] =(x,y,z)\) by means of the well-known relation

$$\begin{aligned} \displaystyle [\textbf{s}]^*=[\textbf{R}_{\textbf{u}\theta }^{-1}\,\textbf{s}]=[\textbf{R}_{\textbf{u}\theta }^{T}\,\textbf{s}]= \left[ \begin{array}{c} \textbf{e}_1^*\,|\,\textbf{e}_2^*\,|\,\textbf{e}_3^*\end{array}\right] \,\textbf{s}= \left[ \begin{array}{ccc} E_{11} &{} E_{12} &{} E_{13} \\ E_{21} &{} E_{22} &{} E_{23} \\ E_{31} &{} E_{32} &{} E_{33} \end{array}\right] \, \left[ \begin{array}{ccc} x \\ y \\ z \end{array}\right] , \end{aligned}$$
(196)

i.e.,

$$\begin{aligned} x^*=\textbf{e}_1^*\cdot \textbf{s}\qquad y^*=\textbf{e}_2^*\cdot \textbf{s}\qquad z^*=\textbf{e}_3^*\cdot \textbf{s}{.} \end{aligned}$$
(197)

In passing we also notice that expressing above is equivalent to rotate the prism model around \( \textbf{u}\) by an angle \(\theta =60^\circ \). This is due to the fact that \( \textbf{R}_{\textbf{u}(-\theta )}=\textbf{R}_{\textbf{u}\theta }^{-1}=\textbf{R}_{\textbf{u}\theta }^{T} \), the last equality stemming from the property of \( \textbf{R}_{\textbf{u}\theta } \) of being an orthogonal tensor.

To leave unaltered the density distribution with respect to the rotated frame, we need to express the density function by adopting the same functional dependence referred to the original reference frame but using as independent variables the coordinates of the generic point with respect to the reference frame rotated by \( \textbf{R}_{\textbf{u}\theta } \).

Let us now check if and to what extent formulas derived in the paper are really frame- indifferent by considering, separately, the examples presented in Sects. 5.1, 5.2.1 and 5.2.2.

6.3.1 Effects of the Rotation of the Reference Frame for the Examples in Subsection 5.1

The first task to accomplish in order to evaluate the gravity field in a rotated reference frame of the examples in Sect. 5.1 is to properly modify the expressions of the density contrast according to the formula (197).

Accordingly, the density function (187) can be reformulated as follows

$$\begin{aligned} \begin{array}{rl} \displaystyle \delta (\textbf{s})&{}= \displaystyle \delta _{o}+\delta _{1}\,z^*+\delta _{2}\,(z^*)^2+\delta _{3}\,(z^*)^3\\ &{} \displaystyle = \delta _{o}+\delta _{1}\,(\textbf{e}_3^*\cdot \textbf{s})+\delta _{2}\,(\textbf{e}_3^*\cdot \textbf{s})^2+\delta _{3}\,(\textbf{e}_3^*\cdot \textbf{s})^3{,} \end{array} \end{aligned}$$
(198)

where \(\delta _{o}= -747.7\), \(\delta _{1}=203.435\), \(\delta _{2}=-26.764\) and \(\delta _{3}= 1.4247\)

Observing that, given arbitrary vectors \( \textbf{a}\), \( \textbf{b}\), \( \textbf{c}\), \( \textbf{d}\), \( \textbf{e}\), \( \textbf{f}\), one has

$$\begin{aligned} (\textbf{a}\cdot \textbf{b})\,(\textbf{c}\cdot \textbf{d})=(\textbf{a}\otimes \textbf{c})\cdot (\textbf{b}\otimes \textbf{d}){,} \end{aligned}$$
(199)

and

$$\begin{aligned} (\textbf{a}\cdot \textbf{b})\,(\textbf{c}\cdot \textbf{d})\,(\textbf{e}\cdot \textbf{f})=(\textbf{a}\otimes \textbf{c}\otimes \textbf{e})\cdot (\textbf{b}\otimes \textbf{d}\otimes \textbf{f}){,} \end{aligned}$$
(200)

formula (198) can also be written as

$$\begin{aligned} \begin{array}{rl} \displaystyle \delta (\textbf{s})&{}=\displaystyle \delta _{o}+\delta _{1}\,\textbf{e}_3^*\cdot \textbf{s}+\delta _{2}\,(\textbf{e}_3^*\otimes \textbf{e}_3^*)\cdot (\textbf{s}\otimes \textbf{s})+\delta _{3}\,(\textbf{e}_3^*\otimes \textbf{e}_3^*\otimes \textbf{e}_3^*)\cdot (\textbf{s}\otimes \textbf{s}\otimes \textbf{s})\\ &{} \displaystyle = \delta _o + \mathcal {C}^{(1)}\cdot \mathcal {D}_{\textbf{s}}^{(1)}+ \mathcal {C}^{(2)}\cdot \mathcal {D}_{\textbf{s}}^{(2)} + \mathcal {C}^{(3)}\cdot \mathcal {D}_{\textbf{s}}^{(3)}{,} \end{array} \end{aligned}$$
(201)

where \(\mathcal {C}^{(1)}=\delta _{1}\,\textbf{e}_3^*\), \(\mathcal {C}^{(2)}=\delta _{2}\,(\textbf{e}_3^*\otimes \textbf{e}_3^*)\), \(\mathcal {C}^{(3)}=\delta _{3}\,(\textbf{e}_3^*\otimes \textbf{e}_3^*\otimes \textbf{e}_3^*)\) and the symbols \(\mathcal {D}_{\textbf{s}}^{(1)}\), \(\mathcal {D}_{\textbf{s}}^{(2)}\), \(\mathcal {D}_{\textbf{s}}^{(3)}\) have been introduced in (4) and defined in the formulas (204) and (207), respectively.

Analogously, formula (188) becomes, in the rotated reference frame \( x^*\), \( y^*\), \( z^*\),

$$\begin{aligned} \begin{array}{rl} \displaystyle \delta (\textbf{s})&= (z^*)^4=(\textbf{e}_3^*\otimes \textbf{s})^4=(\textbf{e}_3^*\otimes \textbf{e}_3^*\otimes \textbf{e}_3^*\otimes \textbf{e}_3^*)\cdot (\textbf{s}\otimes \textbf{s}\otimes \textbf{s}\otimes \textbf{s})= \mathcal {C}^{(4)}\cdot \mathcal {D}_{\textbf{s}}^{(4)}{.} \end{array} \end{aligned}$$
(202)

Finally, formula (189) becomes

$$\begin{aligned} \begin{array}{rl} \displaystyle \delta (\textbf{s})&{}=10^4 x^2yz= 10^4 (\textbf{e}_1^*\cdot \textbf{s})^2(\textbf{e}_2^*\cdot \textbf{s})(\textbf{e}_3^*\cdot \textbf{s})\\ &{} \displaystyle = 10^4 (\textbf{e}_1^*\otimes \textbf{e}_1^*\otimes \textbf{e}_2^*\otimes \textbf{e}_3^*)\cdot (\textbf{s}\otimes \textbf{s}\otimes \textbf{s}\otimes \textbf{s})= \mathcal {C}^{(4)}\cdot \mathcal {D}_{\textbf{s}}^{(4)}{.} \end{array} \end{aligned}$$
(203)

The gravitational potential and the gravity vector have been computed by assuming the unit vector (195) as axis of rotation and considering rotations of \(\theta =-30^\circ \) and \(\theta =-60^\circ \).

Table 20 Gravitational potential (m\(^2 \) s\(^{-2} \)) for the prism model in Fig. 2a considering separately the four addends of the density contrast in (187) in the original reference frame and of the density contrast (198) for the rotated ones. Observation point [\(x = 0, y = 15\) km, \(z =\) \(-\)0.15 m]

For simplicity, only the most distant observation has been considered, viz \( \textbf{p}\)=(0, 15, z), z being either \(-\)0.15 m or 0 m. Tables 20 and 21 contain, for z = -0,15 m and z = 0 m, respectively, the values of the potential for the prism model in Fig. 2a assuming the density contrast (187) for the original reference frame and the density contrast (198) for the rotated ones.

Table 21 Gravitational potential (m\(^2 \) s\(^{-2} \)) for the prism model in Fig. 2a considering separately the four addends of the density contrast in (187) for the original reference frame and of the density contrast (198) for the rotated ones. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]

Assuming the density contrasts considered in the previous two examples, Tables 22 and 23 contain the vertical component of the gravity field evaluated separately in the original reference frame \((\theta =0^\circ \)) and in the rotated ones obtained by assuming \(\theta =-30^\circ \) and \(\theta =-60^\circ \).

Similarly to (197) the component \( g_{z^*} \) of the gravity field with respect to the rotated axis \( z^*\) has been computed by setting \( g_{z^*} = \textbf{E}_3^*\cdot \textbf{g}\) where \( \textbf{g}\) is the gradient vector evaluated with respect to the unrotated vertical frame.

Table 22 Gravity field component (mgal) along the vertical axis z for the prism model in Fig. 2a considering separately the four addends of the density contrast (187) for the original reference frame and gravity field component along the axis \( z^*\) of the rotated frame assuming the density contrast (198). Observation point [\(x = 0, y = 15\) km, \(z =\) \(-\)0.15 m]
Table 23 Gravity field component (mgal) along the vertical axis z for the prism model in Fig. 2a considering separately the four addends of the density contrast (187) for the original reference frame and gravity field component along the axis \( z^*\) of the rotated frame assuming the density contrast (198). Observation point [\(x = 0, y = 15\) km, z = 0]

Table 24 contains the vertical component of the gravity field, for the prism in Fig. 2a, and the component of the gravity field along the axis \( z^*\) obtained by rotating the axes of the reference frame around the vector in (195). The density contrast (188) has been assumed for the original reference frame and the density contrast (202) for the rotated one. Specifically, the values \(\theta =-30^\circ \), \(\theta =-45^\circ \) and \(\theta =-60^\circ \) have been assumed.

Table 24 Gravity field component (mgal) along the vertical axis z for the prism model in Fig. 2a assuming the density contrast in (188) for the original reference frame and gravity field component along the axis \( z^*\) of the rotated frame assuming the density contrast in (202). Observation point [\(x = 0, y = 15\) km, z = 0]

Finally, for the prism in Fig. 2b, Table 25 contains the vertical component of the gravity field and the component of the gravity field along the axis \( z^*\) obtained by rotating the axes of the reference frame around the vector in (195). The density contrast (189) has been assumed for the original reference frame and the density contrast (203) for the rotated one. Also in this case the values of \(\theta =-30^\circ \), \(\theta =-45^\circ \) and \(\theta =-60^\circ \) have been assumed as angles of rotation.

Table 25 Gravity field component (m s\(^{-2}\)) along the vertical axis z for the prism model in Fig. 2b assuming the density contrast in (189) for the original reference frame and gravity field component along the axis \( z^*\) of the rotated frame assuming the density contrast in (203)

The examination of the results reported in Tables 20-25 clearly shows that the computation of the gravitational potential and of the gravity vector is substantially unaffected by the rotation of the reference frame although, in this last case, more term are needed to express the density contrast. For this reason we have reported in Table 26 the run-times associated with the results of Table 24; it can be noted that, as a mean, one obtains increments in the run-time up to the 19%.

Table 26 Absolute and relative run-times for the results in Table 24

6.3.2 Effects of the Rotation of the Reference Frame on the Origin-Observation Point Separation

In order to check how the effects of the origin-observation point separation are influenced by an arbitrary rotation of the reference frame, we make reference to the results reported in Tables 21 and 23 by comparing them with those obtained by considering the same example referred to a rotated frame.

Tables 21 and 23 shows that the values of the gravitational potential and of the gravity vector are insensitive to the rotation of the reference frame. For the reason, in order to avoid duplicating the same values, we report the results of our numerical experiment in the format of Tables 27 and 28 for the gravitational potential and the gravity vector, respectively.

Table 27 Gravitational potential (m\(^2 \) s\(^{-2} \)) for the prism model in Fig. 5a considering separately the four addends of the density contrast (187) in the original reference frame and of the density contrast (198) for the rotated ones. Observation point [\(x = 0, y, z = 0\)]
Table 28 Gravity field component (mgal) along the vertical axis z for the prism model in Fig. 5a considering separately the four addends of the density contrast in (187) for the original reference frame and gravity field component along the axis \( z^*\) of the rotated frame assuming the density contrast in (198). Observation point [\(x = 0, y, z = 0\)]

Inspection of Tables 27 and 28 shows that the effects associated with the rotation of the reference frame increase with the order of the density variation, the amount of the rotation and with the distance of the reference point from the origin. Specifically, this last effect is more pronounced for greater values of the rotation since this produces a larger inhomogeneity in the coordinates of the vertices and, hence, of the dimensionless target distance \(\varGamma \).

6.3.3 Effects of the Rotation of the Reference Frame on the Observation Point- Target Body Separation

Let us now investigate the influence of arbitrary rotations of the reference frame on the observation point-target body separation by taking into account the results reported in Tables 10 and 11. These last ones are included in the first column of Tables 29 nd 30 that refer, respectively, to gravitational potential and to the gravity vector

Table 29 Gravitational potential (m\(^2 \) s\(^{-2} \)) for the prism model in Fig. 5b considering separately the four addends of the density contrast in (187) in the original reference frame and of the density contrast (198) for the rotated ones. Observation point [\(x = 0, y = 15\) km, \(z = 0\)]
Table 30 Gravity field component (mgal) along the vertical axis z for the prism model in Fig. 5b considering separately the four addends of the density contrast in (187) for the original reference frame and gravity field component along the axis \( z^*\) of the rotated frame assuming the density contrast in (198). Observation point [\(x = 0, y = 15\) km, \(z = 0\)]

The results of Table 30, similarly to those included in Table 29 and in the previous subsection, show that the values of the gravitational potential and of the gravity vector are substantially insensitive to the rotation of the reference frame for low values of the dimensionless target ratio \(\varGamma \).

As a matter of fact this can be considered as a more general feature that characterizes the computation of the gravity fields since discrepancies between the values associated with increasing values of \(\theta \) are mainly due to greater values of \(\varGamma \).

A further interesting result that prompts by examining the results in Table 29 when x = 1000 km, i.e., when \(\varGamma \) is large, is that the values corresponding to \(\theta =-30^\circ \) and to \(\theta =-60^\circ \) are almost opposite each other and have significantly different orders of magnitude with respect to the case \(\theta =0^\circ \) for constant and quadratic density contrasts. Conversely, when the vertical component of the gravity vector is computed, this happens for linear and cubic density contrasts.

7 Conclusions

The gravitational potential (GP) and gravity vector (GV) induced at an arbitrary point by a polyhedral body having arbitrary shape and polynomial density contrast have been obtained in tensor form and expressed as the sum of quantities that depend only upon the 3D coordinates of the vertices of the polyhedron and upon the parameters defining the density contrast. Remarkably, the formulation holds true whatever is the origin of the Cartesian reference frame assumed in the calculations in the sense that is does not have to necessarily coincide with the observation point.

Differently from the recent contribution by (Ren et al. 2020), the algebraic expressions of the GP and the GV reported in the paper allow for their computation without any use of recursive formulas. Furthermore, by means of rigorous mathematical arguments, singularities are ruled out from the analytical expression of both the GP and GV as well as from their algebraic counterparts.

Though limited to a polynomial density contrast varying with a quartic law as a maximum, the formulation developed in the paper can be easily extended to polynomials of higher degree. In additional, being expressed in tensor form, the resulting formulas can be specialized to arbitrary reference frames.

The effectiveness of the proposed approach has been intensively tested by numerical comparisons, carried out by means of a MATLAB code, with several examples derived from the specialized literature. The numerical stability issue associated with the analytical approach to gravity field modeling has been investigated by assuming the growth of the relative error in the computation as a function of the dimensionless target distance, i.e., the distance between the observation point and the center of a building block in a meshed model over, the size of the polyhedral element.

Future contributions will address the derivation of analytical formulas for the second- and third-order gradient of polyhedral bodies endowed with a polynomial density contrast of arbitrary order.