1 Introduction

In recent times, compelling evidence has been advanced suggesting that the standard theory of gravitation, namely general relativity (GR), is in need of modification. The motivations include the inability to renormalise GR as well as the uncertain behaviour of GR in extreme gravity regimes such as outside black holes and neutron stars. Moreover, the observed accelerated expansion of the universe also is not a natural consequence of GR, and in order to use GR an appeal must be made to the existence of exotic matter fields such as dark matter and dark energy. To date no experimental support for either of these has been forthcoming. An alternative approach is to endeavour to modify the theory of gravitation in such a way so as not to lose the gains of GR. After all GR succeeds incredibly at the solar system level and beyond. The exploits of the Event Horizon Telescope [1] in detecting the shadow or photon ring of the back hole M87 as well as the success of detecting gravitational waves [2] has cemented the position of GR as a front-runner amongst gravitational field theories. Nevertheless, the aspects not explained by GR must also be confronted. We subscribe to the view that modifying the geometric sector of the governing field equations may hold the key to resolving these outstanding issues.

A leading contender in the area of modified gravity is Lovelock theory [3, 4]. The Lovelock Lagrangian is a natural tensorial generalisation of the Einstein–Hilbert action of GR preserving diffeomorphism invariance, satisfying the Bianchi identities and generating up to second order equations of motion. In addition to these desirable features, to first order and in 4 spacetime dimensions Lovelock gravity reduces to GR. Our interest lies in the Einstein–Gauss–Bonnet (EGB) action which corresponds to the second order of the Lovelock polynomial. The reason for the intrigue with this special case is that the EGB Lagrangian appears in the low energy action of heterotic string theory [5, 6]. String theory and its generalization M-theory are leading candidates in understanding quantum theory. It is a long standing problem of physics to combine quantum fields and gravitation into a grand unified theory. Note that EGB theory is quintessentially a higher dimensional theory with extra curvature effects becoming dynamic only in 5 and 6 dimensions. This is clearly compatible with the quantum theory which also demands dimensions higher than 4.

Interest in higher dimensional gravitational effects is not novel. Historically such studies commenced with the seminal work of Kaluza [7] and Klein [8] who explained the role of the electromagnetic field in the context of a five dimensional spacetime. The extra dimensions, while not being accessible, were explained as being topologically curled into circles of Planck length scales. Lately, braneworld cosmology became popular and extra dimensions beyond four were required [9]. It is worth noting that the Large Hadron Collider examined the question of extra dimensions but could not detect any large extra dimension nor was it able to rule out small extra dimensions. Hence, there are no physical grounds to dismiss the existence and influence of extra spacetime dimensions in gravity.

A recent attempt to reduce EGB to a four dimensional theory [10] through a rescaling of the coupling constant has drawn much criticism [11, 12] although inspiring considerable investigations. The mathematical concerns are addressed through a dimensional regularisation procedure introduced by Tomozawa [13]. In the area of stellar modelling, isotropic stellar distributions with palatable physical properties were constructed by [14] and a charged version was discussed by [15]. Despite these new directions, which are still under debate, we proceed to analyze models in five and six dimensional EGB theory. It must be remembered that in five dimensions only five exact solutions for isotropic spherically symmetric perfect fluids have ever been found [16,17,18,19,20]. In [21] all conformally flat static EGB metrics in 5 and 6 dimensions were found. Independently a further nontrivial exact 6 dimensional solution was reported in [22]. This demonstrates the small number of known exact solutions in EGB. The paucity of exact solutions is due to the increased complexity of the nonlinear differential equations. Exact solutions are actively pursued because they are not prone to approximation errors which bedevil numerical solutions.

Exact solutions are important in gravitational physics as they provide insight into the spacetime geometry in several applications in cosmology and astrophysics. The treatments of Stephani et al. [23] and Delgaty and Lake [24] contain several spacetime metrics with interesting geometrical and physical features for isotropic fluids used to model stars. While the number of exact solutions reported over the past century for static spherically symmetric ideal fluids number over 120, only a small subset of fewer than 10 actually have physical properties rendering them suitable to model stars. The field equations in modified gravity theories are more complicated with higher order curvature corrections. Fewer exact solutions are known in such theories including EGB and Lovelock gravity theories. It is important to generate new exact solutions to understand the gravitational dynamics. This is the object of this paper.

We briefly trace the history of solution generating algorithms for static spherically symmetric perfect fluid distributions of matter in four dimensions. Wyman [25] solved the field equations and proposed the earliest solution generating algorithm on record. It was not until 2000 that Fodor [26] developed a method involving one generating function and a procedure not requiring integration. Shortly thereafter Rahman and Visser [27] discovered an algorithm with the use of isotropic coordinates. The procedure involved a single differentiation and integration; a negative feature of the process was that the integral of a square root was required. Such integrations are notoriously difficult to engage with. In 2003 Lake revisited Wyman’s [25] idea and proposed algorithms for curvature and isotropic coordinates. In the former approach, two integrations were demanded while in the latter technique a single integration was needed, the caveat being that the integrand appeared as a square root. Lake [28] showed the connection with his method and the Rahman–Visser approach. A further advance was reported in 2004 when Martin and Visser [29] produced another algorithm in the context of Schwarzschild coordinates. A procedure for determining new exact solutions from a known seed solution was developed by Boonserm, Visser and Weinfurtner [30]. Finally, Hansraj and Krupanandan [31] generated an algorithm based upon an observation of the structure of the master isotropy equation as a nonlinear first order equation with the use of coordinates originally suggested by Buchdahl [32, 33] but recently utilised by Durgapal and Bannerji [34] and Finch and Skea [35]. Algorithms are also been generated for imperfect fluids and a recent treatment is given by Ivanov [36].

