1 Introduction

Nowadays it is of great interest to obtain models that describe compact structures, that is, massive objects with a small size, which configurations due to their high density, such as white dwarfs, neutron stars or more exotic stars such as those formed by quarks, constitute a real laboratory to investigate the regime of strongly coupled gravitational fields. For a long time the development of these models in order to describe and understand the behavior of the aforementioned objects was under the framework of the general relativity theory (GR). With great observational and experimental support [1] GR describes very well the gravitational interaction and its consequences in a four-dimensional spacetime. However, two questions arise: Is it possible to study gravity in less than four dimensions? Is it possible to study gravity in more than four dimensions? If so, what benefits and consequences would such studies bring about? In the first case, for a two-dimensional spacetime the Einstein tensor is zero. This is just the consequence of the Einstein–Hilbert Lagrangian being the two-dimensional Euler characteristic \(\chi \). This is a topological invariant in two dimensions, and therefore we cannot obtain equations of motion for our fields from it. In three dimensions we already have an Einstein tensor not identically zero, but we run into another problem. Now the number of independent components of the Riemann tensor is six: the same as the number of independent components of the Ricci tensor. So, Ricci-plane solutions, i.e., those with \(R_{\mu \nu }=0\), are solutions with vanishing Riemann tensor, not giving place to solutions of gravitational waves for example. We then end in the usual three spatial dimensions plus a temporal one. The previous discussion may already be enough to hope that the study in larger dimensions can bear fruit. Perhaps the dynamics resulting from the action of Einstein–Hilbert in four dimensions hides effects that in larger dimensions could become manifest. In fact, several theories have been favored in part to study a larger number of dimensions, such as Kaluza–Klein theory (adding an extra dimension to unify gravity with electromagnetism) or string theory (reaching a total of 11 dimensions in order to unify all the known interactions). Thus, in larger numbers of dimensions there is no reason to exclude quadratic, cubic terms, etc., of scalars formed from the Riemann tensor and its contractions. In this direction Lanczos [2] was the first to extend the GR including covariant high-order derivatives terms of the metric tensor, in order to study the scale invariance under \(g_{\mu \nu }\rightarrow \lambda g_{\mu \nu }\) transformation, \(\lambda \) being a constant parameter. Nevertheless, the quadratic term combination found by Lanczos in four dimensions did not contribute to the dynamics of the theory. This was because Lanczos was dealing with the four-dimensional Euler characteristic \(\chi \), which is a topological invariant in four dimensions just as the Einstein–Hilbert action is in two dimensions.

Lovelock [3], later generalized the Einstein–Hilbert action including terms of higher order, with the first-order term corresponding to the Einstein–Hilbert action and the second-order one to the Gauss–Bonnet (GB) Lagrangian. In a n-dimensional spacetime (with \(n\ge 5\)) the GB Lagrangian leads to second-order equations of motion, as is required. In the spirit of searching for compact structures, Einstein–Gauss–Bonnet (EGB) theory is promising. In the context of black holes, Boulware and Deser [4] generalized the higher-dimensional solutions in Einstein theory due to Tangherlini [5], obtained the exterior vacuum spacetime, i.e., the equivalent Schwarzschild solition in EGB theory. Moreover, the study by Ghosh and Deshkar [6] of Vaidya radiating black holes in EGB gravity revealed that the location of the horizons is changed from the standard four-dimensional gravity. In the cosmological and modified gravity theories context EGB gravity has received much attention [7,8,9,10,11,12,13,14,15,16,17]. Recently, Bamba et al. [18] have investigated the energy conditions in the cosmological scenario employing FLRW spacetime. On the other hand, regarding stellar interiors much interesting work available in the literature has been devoted to the study of the existence of collapsed structures [19,20,21,22]. Besides, Wright [23] has studied the maximum mass–radius ratio (Buchdahl’s limit [24]) in five-dimensional EGB gravity.

The study of a compact object driven by an anisotropic matter distribution has a long history. Since the pioneering work by Bowers and Liang [25] many researchers have been studying the properties and consequences of this type of structures [26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]. These well-known works explore diverse properties such as: mechanisms of stability and hydrodynamic equilibrium, the behavior of the material content through energy conditions, causality conditions, maximum limit of the mass–radius ratio, maximum value of the superficial redshift, etc. A recent work on the role played by the anisotropy on the properties mentioned above is [42] (see also the references therein).

Following this line, in this paper we construct a well behaved anisotropic fluid sphere in the five-dimensional EGB scenario, by using Tolman–Kuchowicz [43, 44] spacetime. This metric has been used by other authors in the study of anisotropic charged/uncharged interior solutions [45, 46]. So, the plan of this paper is as follows: in Sect. 2 we discuss Einstein–Gauss–Bonnet gravity in a five-dimensional spacetime.

In Sect. 3 we study the field equations and the mathematical solutions of EGB gravity within Tolman–Kuchowicz spacetime, obtaining the main salient features that characterize the model such as the energy-matter density \(\rho \), the radial pressure \(p_{r}\) and the tangential pressure \(p_{t}\) and the anisotropy factor \(\Delta \). In Sect. 4 we analyze the physical and mathematical behavior of the thermodynamic variables. In Sect. 5 we obtain the complete set of constant parameters, joining the inner geometry with exterior spacetime in a smooth way. Several physical properties are studied in Sects. 6, 7, 8 and 9, such as the causality condition, stability, equilibrium under different forces and energy conditions. Finally, in Sect. 11 we provide some remarks of the model obtained.

2 Field equations

We start with a brief description of Einstein–Gauss–Bonnet gravity without cosmological constant [47]. The action in the \(n\ (\ge 5\))-dimensional spacetime is given by

$$\begin{aligned} S=\int d^{n}x\sqrt{-g}\left[ \frac{1}{2\kappa ^{2}_{n}}\bigg (R+\alpha \mathcal {L}_{GB}\bigg )\right] +S_{\mathrm{{matter}}}, \end{aligned}$$
(1)

where \(\kappa _{n}=\sqrt{8\pi G_{n}}\) and R is the n-dimensional Ricci scalar. The last term in Eq. (1) represents the action for the matter fields. The Gauss–Bonnet term (also known as Lovelock’s second-order term [3]) compromises the combination of the Ricci scalar R, Ricci tensor \(R_{\mu \nu }\), and Riemann tensor \(R^{\omega }_{\ \beta \mu \nu }\). Explicitly the Gauss–Bonnet terms reads