It is worth noting that the algorithm we develop in this paper has a wide range of applicability in modified theories of gravity. It has recently been shown by Visser [37], and corroborated by Hansraj and Banerjee [38], that gravitational field theories that go by the names trace-free gravity (or unimodular gravity), f(RT) theory as well as Rastall theory are geometrically equivalent to the standard Einstein theory. This may be observed from the identical statement of the equation of pressure isotropy in all four of these theories. The deviations amongst these proposals lie within the physics as determined by the energy density and isotropic particle pressure. The f(RT) and Rastall theories both irretrievably violate the law of conservation of energy momentum. In the case of unimodular theory the energy conservation may be reinstated by hand so that effectively the Einstein equations are regained. Given that the isotropy equations which relate the gravitational potentials in the metric are identical, we are allowed to conclude that our results apply trivially to the three modified theories mentioned herein.

2 Einstein–Gauss–Bonnet gravity

The Gauss–Bonnet action in n dimensions may be expressed in the form

$$\begin{aligned} S = \int \sqrt{-g} \left[ \frac{1}{2} \left( R - 2\Lambda + \alpha L_{GB}\right) \right] d^n x + S_{ \text{ matter }}, \end{aligned}$$
(1)

where \( \alpha \) is the Gauss–Bonnet coupling constant. The action \( L_{G B} \) has the property that despite the Lagrangian being quadratic in the Ricci tensor, the Ricci scalar and the Riemann tensor, the equations of motion are second order quasilinear. That is, they are free of Ostrogradsky ghosts. The Gauss–Bonnet term is non-dynamical for \( n \le 4 \) but contributes to the action when \( n > 4 \).

The Einstein–Gauss–Bonnet (EGB) field equations may be written as

$$\begin{aligned} G_{a b} + \alpha H_{a b} = T_{a b}, \end{aligned}$$
(2)

with metric signature \( (- + + + \cdots +) \) where \( G_{ab} \) is the Einstein tensor. The Lanczos tensor is given by

$$\begin{aligned} H_{a b}= & {} 2 \left( R R_{a b} - 2 R_{a c}R^{c}_{b} - 2 R^{c d} R_{a c b d} + R^{c d e}_{a} R_{b c d e} \right) \nonumber \\&- \frac{1}{2} g_{a b} L_{G B}, \end{aligned}$$
(3)

where the Lovelock term has the form

$$\begin{aligned} L_{G B} = R^2 + R_{a b c d} R^{a b c d} - 4R_{c d} R^{c d}. \end{aligned}$$
(4)

3 Field equations

The n–dimensional line element for static spherically symmetric spacetime is given as

$$\begin{aligned} ds^{2} = -e^{2 \nu (r)} dt^{2} + e^{2\lambda (r)} dr^{2} + r^{2} d\Omega ^2_{n-2}, \end{aligned}$$
(5)

where \(d\Omega ^2_{n-2}\) is the metric on a unit \((n-2)\)–sphere. With the choice of the following transformation

$$\begin{aligned} x = Cr^2, \quad y(x)=e^{\nu },\quad Z(x)=e^{-2\lambda } , \end{aligned}$$

the generic n–dimensional line element for static spherically symmetric spacetime can be read as

$$\begin{aligned} ds^{2} = -y^2 (x) dt^{2} + \frac{1}{Z(x)} dr^{2} + \frac{C}{x} d\Omega ^2_{n-2}, \end{aligned}$$
(6)

where C is an arbitrary parameter, y(x) and Z(x) are the gravitational potentials. The coordinate transformation introduced above closely follows the work of Durgapal and Bannerjee [34] and Finch and Skea [35]. We utilize a comoving fluid velocity of the form \( u^a = y^{-1} \delta _{0}^{a} \) and the matter field is that of a perfect fluid with energy momentum tensor

$$\begin{aligned} T_{a b} = (\rho + p) u_a u_b + p g_{a b}. \end{aligned}$$
(7)

The most general EGB field equations for the metric (6) are given by

$$\begin{aligned} \frac{\rho }{C}= & {} \frac{(n-2)[-2x{\dot{Z}}+(n-3)(1-Z)]}{2x}\nonumber \\&+ \frac{(n-2){{\bar{\alpha }}}(1-Z)C[ -4x{\dot{Z}} +(n-5)(1-Z)]}{2x^2}, \nonumber \\ \end{aligned}$$
(8)
$$\begin{aligned} \frac{p_r}{C}= & {} \frac{(n-2)\left[ -4xZ{\dot{y}} +(n-3)(1-Z)y \right] }{2xy}\nonumber \\&+ \frac{(n-2){{\bar{\alpha }}} (1-Z)C\left[ 8xZ{\dot{y}} -(n-5)(1-Z)y\right] }{2x^2 y},\nonumber \\ \end{aligned}$$
(9)
$$\begin{aligned} \frac{p_{\theta }}{C}= & {} -\frac{1}{2xy}\left[ 8x^2 Z\ddot{y} + \left( 4(n-2)xZ+4x^2{\dot{Z}}\right) {\dot{y}}\right. \nonumber \\&+ \left. \left( 2(n-3)x{\dot{Z}} +(n-3)(n-4)(Z-1)\right) y\right] \nonumber \\&+ \frac{{{\bar{\alpha }}}C}{2x^2 y} \left[ 16x^2 Z(1-Z)\ddot{y}\right. \nonumber \\&+\left( 8(n-4) xZ (1-Z) +8x^2{\dot{Z}}(1-3Z)\right) {\dot{y}} \nonumber \\&\left. +(1-Z)\left( 4(n-5)x{\dot{Z}} -\beta (1-Z)\right) y \right] , \end{aligned}$$
(10)

where we have taken the \(N^{th}\) order Lovelock polynomial to quadratic order (\(N = 2\)). It is well known that the critical spacetime dimensions for the \(N = 2\) Lovelock Lagrangian are 5 and 6 as the effects of third order Lovelock invariants only become active in dimensions 7 and 8. In general the critical spacetime dimensions are \(n = 2N + 1\) and \(n = 2N + 2\). Additionally note that we have introduced the new parameters

$$\begin{aligned} \bar{\alpha } = 2(n-3)(n-4)\alpha C \quad \text {and} \quad \beta = 2(n-4)(n-5)\alpha C . \end{aligned}$$

The equation of pressure isotropy reduces to

$$\begin{aligned}&8 x^2 Z (x+ \bar{\alpha } (1-Z))\ddot{y}+ 4 x \left( x^2 {\dot{Z}}\right. \nonumber \\&\quad \left. - \bar{\alpha } \left( 2 Z (1-Z)-x (1-3 Z) {\dot{Z}}\right) \right) {\dot{y}} \nonumber \\&\quad +2 (n-3) \left( x{\dot{Z}}-Z+1\right) (x+ \beta (1-Z))y = 0, \end{aligned}$$
(11)

on setting \(p_r=p_{\theta }=p\), which is the fundamental equation.

Setting \(\rho = 0\) in Eq. (8) which gives a first order differential equation with solution

$$\begin{aligned} y^2= 1 +\frac{x}{\bar{\alpha } } \left( 1 \pm \sqrt{1+\frac{16{\bar{\alpha }} C_1 }{(n-1)x^{\frac{n-1}{2}}} } \right) = Z , \end{aligned}$$
(12)

corresponding to the Boulware–Deser solution.

4 Generating new solutions from seed solutions

Assume the solution space of Eq. (11) is given by the functions \(\{Z_0(x), y_0 (x)\}\) where the subscripts denote known or existing exact solutions, this gives

$$\begin{aligned}&8 x^2 Z_0 (x+ \bar{\alpha } (1-Z_0))\ddot{y}_0+ 4 x \left( x^2 \dot{ Z_0}\right. \nonumber \\&\quad \left. - \bar{\alpha } \left( 2 Z_0 (1-Z_0)-x (1-3 Z_0) \dot{Z_0}\right) \right) \dot{y_0} \nonumber \\&\quad +2 (n-3) \left( x \dot{ Z_0}-Z_0+1\right) (x+ \beta (1-Z_0))y_0 = 0.\nonumber \\ \end{aligned}$$
(13)

We now demonstrate how to construct new exact solutions to Eq. (11) with the use of the following transformations

$$\begin{aligned} Z = Z_0 + f ,\quad \text {and} \quad y = y_0, \end{aligned}$$
(14)

where \(f = f(x)\) is a new yet-to-be-determined functional. Introducing the above transformation (14) in (11) generates the constraint equation

$$\begin{aligned}&8x^2f(x+\bar{\alpha }(1-Z_0 -f))\ddot{y_0} -8x^2\bar{\alpha } Z_0f \ddot{y}_0 \nonumber \\&\quad +4x\Big ( x^2{\dot{f}}- \bar{\alpha }\nonumber \\&\quad \times \left( 2f(1-Z_0) -2Z_0 f -2f^2 -x(1-3Z_0){\dot{f}}\right. \nonumber \\&\quad \left. +3xf{\dot{Z}}_0 +3xf{\dot{f}}\right) \Big ) {\dot{y}}_0 \nonumber \\&\quad +2(n-3)\left( ({\dot{f}}x -f)(x+\beta (1-Z_0 - f)) \right. \nonumber \\&\quad \left. - \beta f({\dot{Z}}_0 x -Z_0 +1)\right) y_0 = 0, \end{aligned}$$
(15)

where we have used (13). Effectively we have