$$\begin{aligned} \mathcal {L}_{GB}=R^{2}-4R_{\mu \nu }R^{\mu \nu }+R_{\omega \beta \mu \nu }R^{\omega \beta \mu \nu }. \end{aligned}$$
(2)

It is worth mentioning that in a four-dimensional spacetime the Gauss–Bonnet term (2) does not contribute to the field equations since it becomes a total derivative (It is related with a topological invariant, specifically the Euler characteristic). It should be noted that when the coupling constant \(\alpha \) is zero then GR results are recovered.

The action given by (1) can be obtained from the lower energy limit in the heterotic string theory. In such a case the coupling parameter \(\alpha \) is related with the inverse string tension and is positive definite. Therefore, we will consider \(\alpha \ge 0\) throughout the study. Variation of (1) with respect to the metric tensor \(g_{\mu \nu }\) yields the following field equations:

$$\begin{aligned} G_{\mu \nu }+\alpha H_{\mu \nu }=\kappa ^{2}_{n}T_{\mu \nu }, \end{aligned}$$
(3)

where \(G_{\mu \nu }\) and \(H_{\mu \nu }\) stand for the Einstein tensor and the Lanczos tensor, respectively. The corresponding expression for these tensors are given by

$$\begin{aligned} G_{\mu \nu }= & {} R_{\mu \nu }-\frac{R}{2}g_{\mu \nu }, \end{aligned}$$
(4)
$$\begin{aligned} H_{\mu \nu }= & {} 2\bigg [RR_{\mu \nu }-2R_{\mu \omega }R^{\omega }_{\ \nu }-2R^{\omega \beta }R_{\mu \omega \nu \beta } \nonumber \\&+R_{\mu }^{\ \omega \beta \gamma }R_{\nu \omega \beta \gamma }\bigg ]-\frac{1}{2}g_{\mu \nu }\mathcal {L}_{GB}. \end{aligned}$$
(5)

The energy-momentum tensor \(T_{\mu \nu }\) corresponding to the matter fields is obtained from \(S_{\mathrm{{matter}}}\).

So, by taking \(n=5\), the five-dimensional line element for a static spherically symmetric spacetime has the standard form

$$\begin{aligned} \mathrm{{d}}s^{2}= & {} -e^{2\nu (r)} \mathrm{{d}}t^{2} + e^{2\lambda (r)} \mathrm{{d}}r^{2} + r^{2}(\mathrm{{d}}\theta ^{2} + \sin ^{2}{\theta }~ \mathrm{{d}}\phi ^2\nonumber \\&+\sin ^{2}\theta \sin ^{2}\phi d\psi ^{2}), \end{aligned}$$
(6)

in coordinates (\(x^i = t,r,\theta ,\phi ,\psi \)). For our model the energy-momentum tensor for the stellar fluid is taken to be

$$\begin{aligned} T_{\mu \nu }=\mathrm{{diag}}\left( -\rho ,p_{r},p_{t},p_{t},p_{t}\right) , \end{aligned}$$
(7)

where \(\rho \), \(p_{r}\), and \(p_{t}\) are the proper energy density, the radial pressure, and the tangential pressure, respectively. By considering the comoving fluid velocity as \(u^a=e^{-\nu }\delta _0^a\), the EGB field equation (3) leads to the following set of independent equations:

$$\begin{aligned} \kappa \rho= & {} \frac{3}{e^{4\lambda } r^{3}} \left( 4\alpha \lambda '+re^{2\lambda }-re^{4\lambda }- r^2 e^{2\lambda }\lambda ' -4\alpha e^{2\lambda }\lambda '\right) ,\nonumber \\ \end{aligned}$$
(8)
$$\begin{aligned} \kappa p_r= & {} \frac{3}{e^{4\lambda }r^3} \left[ (r^2 \nu ' +r +4\alpha \nu ')e^{2\lambda }-re^{4\lambda } -4\alpha \nu '\right] , \end{aligned}$$
(9)
$$\begin{aligned} \kappa p_t= & {} \frac{1}{e^{4\lambda }r^2} \left( 12 \alpha \nu ' \lambda '- e^{4\lambda }- 4\alpha \nu '' -4 \alpha \nu '^2\right) \nonumber \\&+\frac{1}{e^{2\lambda }r^2} \left( 1- r^2 \nu ' \lambda ' +2r \nu '-2r \lambda ' +r^2\nu '^2 \right) \nonumber \\&+\frac{1}{e^{2\lambda }r^2} \left( r^2 \nu '' -4\alpha \nu '\lambda ' + 4\alpha \nu '^2 +4\alpha \nu ''\right) . \end{aligned}$$
(10)

Besides, we have considered units such that the speed of light c and the constant \(G_{5}\) are set to unity. Then \(\kappa =8\pi \). Here \(\prime \) denotes differentiation with respect to the radial coordinate r.

3 Solution of the field equations

To solve the above field equations (8)–(10) we choose \(\lambda (r)= \ln (1 + ar^2 + br^4)\) and \(\nu = Br^2 + 2 \ln C\) with a, b, B and C as constants. These metric potentials conform to the well-known Tolman–Kuchowicz [43, 44] spacetime. This choice on \(e^{\lambda }\) and \(e^{\nu }\) is well motivated because both metric potentials are free from physical and mathematical singularities at every point inside the compact star. Moreover, at the center of the structure they have the appropriate behavior, i.e., \(e^{\lambda (r)}|_{r=0}=1\) and \(e^{\nu (r)}|_{r=0}=C^{2}\), which implies \((e^{\lambda })^{\prime }|_{r=0}=(e^{\nu })^{\prime }|_{r=0}=0\), as is required for a well behaved model. The trend of the inner geometry is displayed in the upper panel of Fig. 1. A completely regular behavior is observed, also as \(\alpha \) grows \(e^{\lambda }\) and \(e^{\nu }\) take higher values, in distinction with GR whose values are dominated by those of EGB theory for all r. So, inserting \(e^{\lambda }\) and \(e^{\nu }\) into Eqs. (8)–(10) we arrive at

$$\begin{aligned} \kappa \rho= & {} \frac{3}{r^3 \Psi ^4}\Big [8 \alpha r (a + 2 b r^2) \Psi -\frac{8 \alpha r (a + 2 b r^2)}{\Psi } \nonumber \\&+ 2 r^3 (a + 2 b r^2) \Psi - r \Psi ^2 + r \Psi ^4)\Big ] ,\end{aligned}$$
(11)
$$\begin{aligned} \kappa p_r= & {} \frac{3}{r^3 \Psi ^4}\Big [(r + 8 \alpha B r + 2 B r^3) \Psi ^2 -8 \alpha B r - r \Psi ^4\Big ],\nonumber \\ \end{aligned}$$
(12)
$$\begin{aligned} \kappa p_t= & {} \frac{1}{\Psi ^5}\Big [48 \alpha B (a + 2 b r^2) +8 \alpha B (a - 2 B + b r^2) \Psi \nonumber \\&-\, 4 \Big (a - 2 B + 2 a \alpha B + B_1 r^2\Big ) \Psi ^2 - (a + b r^2) \Psi ^4 \nonumber \\&-\, \Psi ^3 \Big \{a + 2 B + b r^2 - 4 B^2 (4 \alpha + r^2)\Big \}\Big ]. \end{aligned}$$
(13)

The anisotropic factor defined by \(\Delta \equiv p_{t}-p_{r}\) is obtained:

$$\begin{aligned} \kappa \Delta= & {} \frac{2}{\Psi ^5} \Big [24 \alpha B (a + 2 b r^2) -8 \alpha B (a + B + b r^2) \Psi \nonumber \\&-\, 2 (a - 2 B + 8 a \alpha B + B_2 r^2) \Psi ^2 + (a + b r^2) \Psi ^4 \nonumber \\&+\, \Psi ^3 \Big \{a + b r^2 + 2 B (-2 + 4 \alpha B + B r^2)\Big \}\Big ] \end{aligned}$$
(14)

where

$$\begin{aligned} B_1= & {} -a B + b (2 + 6 \alpha B),\\ \Psi= & {} (1 + a r^2 + b r^4),\\ B_2= & {} -a B + 2 b (1 + 6 \alpha B). \end{aligned}$$
Fig. 1
figure 1

Variation of metric potentials for 4U 1538-52 using the parameter provided in Table 1

Fig. 2
figure 2

Variation of density for 4U 1538-52 using the parameter provided in Table 1

Fig. 3
figure 3

Variation of pressures for 4U 1538-52 using the parameter provided in Table 1

Fig. 4
figure 4

Variation of anisotropy for 4U 1538-52 using the parameter provided in Table 1

The behavior of the metric function, density, pressure, anisotropy and equation of state parameter are given in Figs. 1, 2, 3, 4 and 5. The interior red-shift can be found to be

$$\begin{aligned} z(r) = e^{-\nu /2}-1 \end{aligned}$$
(15)

and its trend in shown in Fig. 6.

Fig. 5
figure 5

Variation of the equation of state parameters for 4U 1538-52 using the parameter provided in Table 1

Fig. 6
figure 6

Variation of gravitation red-shift for 4U 1538-52 using the parameter provided in Table 1

4 Physical analysis

In this section we study and analyze the behavior of the main physical salient features of the model. These correspond to the thermodynamic variables, i.e., the energy-density \(\rho \), the radial pressure, \(p_{r}\), and the tangential pressure, \(p_{t}\). It is well known that a purely theoretical well behaved compact object from the physical and mathematical point of view must satisfy some general requirements in order to compare with the astrophysical observational data. Mainly, these general criteria say that the thermodynamic parameters must be monotonically decreasing functions at all points within the configuration from the center towards the surface of the object. Obviously, such a behavior means that the maximum value of each of these physical quantities is attained at the center of the star. So, by means of the second derivative criteria we have

$$\begin{aligned} \kappa \frac{\mathrm{{d}}\rho }{\mathrm{{d}}r}= & {} -\frac{6r}{\Psi ^6}\Big [(a^2 + b + a b r^2) \Psi ^4 + 2 (a^2 {+} 8 b {+} a b r^2) \Psi ^3 \nonumber \\&+40 \alpha (a^2 - 4 b) (a + b r^2)+8 a \alpha \Psi \Big \{4 a (a + b r^2) \nonumber \\&+b\Big \}+ b \Psi ^5+2 \Psi ^2 \Big \{3 a^2 + 52 a \alpha b +12 b (4 \alpha b r^2 \nonumber \\&-1)\Big \}\Big ] , \end{aligned}$$
(16)
$$\begin{aligned} \kappa \frac{\mathrm{{d}}p_r}{\mathrm{{d}}r}= & {} \frac{6r}{\Psi ^5}\Big [(a^2 + b + a b r^2)-32 \alpha B (a^2 - 2 b + a b r^2) \nonumber \\&\times \Psi ^3 + 2 \Big \{A_3 {+} b (a {-} 4 B) r^2\Big \} \Psi ^2 +b \Psi ^4 - 8 \alpha B \Psi \nonumber \\&\times \Big \{b + 3 a (a + b r^2)\Big \}\Big ] ,\end{aligned}$$
(17)
$$\begin{aligned} \kappa \frac{\mathrm{{d}}p_t}{\mathrm{{d}}r}= & {} \frac{2r}{\Psi ^6}\Big [240 \alpha (4B-a^2) B -32 \alpha B \Big \{a^2 + 25 b \nonumber \\&-2 a B+ b (a - 4 B) r^2\Big \}\nonumber \\&\times \Psi + (a^2 + b - 12 B^2 + a b r^2) \nonumber \\&\times \Psi ^4+b \Psi ^5 +4 \Psi ^2 \Big \{-6 a \alpha b B r^2 +3 a^2 (1 + 2 \alpha B \nonumber \\&+ B r^2)-2 b (6 + 25 \alpha B + 6 B r^2)\Big \} + 2 \Psi ^3 \Big \{a^2 \nonumber \\&+ 18 b- 8 a B (1 + 2 \alpha B) +a (b + 4 B^2) r^2 \nonumber \\&+ 4 B \big [2 B + b r^2 + \alpha b (15 - 8 B r^2)\big ]\Big \}\Big ]. \end{aligned}$$
(18)

Then at the center of the star

$$\begin{aligned} \kappa \rho ''= & {} -18 (1 + 8 a \alpha ) (3 a^2 - 2 b)<0,\\ \kappa p_r''= & {} -6 \Big \{4 a B + 2 b (1 - 8 \alpha B) + a^2 (56 \alpha B-3)\Big \}<0 ,\\ \kappa p_t''= & {} a^2 (30 - 496 \alpha B) + 32 a B (2 \alpha B-1)\\&+ 4 \Big \{2 B^2 + 5 b (8 \alpha B-1)\Big \}<0. \end{aligned}$$

Additionally, in order to ensure a positive definite \(\rho \), \(p_{r}\) and \(p_{t}\) throughout the compact object, the central density and central pressure must be positive at \(r=0\). Hence, from Eqs. (8) to (10) we get

$$\begin{aligned} \kappa \rho _c= & {} 12 a (1 + 4 a \alpha )>0 , \end{aligned}$$
(19)
$$\begin{aligned} \kappa p_c= & {} 6 [B + a (8 \alpha B-1)]>0. \end{aligned}$$
(20)

It is clear from Eqs. (19)–(20) that

$$\begin{aligned} a>0 \quad \text{ and } \quad B>\frac{a}{1+8a\alpha }. \end{aligned}$$
(21)

Moreover, it is also required to ensure that any physical fluid satisfies the Zeldovich criterion i.e. \(p_{rc}/ \rho _c \le 1\), which implies

$$\begin{aligned} \frac{p_{rc}}{\rho _c} = \frac{B+a\left( 8B\alpha -1\right) }{2a\left( 1+4a\alpha \right) } \le 1. \end{aligned}$$
(22)

On the other hand, regarding the anisotropy factor \(\Delta =p_{t}-p_{r}\) given by Eq. (14) plays an important role in the stellar matter distribution. In the study of anisotropic matter distributions, a well behaved model has a monotonically increasing anisotropy factor with increasing radial coordinate r at all its interior points. It means that \(\Delta >0\) everywhere within the star. Explicitly the former requirement reads

$$\begin{aligned} \Delta (r)= \left\{ \begin{array}{lcc} 0, &{} \quad \text{ if } &{} r=0, \\ \\ p_{t}(R), &{} \quad \text{ if } &{} r=R. \end{array}\right. \end{aligned}$$
(23)

The first statement of (23) ensures the regularity of the solution in the origin, besides that this allows for the possibility that the inner geometry is regular not only at the center of the structure but in all points. Vanishing \(\Delta \) at the center purports \(p_{r}(0)=p_{t}(0)\). This fact is a consequence of matter collineation induced by the Killing vector fields of the spherical symmetry. The second statement of (23) says that at the boundary of the star \(\Sigma \) (defined by \(r=R\), where R stands for the radius of the object), \(p_{r}(R)=0\) and in consequence \(\Delta (R)=p_{t}(R)>0\), implying \(\Delta (r)>0\) for \(0\le r\le R\). As pointed out earlier one needs positive thermodynamic variables throughout the star. Furthermore, a positive anisotropy factor introduces in the system a repulsive force (outward) that helps to counteract the gravitational gradient. The presence of a repulsive anisotropic force allows for the construction of more compact objects [40]. In addition, it contributes to an enhancement of the equilibrium and stability mechanism. From Figs. 2 and 3 for different values of the parameter \(\alpha \), we can see the behavior of the energy density \(\rho \) (Fig. 2), both the radial pressure, \(p_{r}\), and the transverse pressure, \(p_{t}\) (Fig. 3), and the anisotropy factor \(\Delta \) (Fig. 4) against the radial coordinate inside the star. It is observed that for \(10\le \alpha \le 50\) (EGB gravity) the maximum values reached by all the physical quantities is less than the values reached by GR theory (\(\alpha \rightarrow 0\)). Moreover, the anisotropy factor is greater in GR theory than in EGB theory. We also observe that as \(\alpha \) increases the anisotropy decreases at each interior point of the configuration. The effect of the EGB term is to diminish the relative difference between the radial and tangential stresses. This may be a possible mechanism to achieving pressure isotropy within the stellar interior. Besides, Fig. 5 shows the behavior of the ratios \(p_{r}/\rho \) and \(p_{t}/\rho \). It is appreciated that Zeldovich’s condition is satisfied.

5 Exterior spacetime and matching conditions

In order to obtain the constant parameters that characterize the model, i.e., a, b, B and C it is necessary to match in a smooth way the internal manifold \(\mathcal {M}^{-}\) given by Tolman–Kuchowicz [43, 44] spacetime with the static exterior spacetime \(\mathcal {M}^{+}\) in 5-D which is described by the Einstein–Gauss–Bonnet–Schwarzschild solution [4],

$$\begin{aligned} \mathrm{{d}}s^{2}= & {} -F(r) \mathrm{{d}}t^{2} + [F(r)]^{-1} \mathrm{{d}}r^{2} + r^{2}\left( \mathrm{{d}}\theta ^{2} + \sin ^{2}{\theta } ~ \mathrm{{d}}\phi ^2\right. \nonumber \\&\left. +\sin ^{2}\theta \sin ^{2}\phi d\psi ^{2}\right) , \end{aligned}$$
(24)

where

$$\begin{aligned} F(r) =1+\frac{r^2}{4 \alpha } \left( 1-\sqrt{1+\frac{8\alpha M}{r^4}}\right) . \end{aligned}$$
(25)

In (25) M is associated with the gravitational mass of the hypersphere. It is remarkable that when \(\alpha \rightarrow 0\) the usual Schwarzschild solution is recovered. So, joining the inner and exterior spacetime demands the compliance of the first and second fundamental forms. These matching conditions are known as Israel–Darmois junction conditions [48, 49] in GR. Nevertheless, in higher-dimensional theories Israel–Darmois matching conditions should be adapted or modified. Actually, in Einstein–Gauss–Bonnet gravity theory the corresponding or equivalent Israel–Darmois junction conditions in the arena of the study concerning compact configurations are still unknown. On the other hand, in the brane-world framework regarding the cosmological scenario, Israel–Darmois conditions were explored [50]. Taking into account these antecedents one can infer some insights of how to proceed in the compact structure context.

In obtaining the field equations from (1) by taking variations with respect to the metric tensor \(g_{\mu \nu }\) (this metric tensor describes the geometry of the higher-dimensional manifold) one gets Eq. (3) plus a boundary term (BT) given by

$$\begin{aligned} \text {BT}{=}-\frac{1}{\kappa ^{2}}\int _{\Omega } d^{4}x\sqrt{-h}n_{\mu }\left( g^{\mu [\nu }g^{\epsilon ]\omega }{+}2\alpha P^{\mu \nu \epsilon \omega }\right) \nabla _{\omega }\delta g_{\nu \epsilon },\nonumber \\ \end{aligned}$$
(26)

where h is the determinant of the induced metric \(h_{\mu \nu }=g_{\mu \nu }-n_{\mu }n_{\nu }\) on the \(\Omega \) manifold and \(P_{\mu \nu \epsilon \omega }\) corresponds to the divergence free part of the Riemann tensor. As can be seen Eq. (26) compromises normal derivatives of the metric variation. In considering GR this term can be cancelled out after integration by parts by assuming without loss of generality an asymptotically flat spacetime without boundary or by adding a suitable boundary term to the Einstein–Hilbert action in order to kill them. This specific term is referred to the Gibbons–Hawking boundary term [51]. However, in this case this assumption of asymptotically flat spacetime is not valid anymore, because the embedded spacetime \(\Omega \) could contain a boundary. So, in order to cancel out the boundary term provided by the ambient \(\mathcal {M}\) spacetime on the induced one \(\Omega \) the best option is to incorporate into the action the corresponding Gibbons–Hawking boundary term. In the case of Einstein–Gauss–Bonnet theory this term was found in [52]. So, after taking variations with respect to the metric tensor of the ambient spacetime one arrives at the field equations (3) on \(\mathcal {M}\) and

$$\begin{aligned}&2\langle K_{\mu \nu }-Kh_{\mu \nu }\rangle +4\alpha \langle 3J_{\mu \nu }-Jh_{\mu \nu }\nonumber \\&+2\hat{P}_{\mu \epsilon \omega \nu }K^{\epsilon \nu }\rangle =-\kappa ^{2}S_{\mu \nu }, \end{aligned}$$
(27)

where \(K_{\mu \nu }\) is the extrinsic curvature tensor of the hypersurfaces \(\Omega \), K its trace and \(J_{\mu \nu }\) a symmetric tensor [50]. Besides, the circumflex accent and \(\langle \rangle \) represent quantities associated with the induced metric \(h_{\mu \nu }\) and the average of a quantity over two sides of the hypersurfaces \(\Omega \), respectively. As said before, the previous discussion concerns the cosmological scenario in the brane-world context. In principle, the same procedure could be utilized in order to derive the corresponding Israel–Darmois junction conditions in the context of compact stars studies. In this concern, the Gauss–Bonnet combination presents a good behavior, coherent with the fact that Eq. (1) is unique in five dimensions like Einstein–Hilbert gravity is in four dimensions. Hence we can expect a regular gravity theory and hence regular boundary conditions [53]. Therefore, in principle the well-known Israel–Darmois matching conditions could be translated from four dimensions to higher ones without problems. So, the first fundamental from consists in the continuity of the metric potentials across the boundary \(\Sigma \). Explicitly

$$\begin{aligned} \left[ ds^{2}\right] _{\Sigma }= & {} 0, \end{aligned}$$
(28)
$$\begin{aligned} e^{\lambda ^{-}}|_{r=R}= & {} e^{\lambda ^{+}}|_{r=R} ,\quad \text{ and } \quad e^{\nu ^{-}}|_{r=R}=e^{\nu ^{+}}|_{r=R}, \end{aligned}$$
(29)

and the first derivative of the \(g_{tt}\) metric component gives,

$$\begin{aligned} \left( \frac{\partial e^{\nu ^{-}}}{\partial r}\right) _{|r=R}=\left( \frac{\partial e^{\nu ^{+}}}{\partial r}\right) _{|r=R}; \end{aligned}$$
(30)

ensures the fulfillment of the second fundamental form, which reads

$$\begin{aligned} p_{r}(R)=0. \end{aligned}$$
(31)

This condition determines the object size. This is so because the pressure decreases as we approach the surface and the pressure at the exterior of the star must be null, then this will correspond to the star boundary. In other words, the second fundamental form says that the matter distribution is confined in a finite spacetime region; in consequence the star does not expand indefinitely beyond \(\Sigma \). Therefore, from the first fundamental form we obtain

$$\begin{aligned} \frac{1}{1+aR^2+bR^4}= & {} 1+\frac{R^2}{4 \alpha } \left( 1-\sqrt{1+\frac{8\alpha M}{R^4}}\right) , \end{aligned}$$
(32)
$$\begin{aligned} C^2e^{BR^{2}}= & {} 1+\frac{R^2}{4 \alpha } \left( 1-\sqrt{1+\frac{8\alpha M}{R^4}}\right) , \end{aligned}$$
(33)
$$\begin{aligned} 2B C^2e^{BR^{2}}= & {} -\frac{1}{2\alpha }\frac{1-\sqrt{1+\frac{8\alpha M}{R^{4}}}}{\sqrt{1+\frac{8\alpha M}{R^{4}}}}, \end{aligned}$$
(34)

and from the second fundamental form we get

$$\begin{aligned}&\left( R+8BR\alpha +2BR^{3}\right) \left( 1+aR^{2}+bR^{4}\right) ^{2} -8BR\alpha \nonumber \\&\quad -R\left( 1+aR^{2}+bR^{2}\right) ^{4}=0. \end{aligned}$$
(35)

Equations (32)–(35) are the necessary and sufficient conditions to determine the complete set of constant parameters \(\{a,b,B,C\}\) that describe the model.

6 Causality condition

For any model describing a stellar interior, the subliminal sound speed of the pressure waves must be less than the speed of light. In the treatment of anisotropic fluids, the propagation of the pressure waves is along the main directions of the object, i.e., the radial and transverse directions. The subliminal sound speeds along these directions are defined by

$$\begin{aligned} v_{r}=\sqrt{\frac{\mathrm{{d}}{p}_{r}}{\mathrm{{d}}{\rho }}} \quad \text{ and } \quad v_{t}=\sqrt{\frac{\mathrm{{d}}{p}_{t}}{\mathrm{{d}}{\rho }}}. \end{aligned}$$
(36)

So, in order to obtain a physically admissible model, both speeds, \(v_{r}\) and \(v_{t}\), must be bounded by the speed of light. This is the so-called causality condition. Causality means that pressure (sound) waves in the fluid do not propagate at arbitrary speeds. On the other hand, in distinction with what happens in the case of an isotropic fluid (in this case the pressure waves propagate only in one direction because \(p_{r}=p_{t}\)), the speed behavior within the star against the radial coordinate in decreasing. However, this is not true in the case where there is anisotropy, since the behavior of the speed depends on the rigidity of the material. So, the causality condition reads

$$\begin{aligned} 0\le v_{r}\le 1 \quad \text{ and }\quad 0\le v_{t}\le 1, \end{aligned}$$
(37)

where the speed of light was taken to be \(c=1\). Preservation/non-preservation of the causality condition (37) has strong implications on the matter distribution within the structure. This is so because it is related with the behavior of the energy-momentum tensor, which describes the material content. Preservation of causality yields a well-defined energy-momentum tensor. Additionally, the fact of having different speeds in the directions, mentioned above, influences the stability of the system.

Now at the center of the star the subliminal sound speeds are

$$\begin{aligned} v_{r0}^2= & {} \frac{4 a B + 2 b (1 - 8 \alpha B) + a^2 (-3 + 56 \alpha B)}{3 (1 + 8 a \alpha ) (3 a^2 - 2 b)} , \end{aligned}$$
(38)
$$\begin{aligned} v_{t0}^2= & {} \frac{1}{9 (1 + 8 a \alpha ) (3 a^2 - 2 b)}\Big [-4 B^2 + b (10 - 80 \alpha B) \nonumber \\&+ 16 a B (1 - 2 \alpha B) + a^2 (-15 + 248 \alpha B)\Big ]. \end{aligned}$$
(39)

Equations (38)–(39) impose some restrictions on \(\{a,b,B\}\) in order to preserve the causality condition. Figure 7 (upper panel) exhibits the trend of both speeds throughout the configuration. As we can see EGB theory dominates GR in both directions. Besides, the speed of the radial and tangential subliminal sound pressure waves are decreasing in nature and as \(\alpha \) increases they take higher values at the center of the star. Otherwise we have increasing radius.

Fig. 7
figure 7

Variation of sound speed for 4U 1538-52 using the parameter provided in Table 1

7 Stability mechanisms: relativistic adiabatic index and Abreu’s criterion

In this section we analyze an important mechanism—the stability mechanism. The general theory of stability is complicated since many variables can change at the same time. Therefore maintaining consistency can be a difficult task. Within this branch there are some heuristic methods of determining stability, such as relativistic adiabatic index [54, 55], Abreu’s criterion [56] (based on Herrera’s cracking concept [34]), static stability criterion [57, 58], and Ponce De Leon’s criterion [59]. This clearly suggests that the study of stability of compact objects can only be carried out in a tentative manner, that is, there is no mechanism to test whether an astrophysical system is stable from a global point of view. However, these heuristic mechanisms, even if only in a tentative manner, allow us to check how stable an anisotropic matter distribution is, which is susceptible to radial disturbances due to the presence of repulsive forces in the case \(\Delta >0\) (in the case of attractive forces, which occurs when \(\Delta <0\) and the system is also under disturbances of the radial type). So, in this case we use the first two, i.e., the relativistic adiabatic index and Abreu’s criterion. The former gives the ratio of two specific heats; it is defined by

$$\begin{aligned} \Gamma _r= & {} \frac{\rho +p_r}{p_r}v_r^2 \nonumber \\= & {} \frac{\chi _1 \Big \{1 + (4 \alpha + r^2) (a + b r^2) (2 + a r^2 +b r^4)\Big \}}{\Psi \big [2 B - (a + b r^2) (2 + a r^2 + b r^4) \chi _2\big ]}v_r^2,\nonumber \\ \end{aligned}$$
(40)
$$\begin{aligned} \Gamma _t= & {} \frac{\rho +p_t}{p_t}v_t^2 \nonumber \\= & {} \frac{2}{\zeta }\Big [A_1 + 3 A_2 r^2 +2 A_3 r^4 + A_4 r^6 + A_5 r^8 +A_6 r^{10} \nonumber \\&+2 b^2 A_7 r^{12} + 4 a b^3 r^{14} + b^4 r^{16} - \chi _3\Big ]v_t^2, \end{aligned}$$
(41)

where

$$\begin{aligned} \chi _1= & {} 2 \Big (a + B + (2 b + a B) r^2 +b B r^4\Big ),\\ \chi _2= & {} 2 a r^2- 8 \alpha B - 2 B r^2 + r^4 (2 b + [a + b r^2]^2) +1 ,\\ \chi _3= & {} \frac{12 \alpha \Big (a + 4 B + 2 (b + a B) r^2\Big )}{1 + a r^2 + b r^4},\\ \chi _4= & {} \frac{48 \alpha B r^2 (a + 2 b r^2)}{1 + a r^2 + b r^4},\\ \chi _5= & {} \frac{-3 + 2 B r^2 + (4 + 2 a r^2)}{ 1 + a r^2 + b r^4},\\ \chi _6= & {} -7 b r^2 + 4 B \Big (1 - b r^4 + B (r^2 + b r^6)\Big )\\&+ a (-3 + 4 B^2 r^4) ,\\ \zeta= & {} \chi _4 -8 \alpha B - 16 \alpha B^2 r^2 - \Psi ^4 \\&+2 B \Psi ^2 (r^2 +4 \alpha \chi _5)+ \Psi (1 +r^2 \chi _6), \end{aligned}$$

where the constants \(A_i\) (\(i=1,2,\ldots ,7\)) are given by

$$\begin{aligned} A_1= & {} 12 \alpha (a + 4 B),\\ A_2= & {} a + 4 a^2 \alpha + 8 \alpha b + B,\\ A_3= & {} B^2 + b (2 - 4 \alpha B) + a^2 (3 - 2 \alpha B) + 2 a (9 \alpha b \\&+ B+ 4 \alpha B^2),\\ A_4= & {} 4 a^3 + 13 a b + 24 \alpha b^2 + (a^2 + 2 b - 16 a \alpha b) B \\&+ 4 (a + 2 a^2 \alpha + 4 \alpha b) B^2 , \\ A_5= & {} 12 a^2 b +7 b^2 - 12 \alpha b^2 B + 2 (a^2 + 2 b + 8 a \alpha b) B^2 \\&+ a^4, \\ A_6= & {} b \Big [4 a^3 + b B (-1 + 8 \alpha B) + 4 a (3 b + B^2)\Big ],\\ A_7= & {} 3 a^2 + 2 b + B^2 .\end{aligned}$$

Equations (40)–(41) provide the relativistic adiabatic indices in the radial direction, \(\Gamma _{r}\), and in the tangential direction, \(\Gamma _{t}\). However, it should be noted that in the event of a gravitational re-collapse of the structure, it is sufficient to study the behavior of the relativistic adiabatic index in the radial direction, since the compression of the object due to the gravitational force would occur in that direction. Bondi’s pioneering work [54] has shown that \(\Gamma >4/3\) is the condition for the stability of a Newtonian isotropic matter distribution. This condition is very different in the case of anisotropic relativistic fluid spheres, because the stability will depend on the type of anisotropy. Then the stability condition for an anisotropic relativistic sphere is given by [31,32,33]

$$\begin{aligned} \Gamma >\frac{4}{3}+\left[ \frac{1}{3}\kappa \frac{\rho _{0}p_{r0}}{|p^{\prime }_{r0}|}r+\frac{4}{3}\frac{\left( p_{t0}-p_{r0}\right) }{|p^{\prime }_{r0}|r}\right] _{\max } \end{aligned}$$
(42)

where \(\rho _{0}\), \(p_{r0}\) and \(p_{t0}\) are the initial density, radial and tangential pressure when the fluid is in static equilibrium. The second term in the right hand side represents the relativistic corrections to the Newtonian perfect fluid and the third term is the contribution due to anisotropy. It is clear from (42) that if we have a non-relativistic perfect fluid matter distribution the bracket vanishes and we recast the collapsing Newtonian limit in the form \(\Gamma <4/3\). Heintzmann and Hillebrandt [55] showed that in the presence of a positive and increasing anisotropy factor \(\Delta =p_{t}-p_{r}>0\), the stability condition for a relativistic compact object is given by \(\Gamma >4/3\). This is so because a positive anisotropy factor may slow down the growth of an instability. In Fig. 8 it has been shown that \(\Gamma _{r}, \Gamma _{t}>4/3\) everywhere within the stellar interior for both EGB and GR theories. Therefore, from the relativistic adiabatic index point of view our model is stable.

On the other hand, Abreu’s criterion [56] basically consists in contrasting the speeds of the pressure waves in the two principal directions of the spherically symmetric star: the subliminal radial sound speed with the subliminal tangential sound speed; and then based on those values at particular points in the object one could potentially conclude whether the system is stable or unstable under the cracking instability. The cracking process is the mechanism to study instability when anisotropy matter distributions are present [34]. Nevertheless, this mechanism can be characterized most easily through the subliminal speed of pressure waves. Furthermore, from the causality condition one has \(0\le v^{2}_{r}\le 1\) and \(0\le v^{2}_{t}\le 1\), which implies \(0\le |v^{2}_{t}-v^{2}_{r}|\le 1\). Explicitly it reads

$$\begin{aligned}&-1\le v^{2}_{t}-v^{2}_{r}\le 1 \nonumber \\&\quad = \left\{ \begin{array}{ll} -1\le v^{2}_{t}-v^{2}_{r}\le 0~~ &{} \mathrm {Potentially\ stable\ } ,\\ 0< v^{2}_{t}-v^{2}_{r}\le 1 ~~ &{} \mathrm {Potentially\ unstable}. \end{array} \right\} ~~ \end{aligned}$$
(43)

So, the principal aim of Abreu’s criterion is that if the subliminal tangential speed \(v^{2}_{t}\) is larger than the subliminal radial speed \(v^{2}_{r}\); then instability regions may occur in the object, rendering the latter an unstable configuration. So, with the help of a graphical analysis one can determine the potentially stable/unstable regions inside the star and then conclude whether the system is stable or not, at least locally. From Fig. 9 it is appreciated that the system presents all the regions completely stable for all values of \(\alpha \), including GR. However, GR seems to be more stable than EGB theory, because the stability factor takes smaller values between \(-1\) and 0 with respect to EGB theory.

Fig. 8
figure 8

Variation of adiabatic index for 4U 1538-52 using the parameter provided in Table 1

Fig. 9
figure 9

Variation of stability factor for 4U 1538-52 using the parameter provided in Table 1

8 Energy conditions

The matter content that makes up astrophysical bodies can be composed of a large number of material fields. Although the components that constitute the matter distribution are known, it could be very complex to describe the concrete form of the energy-momentum tensor. Indeed, one has some ideas on the behavior of the matter under extreme conditions of density and pressure.

Nonetheless there are certain inequalities which are physically reasonable to assume to check the conduct of the energy-momentum tensor at every point inside the star. These inequalities are known as energy conditions. We have the null energy condition (NEC), the strong energy condition (SEC) and the weak energy condition (WEC). Explicitly, these are given by

$$\begin{aligned}&\text {WEC}{:} T_{\mu \nu }l^\mu l^\nu \ge 0~\text{ or }~\rho \ge 0,~\rho +p_i \ge 0 , \end{aligned}$$
(44)
$$\begin{aligned}&\text {NEC}{:} T_{\mu \nu }t^\mu t^\nu \ge 0~\text{ or }~ \rho +p_i \ge 0 , \end{aligned}$$
(45)
$$\begin{aligned}&\text {SEC}{:} T_{\mu \nu }l^\mu l^\nu + {1 \over 2} T^\lambda _\lambda l^\sigma l_\sigma \ge 0 ~\text{ or }~ \rho +\sum _i p_i \ge 0, \end{aligned}$$
(46)

where \(i\equiv (\mathrm{{radial}}~r, \mathrm{{transverse}} ~t),~l^\mu \) and \(t^\mu \) are timelike vector and null vector, respectively. To verify a well behaved energy-momentum tensor everywhere within the compact structure the above inequalities must be satisfied simultaneously. In Fig. 10, we have plotted the LHSs of the above inequalities, which verifies that all the energy conditions are satisfied at the stellar interior.

Moreover, from the physical point of view NEC means that an observer traversing a null curve will measure the ambient (ordinary) energy density to be positive. WEC implies that the energy density measured by an observer crossing a timelike curve is never negative. SEC purports that the trace of the tidal tensor measured by the corresponding observers is always non-negative [60]. Furthermore, violations of energy conditions have sometimes been presented as only being produced by unphysical stress energy tensors. Usually SEC as used as a fundamental guide will be extremely idealistic. Nevertheless, SEC is violated in many cases, e.g. in minimally coupled scalar field and curvature-coupled scalar field theories. It may or may not imply the violation of the more basic energy conditions, i.e., NEC and WEC.

9 Generalized Tolman–Oppenheimer–Volkoff equation

In this section, we discuss the dynamical equilibrium condition of the stellar model by using the Tolman–Oppenheimer–Volkoff (TOV) approach in five dimensions [43, 61] by the equation

$$\begin{aligned} -\frac{\mathrm{{d}}p_r}{\mathrm{{d}}r}-\frac{\nu ^{{\prime }}}{2} \big ( \rho + p_{r} \big )+\frac{3}{r}\left( {p_t}-{p_r}\right) =0, \end{aligned}$$
(47)

where we denote first term \(-\frac{\mathrm{{d}}p_r}{\mathrm{{d}}r}=F_h\), the second term \(-\frac{\nu ^{{\prime }}}{2} ( \rho +p_r )=F_g\) and the third term \(\frac{3}{r}({p_t}-{p_r})=F_{a}\). These terms describe the hydrostatic force (\(F_h\)), the gravitational force (\(F_g\)) and the anisotropic force (\(F_a\)), respectively.

Fig. 10
figure 10

Variation of energy conditions for 4U 1538-52 using the parameter provided in Table 1

Fig. 11
figure 11

Variation of various forces in TOV-equation for 4U 1538-52 using the parameter provided in Table 1

In the case of isotropic fluid spheres (\({p}_{r}={p}_{t}\)) and regarding \(\alpha \rightarrow 0\) (GR limit), this equation drives the equilibrium of relativistic compact structures described by isotropic matter distribution. Regarding the presence of anisotropies and the EGB framework, this equation still determines the balance of the system. As was pointed out before, the present model is determined by three forces. To guarantee the equilibrium of the proposed stellar structure, we have shown in Fig. 11 that the balance of the forces is reached at all the values of \({\alpha }\) and GR also. Consequently, Fig. 11 indicates that, in the situation of \(10\le \alpha \le 50\), the resulting impact of the hydrodynamic force (\({F_h}\)) and the anisotropic force (\({F_a}\)) compensates for the internal attraction due to the gravitational force (\({F_g}\)). Furthermore, it is worth mentioning that in the GR case the \(F_{h}\), \(F_{a}\) and \(F_{g}\) forces are greater than the corresponding EGB forces.

10 Rigid rotation, moment of inertia and comparison with MR graph

Bejger and Haensel [62] proposed an approximate formula which converts a static model to rotating model and is given by

$$\begin{aligned} I = {2 \over 5} \Big [1+{(M/R) \cdot km \over M_\odot }\Big ] {MR^2}. \end{aligned}$$
(48)

Using the above expression we have plotted the trend of I w.r.t. mass M in Fig. 12. From this graph it can be seen that the maximum moment of inertia (\(I_{\max }\)) increases with increasing coupling constant \(\alpha \). Also from the MR graph (Fig. 13) we can see that as \(\alpha \) increases the maximum mass (\(M_{\max }\)) also increases. From Figs. 12 and 13 one can notice that the sensitivity of the MI graph is better than MR graph when the stiffness of the equation of state changes.

11 Concluding remarks

It is evident that within the framework of five-dimensional Einstein–Gauss–Bonnet gravity theory, it is plausible to obtain models that describe real compact objects such as white dwarfs, neutron stars and others. In addition, the obtained solution fulfills the basic and general requirements to be a physically and mathematically admissible model. In this case we have solved the field equations (8)–(10) by imposing the Tolman–Kuchowicz spacetime (Fig. 1). This choice is well motivated for two reasons: (i) this metric is free from physical and geometrical singularities, so it is completely plausible to describe the inner geometry of compact objects, (ii) it yields a well behaved energy density, i.e., a positive definite and monotone decreasing function from the center to the boundary of the star (Fig. 2). As is well known, this is a fundamental requirement to describe in a good way the material content inside the star.

Fig. 12
figure 12

The MI graphs are plotted for \(a=2.13\times 10^{-4}\) and \(b=4\times 10^{-8}\)

Fig. 13
figure 13

The MR graphs are plotted for \(a=2.13\times 10^{-4}\) and \(b=4\times 10^{-8}\)

Table 1 Values of all the parameters corresponding to different values of \(\alpha \) and the corresponding \((M_{max},R)\)

Moreover, the remaining thermodynamic variables that characterize the solution, i.e., the radial pressure \(p_{r}\) and the tangential pressure \(p_{t}\), are well behaved at all points within the configuration (3). Besides, the tangential pressure \(p_{t}\) coincides with the radial pressure \(p_{r}\) at the center and then is always greater than \(p_{r}\) everywhere. Actually, it is a very important fact, because it induces a positive anisotropy factor \(\Delta \) inside the star (Fig. 4). A positive \(\Delta \) brings with it important consequences for the structure. For example, it allows the construction of more compact objects (greater amount of mass contained in a smaller size) and introduces a force (repulsive in nature) that helps sustain the hydrostatic balance by counteracting the gravitational compression. The latter not only prevents the system from being subject to a gravitational re-collapse (as would be the case of \(\Delta <0\), which would introduce an attractive force, contributing to the gravitational gradient to collapse the object, which can take it even below its Schwarzschild’s radius to form a black hole), but it improves the stability of the system as well.

On the other hand, as the material content is confined within the region given by \(\Sigma =r=R\), to find all the constant parameters that describe the solution \(\{a,b,B,C\}\) we have made the junction between the internal geometry and the outer spacetime, the Schwarzschild equivalent solution (free of material content, i.e., the vacuum solution) in EGB. This was performed by applying the first and second fundamental forms.

The remaining main physical highlights of the current solution can be summarized as follows:

  1. 1.

    The causality condition (Fig. 7) for the stability of the anisotropic matter distribution as a profile of the difference in squared of subliminal sound speed of the pressure waves, \(| v^2_{t} - v^2_{r}|\) with respect to the radial coordinate r satisfies the inequality \(-1< v^2_{t} - v^2_{r}<0\) which manifests itself in Fig. 9 (lower panel).

  2. 2.

    In Fig. 8 we have displayed the behavior of the adiabatic index \(\Gamma \) with respect to the infinitesimal radial adiabatic perturbation which confirms that when \(\Gamma > 4/3\) our stellar structure is stable in all interior points of the stellar object with spherical symmetry.

  3. 3.

    As regards examination of the energy conditions in order to test the physical validity of the obtained solution, in Fig. 10 we have indicated the behavior of all energy conditions with respect to the radial coordinate r for the stellar system, which shows that our compact stellar structure is well suited for the system in the context of the EGB gravity at various choose values of \(\alpha \), also considering GR theory.

  4. 4.

    We have shown in Fig. 11 that the equilibrium of the forces is reached for all the values of \(\alpha \) (including GR), which confirms that our stellar model is stable with respect to the equilibrium of forces.

  5. 5.

    The stiffness of the corresponding EoS increases with increasing coupling constant \(\alpha \), however, it is less stiff w.r.t. the GR limit. The maximum mass corresponding to \(\alpha =10\)–50 is given in Table 1. As \(\alpha \) increases to 10–50, the moment of inertia also increases. This makes the EoS stiffer and therefore the system can support higher masses (Figs. 12 and 13).

Finally, it is worth mentioning that taking \(\alpha \rightarrow 0\) GR results in five dimensions are recovered. Moreover, as we can observe in the complete graphic analysis GR provides a more compact and stable model in distinction with EBG. Nevertheless, the same can be reached in the arena of EGB gravity taking smaller values of the coupling constant \(\alpha \).