$$\begin{aligned}&\left( (-2(n-3)\beta xy_0 - 12\bar{\alpha } x^2{\dot{y}}_0 )(f + Z_0) + (4x^3{\dot{y}}_0 \right. \nonumber \\&\quad \left. + 4\bar{\alpha } x^2{\dot{y}}_0 +2(n-3)(x^2 y_0 + \beta xy_0)\right) {\dot{f}} \nonumber \\&\quad + \left( 8\bar{\alpha }(x{\dot{y}}_0 - x^2 \ddot{y}_0) +2(n-3) \beta y_0\right) f^2 \nonumber \\&\quad + [ (-2(n-3)\beta xy_0 - 12\bar{\alpha } x^2{\dot{y}}_0 ){\dot{Z}}_0 \nonumber \\&\quad + 2 (8\bar{\alpha }(x{\dot{y}}_0 - x^2 \ddot{y}_0)Z_0 +2(n-3)\beta y_0)\nonumber \\&\quad + ( 8x^3\ddot{y}_0 + 8x^2 \bar{\alpha }\ddot{y}_0 \nonumber \\&\quad - 8\bar{\alpha } x{\dot{y}}_0 - 2(n-3)(xy_0 + 2\beta y_0) ) ] f = 0, \end{aligned}$$
(16)

in terms of the unknown function of f. One can observe that Eq. (16) is in the form of an Abel equation. Although only small classes of exact solutions for the Abel equation are known, there exists some prospects of locating exact solutions if we proceed along these lines than with analyzing an unknown type of equation.

The success of the method of course depends heavily on the type of seed solutions \(\{Z_0(x), y_0 (x)\}\) utilized. In the EGB arena very few exact solutions for static hyperspheres are known [16,17,18]. All of these known solutions are very complicated and do not readily allow for the integration of (16). Note that we may also attempt to construct a perfect fluid spacetime using the exterior vacuum solution of Boulware and Deser [6] as a seed metric. However, even such a prescription fails to allow the integration of (16). A notable exception, is the Schwarzschild interior solution shown by Dadhich et al. [20] to be a necessary condition for incompressibility (constant density) in both higher dimensional Einstein gravity as well as in Lovelock gravity. We now show how the known interior Schwarzschild solution generates a new perfect fluid solution in EGB but with drastically different physics.

5 New solutions from old

It is well known that the Schwarzschild interior metric given by \(Z = 1 + x\) and \(y = a\sqrt{x+1} + b\) where a and b are integration constants is a necessary solution of the field equations (8), (9) and (11). This metric generates the constant density or incompressible fluid sphere in general Lovelock gravity of which general relativity and EGB theory are the first and second order cases. This most general necessary solution does not permit the integration of Eq. (15) so we consider the special cases \(a = 1\) and \(b = 0\) which still constitutes a particular seed solution. The seed metric we utilise is given by

$$\begin{aligned} Z_0 = 1 + x, \quad \text {and} \quad y_0 = \sqrt{1+x}. \end{aligned}$$
(17)

After inserting it into (16) we get a differential equation in terms of f as

$$\begin{aligned}&(x+1) x \left( \bar{\alpha }\left( f \left( -3 x {\dot{f}}+x+2\right) -x (3 x+2) {\dot{f}}+2 f^2\right) \right. \nonumber \\&\quad \left. +x^2 {\dot{f}}\right) +(d-3) (x+1)^2 \nonumber \\&\quad \times (x {\dot{f}}-f) (x-\beta (f+x))+\bar{\alpha } (x+1)\nonumber \\&\quad \times x^2 f-x^2 f (x-\bar{\alpha } (f+x))= 0. \end{aligned}$$
(18)

The above Eq. (18) is a nonlinear equation of the Abelian type in the function f. In spite of its complexity we can show that (18) can be solved implicitly. It is easy to check that the resulting implicit solution is correct using the software package Mathematica. The most general solution to Eq. (18) are roots of the algebraic equation

$$\begin{aligned}&\left( \bar{\alpha }f - (1-\bar{\alpha })x\right) ^2 \left( -2(n-2)(1-\bar{\alpha })x(x+1) \right. \nonumber \\&\qquad \left. + \bar{\alpha } \left\{ (n-5)+(n-2)x\right\} f\right) \nonumber \\&\quad = 2 x^3 (x+1)\, \text{ exp }\left( \frac{3\bar{\alpha } c_1}{2(n-2)(1-\bar{\alpha } )^2} \right) , \end{aligned}$$
(19)

where \(c_1\) is an integration constant. Note we have also used \(\frac{\beta }{\bar{\alpha }} = \frac{n-5}{n-3}\) to suppress \(\beta \). Equation (19) is a standard cubic equation in f with roots that are straightforward but tedious to obtain and it will be preferred to write the explicit solutions later for the specific critical cases \(n = 5\) and \(n = 6\).

6 The 5D case

In 5 dimensions, \(\beta = 0\) so Eq. (18) reduces to the form

$$\begin{aligned}&f \left[ (\bar{\alpha } -1) \left( 3 x^2+4 x+2\right) -3 \bar{\alpha } x (x+1) {\dot{f}}\right] \nonumber \\&\quad -(\bar{\alpha } -1) x \left( 3 x^2+5 x+2\right) {\dot{f}}\nonumber \\&\quad +\bar{\alpha } (3 x+2) f^2 = 0, \end{aligned}$$
(20)

with the real valued solution

$$\begin{aligned} f= & {} \frac{ \root 3 \of {w_1 +w_2}}{192 c_1 \root 3 \of {2} a^3 c^3} -\frac{ w_3}{96 c_1 \ 2^{2/3} a^3 c^3 \root 3 \of {w_1+w_2}}\nonumber \\&-\frac{(3 x+1) (4 a c-1)}{12 a c}, \end{aligned}$$
(21)

where we have put

$$\begin{aligned} w_1&= -524288 a^9 c^9 c_1^{3}+393216 a^8 c^8 c_1^{3}-98304 a^7 c^7 c_1^{3}\\&\quad -110592 a^6 c^6 c_1^{2} x^3 \\&\quad -110592 a^6 c^6 e^{2 c_1} x^2 +8192 a^6 c^6 c_1^{3}, \\ w_2&= \sqrt{4 \left( -4096 a^6 c^6 c_1^{2}+2048 a^5 c^5 c_1^{2}-256 a^4 c^4 c_1^{2}\right) {}^3+w^2_1}, \\ w_3&= -4096 a^6 c^6 c_1^{2}+2048 a^5 c^5 c_1^{2}-256 a^4 c^4 c_1^{2}. \end{aligned}$$

Note we need to discard the two complex valued solutions since they have no physical relevance in this context.

An examination of Eq. (20) suggests that a simple solution may exist in the special case \(\bar{\alpha } = 1\) which may facilitate deeper investigation. The special case \(\bar{\alpha } = 4\alpha C = 1\) reduces (20) to the form

$$\begin{aligned} (3 x+2) f(x)-3 x (x+1) f'(x) = 0, \end{aligned}$$
(22)

with solution

$$\begin{aligned} f(x) = c_4 \root 3 \of {x^2(x+1)}, \end{aligned}$$
(23)

where \(c_4\) is an integration constant. Hence

$$\begin{aligned} Z = 1 + x + c_4 \root 3 \of {x^2(x+1)} ,\quad \text {and} \quad y = \sqrt{1+x}, \end{aligned}$$
(24)

is a new exact solution to the EGB field equations. The above transformation (14) we are using therefore represents an important advance in finding exact solutions from existing solutions (17). In order to complete the model it is necessary to achieve a matching of the interior spacetime we have found and the exterior Boulware–Deser metric potentials in 5D (12) given by

$$\begin{aligned} y^2 = Z = 1 + \frac{R^2}{4\alpha } \left( 1 - \sqrt{1 + \frac{16M\alpha }{R^4}}\right) \end{aligned}$$
(25)

where M is the total mass and R is the radius. As we have obtained our exact solution through solving a first order Abel equation, there is only one mandatory constant \(c_4\) in the problem, however, the matching of the temporal and spatial potentials offer two options. Therefore we may use the extra option to obtain the constant C in terms of the mass M and radius R of the star. Accordingly we get

$$\begin{aligned} C= & {} \frac{1}{4\alpha }\left( 1-\sqrt{\frac{16 \alpha M+R^4}{R^4}}\right) \\ c_4= & {} \frac{R^2 -4 \alpha C R^2- \sqrt{16 \alpha M+R^4}}{4 \alpha \root 3 \of {C^2 R^4 \left( C R^2+1\right) }}. \end{aligned}$$

It may be observed from the graphical analysis later that suitable constants exist for a generally physically viable model.

Fig. 1
figure 1

Behavior of \(\rho \) with \(C=1\), \(\bar{\alpha }=1\), \(n=5\) and various \(c_4\)

6.1 Physical quantities

We plug the form (24) in (8) and (9). The energy density and pressure are obtained as

$$\begin{aligned} \rho= & {} \frac{C (n-2) \left[ c_{4}^{2} \bar{\alpha } C \root 3 \of {{\mathcal {X}}} \{3 n (x+1)-3 x-7\}\right] }{6 \left( {\mathcal {X}}\right) ^{2/3}}\nonumber \\&+\frac{C (n-2)\left[ c_{4} x (2 \bar{\alpha } C-1) \{3 n (x+1)-3 x-5 \}+3 (n-1) \left( {\mathcal {X}}\right) ^{2/3} (\bar{\alpha } C-1)\right] }{6 \left( {\mathcal {X}}\right) ^{2/3}}, \end{aligned}$$
(26)
$$\begin{aligned} p= & {} -\frac{C (n-2)}{2 {\mathcal {X}}} [c_{4}^{2} \bar{\alpha } C (n-5) \{{\mathcal {X}}\}^{2/3}\nonumber \\&+c_{4}x \root 3 \of {{\mathcal {X}}} (n \bar{\alpha } C (c_{4}\root 3 \of {{\mathcal {X}}}+2) -\bar{\alpha } C \{c_{4}\root 3 \of {{\mathcal {X}}}+6\}\nonumber \\&+n-3)+(n-1) x^2 \{c_{4}\root 3 \of {{\mathcal {X}}} (2 \bar{\alpha } C+1)+\bar{\alpha } C+1\}\nonumber \\&+(n-1) x^3 (\bar{\alpha } C+1)], \end{aligned}$$
(27)

where \({\mathcal {X}}=x^2 (x+1)\), is arbitrarily taken to avoid long mathematical expressions. These quantities are decreasing functions as depicted in Figs. 1 and 2.

Fig. 2
figure 2

Behavior of p with \(C=1\), \(\bar{\alpha }=1\), \(n=5\) and various \(c_4\)

We have obtained the dominant energy condition (DEC) in Fig. 3 (from set of inequalities in terms of enrgy momentum tensor components), derived from the well known Raychaudhuri equation [39] to model physical acceptability. We have the expression

$$\begin{aligned} \rho -p= & {} \dfrac{C (n-2)}{3 \left( {\mathcal {X}}\right) ^{2/3}} [c_{4}^{2} \bar{\alpha } C \root 3 \of { {\mathcal {X}}} (3 n (x+1)-3 x-11)\nonumber \\&+2 c_{4}x (\bar{\alpha } C (3 (n-1) x+3 n-7)-1)\nonumber \\&+3 \bar{\alpha } C (n-1) ( {\mathcal {X}})^{2/3}]. \end{aligned}$$
(28)
Fig. 3
figure 3

Behavior of \(\rho -p\) with \(C=1\), \(\bar{\alpha }=1\), \(n=5\) and various \(c_4\)

In addition, sound speed, and adiabatic index are given in Figs. 4 and 5 and they have and they have the following forms

$$\begin{aligned} \frac{dp}{d\rho }= & {} -3 [2 c_{4}\bar{\alpha } C (n-5) \root 3 \of {{\mathcal {X}}} +x (2 \bar{\alpha } n C (c_{4}\root 3 \of {{\mathcal {X}}}+1)\nonumber \\&- 2 \bar{\alpha } C \{7 c_{4}\root 3 \of {{\mathcal {X}}}+3\}+n-3 ) \nonumber \\&+x^2(n-7) (2 \bar{\alpha } C+1) ] / [2 c_{4}\bar{\alpha } C (3 n-7) \root 3 \of {{\mathcal {X}}}\nonumber \\&+x (6 \bar{\alpha } n C (c_{4}\root 3 \of {{\mathcal {X}}}+1) - 2 \bar{\alpha } C \{9 c_{4}\root 3 \of {{\mathcal {X}}}+5\}\nonumber \\&-3n+5 )+x^2(3n-9) (2 \bar{\alpha } C-1) ], \end{aligned}$$
(29)
$$\begin{aligned} \Gamma= & {} \left( \frac{\rho + p}{p} \right) \frac{dp}{d\rho }=-[2 \root 3 \of {{\mathcal {X}}}\nonumber \\&\times (-4 c_{4}^{2} \bar{\alpha } C \root 3 \of {{\mathcal {X}}}+c_{4}x (-4 \bar{\alpha } C+3 n (x+1)-3 x-7)\nonumber \\&+3 (n-1) ({\mathcal {X}})^{2/3}) (2 c_{4}\bar{\alpha } C (n-5) \root 3 \of {{\mathcal {X}}}\nonumber \\&+x (n (2 \bar{\alpha } C (c_{4}\root 3 \of {{\mathcal {X}}}+1)+1) \nonumber \\&-2 \bar{\alpha } C (7 c_{4} \root 3 \of {{\mathcal {X}}}+3)-3)\nonumber \\&+(n-7) x^2 (2 \bar{\alpha } C+1)) ] / [(2 c_{4}\bar{\alpha } C (3 n-7) \root 3 \of {{\mathcal {X}}}\nonumber \\&+x (n (6 \bar{\alpha } C (c_{4} \times \root 3 \of {{\mathcal {X}}}+1)-3) \nonumber \\&-2 \bar{\alpha } C (9 c_{4}\root 3 \of {{\mathcal {X}}}+5)+5) \nonumber \\&+3 (n-3) x^2 (2 \bar{\alpha } C-1)) (c_{4}^{2} \bar{\alpha } C (n-5)\nonumber \\&\times ({\mathcal {X}})^{2/3}+c_{4}x \root 3 \of {{\mathcal {X}}} \nonumber \\&\times (n (\bar{\alpha } C (c_{4}\root 3 \of {{\mathcal {X}}}+2)+1) \nonumber \\&-\bar{\alpha } C (c_{4}\root 3 \of {{\mathcal {X}}}+6)-3)+(n-1) x^2 \nonumber \\&\times (c_{4}\root 3 \of {{\mathcal {X}}} (2 \bar{\alpha } C+1)\nonumber \\&+\bar{\alpha }C+1)+(n-1) x^3 (\bar{\alpha } C+1)) ], \end{aligned}$$
(30)
Fig. 4
figure 4

Behavior of \(\frac{dp}{d\rho }\) with \(C=1\), \(\bar{\alpha }=1\), \(n=5\) and various \(c_4\)

Fig. 5
figure 5

Behavior of \(\Gamma \) with \(C=1\), \(\bar{\alpha }=1\), \(n=5\) and various \(c_4\)

6.2 Discussion

The complete illustration of all the physical quantities are displayed in the above Figs. 1, 2, 3, 4 and 5. For a physically acceptable model the density (Fig. 1) and isotropic pressure (Fig. 2) remains positive. Also, the pressure component monotonically decreases and vanishes at a finite radial distance. The isotropic pressure component is a monotonic decreasing function of x and vanishes at a finite radial distance as shown in Fig. 2 . For a specific choice of \(c_4=-1\), the pressure vanishes at the small radial distance, \(x \le 2\) while for other choices it may vanish at a greater radial distance in future but this is of no consequence. We need to check for realistic matter whether the ECs: DEC (\(\rho -p > 0\)), WEC (\(\rho +p > 0\)), and SEC (\(\rho +4p > 0\)) are satisfied or not. Fig 3 confirms graphically that the DEC is satisfied for the assumed set of values of the model parameters in Fig. 3. The remaining energy conditions are trivially satisfied since \(\rho > 0\) and \(p > 0\) everywhere in the star. In order to maintain the stability criteria, the sound speed \(\frac{dp}{d\rho }\) should be casual, i.e. \(0<\frac{dp}{d\rho }<1\). We have shown graphically in Fig. 4 that the causality condition is partially violated at the lower range. Furthermore, the study of dynamical stability of any system can be characterized by an adiabatic index \(\Gamma <4/3\) for instability and \(\Gamma >4/3\) for stability. Here we find from Fig. 5 that with the given choice of parameters the model in not stable in the 5D case.

To understand the physical behavior in higher dimensional case of isotropic static EGB model, we now focus on 6D case.

7 The 6D case

In the six dimensional case, Eq. (18) assumes the form

$$\begin{aligned}&(4x+3)(x+1) x^2 (\bar{\alpha }-1) {\dot{f}} +x f \left( \bar{\alpha } (4x+1)(x+1) \right. \nonumber \\&\quad \times \left. {\dot{f}}-\left( 4 x^2+6 x+3\right) (\bar{\alpha }-1)\right) \nonumber \\&\quad -\bar{\alpha } (2 x+1)^2 f^2 = 0, \end{aligned}$$
(31)

and it is easy to write down the general solution to the cubic equation (19). Once again it is evident that a simple new solution can be found for the case \(\bar{\alpha } = 12\alpha C = 1\). In this case (31) reduces to the form

$$\begin{aligned} x (4x+1)(x+1) {\dot{f}}- (2 x+1)^2 f = 0, \end{aligned}$$
(32)

with simple solution

$$\begin{aligned} f(x) = \frac{c_5 x \root 3 \of {x+1}}{\root 3 \of {4 x+1}}. \end{aligned}$$
(33)

In order to finalize the model it is compulsory to achieve the matching of the first and second fundamental forms across a suitable boundary interface at \(r = R\). In the 6D case, the exterior Boulware–Deser potentials (12) may be expressed as

$$\begin{aligned} y^2 = Z = 1 + \frac{1}{12\alpha } \left( 1 - \sqrt{1 + \frac{48 M \alpha }{R^5}}\right) \end{aligned}$$
(34)

as adapted to our coordinate choice. A successful matching allows us to express the arbitrary constant C and the mandatory constant of integration \(c_5\) in the form

$$\begin{aligned} C= & {} \frac{1}{12\alpha } \left( 1-\sqrt{\frac{48 \alpha M+R^5}{R^5}}\right) \\ c_5= & {} \frac{\root 3 \of {4 C R^2+1} \left( 1- 12 \alpha C-\sqrt{\frac{48 \alpha M}{R^5}+1}\right) }{12 \alpha C \root 3 \of {C R^2+1}}. \end{aligned}$$

In conducting an analysis of the physical properties of the model, suitable values of C and \(c_5\) must be found to construct a model satisfying the physical constraints imposed. It will be seen that such choices exist so that viable models may be composed.

7.1 Physical analysis

Here we plug the following form

$$\begin{aligned} Z = 1 + x + \frac{c_5 x \root 3 \of {x+1}}{\root 3 \of {4 x+1}} ,\quad \text {and} \quad y = \sqrt{1+x}, \end{aligned}$$
(35)

in (8) and (9). The fundamental physical quantities, energy density and pressure are obtained as

$$\begin{aligned} \rho= & {} \frac{C (n-2) }{2 {\mathcal {X}}_1^{2} {\mathcal {X}}_2^{5}} \times [(\alpha c_{5}^{2} C {\mathcal {X}}_1 \left( 4 (n-1) x^2+(5 n-9) x+n-1\right) \nonumber \\&+c_{5}{\mathcal {X}}_2 (2 \bar{\alpha } C -1) \times \left( 4 (n-1) x^2+(5 n-7) x+n-1\right) \nonumber \\&+(n-1) {\mathcal {X}}_2^{5} {\mathcal {X}}_1^{2} (\bar{\alpha } C-1)], \end{aligned}$$
(36)
$$\begin{aligned} p= & {} -\frac{C (n-2)}{2 (x+1) {\mathcal {X}}_2^{2}} [\bar{\alpha } c_{5}^{2} \times C {\mathcal {X}}_1^{2} ((n-1) x+n-5)\nonumber \\&+c_{5}{\mathcal {X}}_1 {\mathcal {X}}_2 (2 \bar{\alpha } C+1)((n-1) x+n-3)\nonumber \\&+(n-1) (x+1) {\mathcal {X}}_2^{2} (\bar{\alpha } C+1)], \end{aligned}$$
(37)

where we have taken \({\mathcal {X}}_1=\root 3 \of {x+1}\) and \({\mathcal {X}}_2=\root 3 \of {4 x+1}\). They are given in Figs. 6 and 7.

Fig. 6
figure 6

Behavior of \(\rho \) for \(C=1\), \(n=6\) and various \(c_5\)

Fig. 7
figure 7

Behavior of \(p_r\) for \(C=1\), \(n=6\) and various \(c_5\)

The DEC plotted in Fig. 8 is obtained here for the 6D case

$$\begin{aligned} \rho - p= & {} [C (n-2) (\bar{\alpha } c_{5}^{2} C {\mathcal {X}}_1 (4 (n-1) x^2\nonumber \\&+5 (n-3) x+n-3)+c_{5}{\mathcal {X}}_2 (2 \bar{\alpha } C (4 (n-1)\nonumber \\&\times x^2+ (n\!-\!2) (5x\!+\!1))-3 x-1)\!+\!\bar{\alpha } C (n\!-\!1) {\mathcal {X}}_2^{5} \nonumber \\&\times {\mathcal {X}}_1^{2})] / [{\mathcal {X}}_1^{2} {\mathcal {X}}_2^{5}]. \end{aligned}$$
(38)
Fig. 8
figure 8

Behavior of \(\rho -p\) for \(C=1\), \(n=6\) and various \(c_5\)

Similarly the sound speed, and adiabatic index are plotted in Figs. 9 and 10 for this case, and they are obtained as

$$\begin{aligned} \frac{dp}{d\rho }= & {} -[{\mathcal {X}}_2^{3} (n {\mathcal {X}}_1^{3} (2 \bar{\alpha } c_{5}C {\mathcal {X}}_1\nonumber \\&+{\mathcal {X}}_2 (2 \bar{\alpha } C+1))-2 \bar{\alpha } C (7 c_{5}{\mathcal {X}}_1\nonumber \\&+ 5 {\mathcal {X}}_2)-9 x (2 \bar{\alpha } c_{5}C {\mathcal {X}}_1 \nonumber \\&+{\mathcal {X}}_2 (2 \bar{\alpha } C+1))-5 {\mathcal {X}}_2) ]/ [n {\mathcal {X}}_1^{3} {\mathcal {X}}_2^{3} (2 \bar{\alpha } c_{5}C {\mathcal {X}}_1\nonumber \\&+{\mathcal {X}}_2 (2 \bar{\alpha } C-1)) +12 x^2\nonumber \\&\times ({\mathcal {X}}_2 (1-2 \bar{\alpha } C) -2 \bar{\alpha } c_{5}C {\mathcal {X}}_1)\nonumber \\&+2 \bar{\alpha } C (c_{5}{\mathcal {X}}_1+{\mathcal {X}}_2)+x (7 {\mathcal {X}}_2 (1-2 \bar{\alpha } C)\nonumber \\&-18 \bar{\alpha } c_{5}C {\mathcal {X}}_1)-{\mathcal {X}}_2], \end{aligned}$$
(39)
$$\begin{aligned} \Gamma= & {} \left( \frac{\rho + p}{p} \right) \frac{dp}{d\rho } = [2 {\mathcal {X}}_1 (n {\mathcal {X}}_1^{3} (2 \bar{\alpha } c_{5}C {\mathcal {X}}_1\nonumber \\&+{\mathcal {X}}_2 (2 \bar{\alpha } C+1))-2 \bar{\alpha } C (7 c_{5}{\mathcal {X}}_1 +5 {\mathcal {X}}_2)\nonumber \\&-9 x (2 \bar{\alpha } c_{5}C {\mathcal {X}}_1+{\mathcal {X}}_2 (2 \bar{\alpha } C+1))\nonumber \\&-5 {\mathcal {X}}_2) (2 \bar{\alpha } c_{5}^{2} C (3 x+1) {\mathcal {X}}_1 +c_{5}{\mathcal {X}}_2 (2 (\bar{\alpha } C \nonumber \\&+x (3 \bar{\alpha } C+2 x+5)+1)-n {\mathcal {X}}_1^{3} {\mathcal {X}}_2^{3})\nonumber \\&-(n-1) {\mathcal {X}}_2^{5} {\mathcal {X}}_1^{2})] / [(\bar{\alpha } c_{5}^{2} C {\mathcal {X}}_1^{2} ((n-1) x\nonumber \\&+n-5)+c_{5}{\mathcal {X}}_1 {\mathcal {X}}_2 (2 \bar{\alpha } C+1) ((n-1) x+n-3)\nonumber \\&+(n-1) {\mathcal {X}}_1^{3} {\mathcal {X}}_2^{2} (\bar{\alpha } C+1)) \nonumber \\&\times (n {\mathcal {X}}_1^{3} {\mathcal {X}}_2^{3} (2 \bar{\alpha } c_{5}C {\mathcal {X}}_1 +{\mathcal {X}}_2 (2 \bar{\alpha } C-1))\nonumber \\&+12 x^2 ({\mathcal {X}}_2 (1-2 \bar{\alpha } C) -2 \bar{\alpha } c_{5}C {\mathcal {X}}_1)\nonumber \\&+2 \bar{\alpha } C (c_{5}{\mathcal {X}}_1+{\mathcal {X}}_2) +x (7 {\mathcal {X}}_2 (1-2 \bar{\alpha } C)\nonumber \\&-18 \bar{\alpha } c_{5}C {\mathcal {X}}_1)-{\mathcal {X}}_2)], \end{aligned}$$
(40)
Fig. 9
figure 9

Behavior of \(\frac{dp}{d\rho }\) for \(C=1\), \(n=6\) various \(c_5\)

Fig. 10
figure 10

Behavior of \(\Gamma \) for \(C=1\), \(n=6\) and various \(c_5\)

7.2 Discussion

In GR several approaches exist where an existing solution leads to a new solution. We have investigated this approach in EGB gravity. The resulting fluid equations in EGB theory are more difficult to solve because of the nonlinearity introduced through the Lanczos tensor. However it is still possible to make progress. We have obtained all the physical quantities for the 6D case with the given choice of parameters. All interesting physical features are represented graphically in Figs. 6, 7, 8, 9 and 10 for various values of constant \(c_5\) and the generic choice of \(\bar{\alpha }=\frac{n-3}{n-5}\). The density (Fig. 6) and isotropic pressure (Fig. 7) remains positive. Also, the pressure component is monotonically decreasing and vanishes at a finite radial distance, \(x \le 4\) with the choice of \(c_5=-2.06\). It can be observed that the other choices of \(c_5\) also allow pressure to vanish at a greater radial distance, which makes the 6D model more physically reliable. More interestingly the DEC (Fig. 8) is satisfied with the given choice of parameter values and within the radial distance \(x \le 5\). In case of model stability, the sound speed \(\frac{dp}{d\rho }\) (Fig. 9) and adiabatic index \(\Gamma \) (Fig. 10) are satisfied for all the stability requirements i.e. \(0<\frac{dp}{d\rho }<1\) and \(\Gamma >4/3\) within the radial distance \(x \le 5\). The sound speed satisfies the causality condition. The stability measures strongly confirms that the 6D EGB model is stable.

8 Conclusion

We have used an algorithm to generate new solutions to the EGB equations from an existing solution. We found explicit metric functions in 5 and 6 dimensions by solving a cubic equation. The solutions are given in terms of elementary functions which is remarkable considering the Abelian nature of the fundamental gravitation equation (16). A graphical analysis of the model was performed in both 5 and 6 dimensions. The five-dimensional model exhibits some nonphysical behavior. The six-dimensional solution satisfies the physical criteria and is therefore a more realistic model. Here we have exact solutions showing the difference in physical behavior between even and odd dimensions in EGB gravity. Finally we also should point that there exist other interesting approaches to find exact solutions involving placing a geometric restriction on the potentials. One such approach is due to Vaidya and Tikekar [40] and pursued by several authors including [41,42,43] in general relativity. Here the hypersurfaces \(t= constant\) are spheroidal and lead to models of superdense objects. This approach has proved to the useful in high dimensional general relativity and EGB gravity [44,45,46]. Models generated in this way are characterized by dimensions of the manifold and a spheroidal spacetime parameter.