1 Introduction

For over a century, Einstein’s formulation of the general theory of relativity (GTR) has rewarded us graciously with explanations of the bending of light in the vicinity of a massive gravitating object [1], precession of Mercury’s perihelion [2], prediction and observational of gravitational waves [3], observations of black hole shadow [4], to name just a few. On the cosmological front GTR has provided us with a wide spectrum of explanations of physical phenomena including but not limited to gravitational lensing [5], the age of the Universe, baryogenesis, amongst others [6, 7]. With the richness and successes of GTR, also comes several shortcomings. These include the observed acceleration of the Universe, the horizon problem, flatness problem, physics surrounding the initial Big Bang, inflation, etc. [8]. In order to solve some of these shortcomings, researchers have come up with a multitude of concoctions which include dark matter, dark energy, phantom fields, scalar fields, strings and much more. In addition to conjuring up exotic matter fields to explain observations within astrophysical and cosmological contexts, it was necessary to modify GTR. This led to a plethora of modified theories of gravity including Lovelock gravity [9, 10], f(R), f(T), f(RT) [11], scalar tensor theories [12], to highlight a few.

The interest in higher dimensional theories was sparked by ground-breaking work by Kaluza [13] and Klein [14]. While exploring GTR in five dimensions, Kaluza, on imposing the cylinder condition, which is equivalent to treating the 5th dimension as a closed loop, rather than an infinitely long straight line, led to an interesting interpretation of the matter source. The resulting field equations in five dimensions in the absence of forces, described a Maxwell-like source in 4D. Klein on the other hand explored the idea of higher dimensions within the context of quantum mechanics. The Kaluza–Klein theory served as a springboard for other higher dimensional theories including the search for a quantum theory of gravity, string theory and M-theory. The search for large extra dimensions via the Large Hadron Collider experiments failed to reveal any signature of their existence. Researchers have turned their attention to small extra dimensions of the order of the Planck length. To date, there is no experimental evidence for higher dimensions. We are reminded of predictions and later confirmations of the existence of anti-matter, quarks, neutrinos and more recently, quadruplets [15] that we must continue to exploit higher dimensional theories for their mathematical richness parallel to the development of technology and experimental design.

The EGB gravity formalism is appealing for various reasons, some of which include the preservation of salient features of a theory of gravity viz., Bianchi identities, diffeomorphism invariance and second-order quasi-linear equations of motion. In the weak-field limit, EGB gravity reduces to classical 5D Einstein gravity. The Tolman–Oppenheimer–Volkoff equation adjusted appropriately carries over to extra dimensions and has played a key role in revealing the forces at play within the core to maintain static equilibrium. The coupling constant arising in EGB gravity is linked to heterotic string theory and is viewed as the string tension. Despite the nonlinearity of the EGB field equations, there have been several studies of compact objects within the 5D EGB framework. The resulting models of stellar objects have revealed interesting properties in terms of mass, radii and surface redshifts compared to their classical 5D counterparts [16,17,18,19]. On the other hand, Hansraj et al. [20] have demonstrated that the contributions from extra dimensions allow for higher densities (increased packing of mass per unit volume). In this connection, recently Maharaj and his collaborators [21] have proposed new solution-generating scheme via gravitational decoupling for isotropic matter distributions in the context of five and six dimensional EGB gravity.

The equation of state (EoS) which connects the pressure to the density plays an important role in studying the physical viability of stellar structures. There are various EoS’s that have been employed to study pulsars, neutron stars, strange star candidates within 4D Einstein gravity some of which include linear EoS, colour-flavoured-locked in (EoS), polytropic EoS and generalisations thereof. It is interesting to note that the imposition of an EoS of the form \(p_r = p_r(\rho )\), where \(p_r\) is the radial pressure and \(\rho \) is the energy density, respectively, of the star leads to a simple quadrature, thus reducing the problem of finding an exact solution to the EGB field equations featuring anisotropic stresses to a single-generating function of the gravitational potentials [22].

Recently, the minimal geometric deformation (MGD) method, proposed originally by Jorge Ovalle [23, 24] has been successfully applied to the construction of compact stellar objects featuring pressure anisotropy. The essence of the gravitational decoupling (GD) method is to complexify a simple matter configuration through extrapolation while preserving spherical symmetry. Continuing this procedure we can extrapolate the simple matter source to more general matter distributions. This is also a conduit which allows for the introduction of anisotropy into the system. On the other hand, we can begin with the metric associated with a particular matter configuration and solve the field equations to obtain the seed gravitational potential which we then utilise to solve the field equations with pressure anisotropy. The effective energy–momentum tensor (EMT) can be expressed as

$$\begin{aligned} T^{\text {eff}}_{\mu \nu } = T_{\mu \nu } + \beta \, {T}^{*}_{\mu \nu },\quad G_{\mu \nu } = {\kappa }^2 T_{\mu \nu } \end{aligned}$$
(1)

where \(T^{*}_{\mu \nu }\) is the source EMT and \(\bar{T}_{\mu \nu }\) is the appended source term with anisotropy. We obtain the metric potential, \(g^{\text {eff}}_{\mu \nu }\) associated with the energy momentum tensor, \(T^{\text {eff}}_{\mu \nu }\) by merging \({g}_{\mu \nu }\) and \(g^{*}_{\mu \nu }\). We can go through several iterations of this method to produce more complex anisotropic solutions. The MGD technique and its subsequent generalisation, the so-called complete geometric deformation (CGD) [25] have led to a vast increase in the solution space of anisotropic solutions in general relativity. The MGD scheme can be understood by Fig. 1 which shows that how any known solution can be deformed and generalized in to more complex domain by adding an extra source in the original matter distribution. A natural generalisation of the MGD and CDG techniques is to extend them to higher dimensions. This has been successfully accomplished in 5D EGB gravity. It has been demonstrated that the EGB coupling constant and the decoupling parameter play crucial roles in the behaviour of the density and pressure profiles.

Fig. 1
figure 1

Schematic diagram of extending the EGB solution via minimal geometric deformation (MGD) approach

Recent work on EGB stars via the MGD technique has shown that it is possible to obtain stable neutron star models [26] as well as beyond the conventionally observed upper limit of two solar masses [27]. In addition, a first detailed study of the CGD approach in 5D EGB gravity is also discovered by Maurya et al. [28]. Some of the rigorous works in different contexts except 5D gravity under gravitational decoupling via MGD approach and its extension can be found in the following works [29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54].

In this paper we apply gravitational decoupling via MGD formalism to discover a new minimally anisotropic polytropic solution in the framework of five-dimensional EGB gravity. For this purpose, we deform the radial component of the 5D spherically symmetric space-time by combining a deformation function via coupling constant \(\beta \). As usual, this scheme splits the effective system into two subsystems: the first system corresponds to pure EGB which is solved by taking Buchdahl ansatz using generalized polytropic equation of state and second system, (due to the extra source containing the deformation function) is solved by applying the mimic approach i.e. \(\epsilon =\theta ^0_0\). The minimally deformed polytropic solution predicts different stellar behaviors compared to MGD approach such as compactness and gravitational red-shift.

The article is organized as follows: in Sect. 2, we provide a review of the decoupled field equations together with the MGD scheme for five dimensional EGB gravity. The minimally deformed anisotropic polytropic solution in 5D EGB gravity mimicking the density constraint (\(\epsilon =\theta ^0_0\)) is discussed in Sect. 3. In Sect. 4, the matching conditions using suitable exterior spacetime for determining the constants involved in the solution have been derived in the context of MGD scheme. The physical analysis of the minimally deformed anisotropic solution using graphical representations is discussed in Sect. 5. Finally, in Sect. 6 we close with an overview of our findings and pivotal results of our work.

2 Review of gravitationally decoupled field equations via MGD under Einstein–Gauss–Bonnet gravity

The gravitationally decoupled field equations under Einstein–Gauss–Bonnet (EGB) gravity can be given by the following modified D-dimensional action by adding an extra Lagrangian for the new source as:

$$\begin{aligned} \mathcal {I}_{G}= & {} \frac{1}{16 \pi }\int d^{D}x\sqrt{-g}\left[ \mathcal {R}-2\Lambda +\alpha \mathcal {L}_{\text {GB}} \right] + \mathcal {S}_{\text {matter}}\nonumber \\&+\beta \,\int \mathcal {S}_{\theta }\sqrt{-g}~d^{4}x, \end{aligned}$$
(2)

where \(\mathcal {R}\) and \(\Lambda \) represent the D-dimensional Ricci scalar and the cosmological constant, respectively. Here, the Lagrangian corresponding to the matter field and new source are denoted by \(\mathcal {S}_{\text {matter}}\) and \(\mathcal {S}_{\theta }\) respectively while the constant \(\alpha \) is called Gauss–Bonnet (GB) coupling constant. In addition, we have chosen this constant \(\alpha \) to be positive definite in this study because it relates with the inverse string tension with dimension of [\(\text {length}\)]\(^2\). Moreover, we would like to highlight that the different values of \(\alpha \) have been chosen for studying the EGB solutions in different contexts due to unavailablity of experimental values for GB constant \(\alpha \). The constant \(\beta \) is called the decoupling constant having no dimension which connects the new Lagrangian in the EGB action. Also, if \(\beta \longrightarrow 0\) then we can recover action for pure EGB gravity.

Now we write the Gauss–Bonnet Lagrangian \(\mathcal {L}_{\text {GB}}\) which is the combination of Riemann curvature tensor (\(\mathcal {R}_{\mu \nu kl}\)), Ricci tensor (\(\mathcal {R}_{\mu \nu }\)), and Ricci scalar \((\mathcal {R})\) as

$$\begin{aligned}&\mathcal {L}_{\text {GB}}=\mathcal {R}^{\mu \nu kl} \mathcal {R}_{\mu \nu kl}- 4 \mathcal {R}^{\mu \nu }\mathcal {R}_{\mu \nu }+ \mathcal {R}^2. \end{aligned}$$
(3)

Then the equation of motion for the decoupled system is obtained by the varying of the action (2) with respect to metric tensor \(g^{\mu \nu }\) as,

$$\begin{aligned} G_{\mu \nu }+\alpha H_{\mu \nu } = \frac{8 \pi G }{c^4} T^{\text {eff}}_{\mu \nu },~ \text {where}~~ T^{\text {eff}}_{\mu \nu }= {T}_{\mu \nu }-\beta \,\theta _{\mu \nu }, \end{aligned}$$
(4)

where \(G_{\mu \nu }\) and \(H_{\mu \nu }\) represent the Einstein tensor and Gauss–Bonnet (GB) tensor, respectively while \(T_{\mu \nu }\) and \(\theta _{\mu \nu }\) are called the energy momentum tensor corresponding to the matter distribution and the new source. These tensor quantities can expressed as follows

$$\begin{aligned}&G_{\mu \nu } = \mathcal {R}_{\mu \nu }-\frac{1}{2}\mathcal {R}~ g_{\mu \nu } \end{aligned}$$
(5)
$$\begin{aligned}&H_{\mu \nu } = 2\Big ( \mathcal {R} \mathcal {R}_{\mu \nu }-2\mathcal {R}_{\mu k} \mathcal {R}^k_\nu -2 \mathcal {R}_{\mu \nu kl}\mathcal {R}^{kl} - \mathcal {R}_{\mu kl\delta } \mathcal {R}^{kl\delta }_\nu \Big )\nonumber \\&\quad - \frac{1}{2}~g_{\mu \nu }~\mathcal {L}_{\text {GB}}, \end{aligned}$$
(6)
$$\begin{aligned}&{T}_{\mu \nu }=\frac{-2}{\sqrt{-g}}\frac{\delta \left( \sqrt{-g}\,\mathcal {S}_{matter}\right) }{\delta g^{\mu \nu }}, \quad \text {and} \quad \nonumber \\&\theta _{\mu \nu }=\frac{2}{\sqrt{-g}}\frac{\delta \left( \sqrt{-g}\,\mathcal {S}_\theta \right) }{\delta g^{\mu \nu }}. \end{aligned}$$
(7)

In addition, we would like to mention that the GB coupling constant \(\alpha \) can take high values up to order of \(10^{23}\) in the context of solar system tests under EGB gravity theory [55]. Also, in the presence of the higher curvature Gauss–Bonnet invariants, Dehghani [56] utilised a negative value for \(\alpha \) to explain accelerated cosmic expansion. Now, we assume a D dimensional static and spherically symmetric line element for determining the minimally deformed solution for a compact star of the form,

$$\begin{aligned} ds^2_{D}= - W(r)\, c^2dt^2 + H (r) dr^2 + r^{2} d\Omega ^2_{D-2}, \end{aligned}$$
(8)

where \(W\equiv W(r)\) and \(H\equiv H(r)\) are the metric functions which depend on radial coordinate r only and \(d\Omega ^2_{D-2}\) is the metric on the unit \((D-2)\)- dimensional sphere. Moreover, we consider that the matter distribution is anisotropic then energy momentum tensor can be cast as

$$\begin{aligned} T^{\text {eff}}_{\mu \nu } = (\epsilon ^{\text {eff}} + p^{\text {eff}}_{t})\,u_{\mu } u_{\nu }+ p^{\text {eff}}_{t}\, g_{\mu \nu }+( p^{\text {eff}}_r- p^{\text {eff}}_{t})\chi _{\mu }\,\chi _{\nu }, \nonumber \\ \end{aligned}$$
(9)

Here, \(\epsilon \), \(p^{\text {eff}}_r\), and \( p^{\text {eff}}_{t}\) denote the energy density, radial pressure, and tangential pressures, respectively for the effective energy tensor (\(T^{\text {eff}}_{\mu \nu }\)). On the other hand, the contravariant 5-velocity \(u^{\nu }\) and unit space-like vector \(\chi ^\mu \) in the radial direction satisfy the following relation: \(u^{\nu } u_{\nu }=-1\) and \(\chi ^\mu =\sqrt{1/H(r)}\,\delta ^\mu _1\). Then the EGB field equations for the line element (9) can be written as

$$\begin{aligned} \epsilon ^{\text {eff}}= & {} \frac{(2-D) (H-1) [\alpha (D-5) (H-1) + (D-3)\, H r^2]}{2 H^2 r^4} \nonumber \\&\quad + \,\frac{(D-2) H^{\prime } [4 \alpha (H-1) + H r^2]}{2 H^2 r^3 W}, \end{aligned}$$
(10)
$$\begin{aligned} p^{\text {eff}}_r= & {} \frac{(D-2) (H-1) [\alpha (D-5) (H-1) + (D-3)\, H r^2]}{2 H^2 r^4} \nonumber \\&\quad + \,\frac{(D-2) W^{\prime } [4 \alpha (H-1) + H r^2]}{2 H^2 r^3 W}, \end{aligned}$$
(11)
$$\begin{aligned} p^{\text {eff}}_{t}= & {} \frac{(2-D)}{12 H^3 r^4 W^2}\nonumber \\&\times \Big [H r^2 \big \{W^{\prime 2} H r^2 + r (-4 W^{\prime } H + H^{\prime } W^{\prime } r - 2 W^{\prime \prime } \nonumber \\&\times H r) W + 2 (D-3) [(H-1) H + H^{\prime } r] W^2\big \} + 2 \alpha \big \{2 W^{\prime 2} \nonumber \\&\times (H-1) H r^2 + 2 W^{\prime } r [12 H + H^{\prime } (H-3) r] W - (H-1) \nonumber \\&\times W \big (4 W^{\prime \prime } H r^2 + (D-5) [(H-1) H - 2 H^{\prime } r] W\big ) \big \} \Big ], \end{aligned}$$
(12)

where \(\prime \) denotes the derivative with respect to the radial coordinate r, only. Here it is important to mention that the EGB theory is a higher dimensional and higher curvature proposal generating up to second equations of motion and the GB term does not show any effect on the gravitational dynamics in D-dimensional spacetime whenever \(D\le 4\) due to the Gauss–Bonnet invariants becoming a total derivative. Whereas, it is a known fact that the EGB term has no effect on gravitational field for \(N \le 4\) and becomes dynamic for \(N > 4\) where, \(N= \frac{(D-1)}{2}\) is related to the dimensionality of the spacetime. The solutions of compact and bounded objects can be found for critical odd and even \((D=2N+1\) and \(2N+2)\) dimensions as shown by Dadhich and his colleagues. It is well known that Nth-order, odd dimensional \((D = 2N +1)\) pure Lovelock spacetimes do not admit models of self-gravitating bounded objects as there is no finite boundary for which the pressure vanishes. In addition, it has been demonstrated that bounded orbits do not exist for critical odd dimensions in pure Lovelock gravity. The existence of stable orbits is a requirement for having stable structures such as compact stars and black holes [57]. Several earlier works have shown that the odd dimensions Lovelock spacetimes are not necessarily kinematic [58,59,60,61]. In a more recent study Hansraj and Gabuza [62] investigated a class of cosmological models arising in \((2N + 1)\) pure Lovelock gravity thus demonstrating that such spacetimes are dynamic rather than kinematic. They were able to solve the governing field equations for various ansatzes and further explored the physical viability of the resulting cosmological fluids. On the other hand, the stellar models with dimension \(D = 5, 6\) in EGB gravity and Einstein gravity for \(D = 3, 4\) have similar behaviour as suggested by Dadhich et al. [63]. Recently, Glavan and Tomozawa [64, 65] have made efforts to find the effects of the GB terms in 4-dimensional gravity via dimensional regularisation process but this method is facing some kind of valuable criticisms and it is not still free of controversy [66, 67]. Therefore, by taking cognizance of the above points we move to study higher-dimensional stellar structures, in particular 5D EGB framework in this current exposition. Then the static spherically symmetric line element (8) in five-dimensional spacetime may be written as,

$$\begin{aligned} ds^2_{5}= - W(r) \, c^2dt^2 + H (r) dr^2 + r^{2} d\Omega ^2_3, \end{aligned}$$
(13)

where \(d\Omega ^2_3=\big (d \theta ^2+\sin ^2 \theta ~ d\phi ^2 +\sin ^2 \theta \sin ^2 \phi ~d\psi ^2 \big )\). Now, using the Eqs. (4) and (9) with (13) one could obtain the non-vanishing components of the gravitational field equations as,

$$\begin{aligned}&\epsilon ^{\text {eff}} =\frac{12\, \alpha H^\prime (H-1) +3r\, H (H^\prime r + 2 H^2-2H )}{2 H^3 r^3}, \end{aligned}$$
(14)
$$\begin{aligned}&p^{\text {eff}}_r =\frac{12 \alpha \, W^\prime (H-1) +3 H r (W^\prime r - 2 (H-1) W)}{2 H^2 r^3 W}, \end{aligned}$$
(15)
$$\begin{aligned}&p^{\text {eff}}_t = \frac{1}{4 H^3 r^2 W^2}\,\Big [4 \alpha \{W^{\prime 2} (H-1) H + H^\prime W^\prime (H-3) \nonumber \\&\quad \times W - 2\, W^{\prime \prime } (H-1)\, H\, W\} + H \big \{W^{\prime 2} H r^2 \nonumber \\&\quad + W^\prime r (H^\prime r -4 H ) W - 2 W [W^{\prime \prime } H r^2 + 2 (H \nonumber \\&\quad - H^2 - H^\prime r) W]\big \} \Big ]. \end{aligned}$$
(16)

Since it is already well-known that the Einstein tensor \(G_{\mu \nu }\) and the Gauss–Bonnet tensor \(H_{\mu \nu }\) are individually conserved [9, 10]. Then due to this fact, the effective energy–momentum tensor \(T^{\text {eff}}_{\mu \nu }\) for decoupled system given by Eq. (4) will also be divergence–free i.e. \(\nabla ^\mu \,T^{\text {eff}}_{\mu \nu }=0\) that provides a general hydrostatic equation in 5D Einstein–Gauss–Bonnet gravity under the spacetime (13) as,

$$\begin{aligned} -\frac{W^\prime }{2W}(\epsilon ^{\text {eff}}+p^{\text {eff}}_r)-(p^{\text {eff}}_r)^{\prime }+\frac{3}{r}( p^{\text {eff}}_{t}-p^{\text {eff}}_r)=0. \end{aligned}$$
(17)

The above equation is also called a modified Tolman–Oppenheimer–Volkoff (TOV) equation for effective system under EGB gravity. In order to find the mass function formula in 5D spacetime, we must firstly define an arbitrary function A(r) by relating it to the energy density (\(\epsilon ^{\text {eff}}\)) [68] as,

$$\begin{aligned}&\frac{2}{3}\,\int ^r_0 \epsilon ^{\text {eff}}(\hat{r})\,\hat{r}^3 dx= (2\,\alpha \,A^2+r^2\,A), \end{aligned}$$
(18)

The Eq. (18) is also equivalent to \(A(r)=\frac{H(r)-1}{H(r)}\). Now we introduce the mass function in 5-dimensional proposed by Ponce [69] as,

$$\begin{aligned} m(r)=\frac{1}{3}\,\int ^r_0 \epsilon ^{\text {eff}}(\hat{r})\,\hat{r}^3 d\hat{r}~, \end{aligned}$$
(19)

Then using Eqs. (18) and (19), we arrive at the following relation,

$$\begin{aligned}&A=\frac{r^2}{4 \alpha } \left( -1+\sqrt{1+\frac{16\,\alpha \,m}{r^4}}\right) ~~ \nonumber \\&\quad \Longrightarrow \frac{1}{H(r)}=1+\frac{r^2}{4 \alpha } \left( 1-\sqrt{1+\frac{16\,\alpha \, m}{r^4}}\right) . \end{aligned}$$
(20)

which is similar to the Boulware–Deser spatial potential. As we are dealing with anisotropic stars, the temporal potential will not be related to the Boulware–Deser metric. By matching the appropriate components of the exterior (vacuum) Boulware–Deser metric [70] with interior metric (13) at the boundary, the mass function (19) at the surface can be obtained. This mass function is eventually the total mass of the compact star. Now our next strategy is to solve the decoupled field equations for compact star model. Since decoupled field equations are a system of highly non-linear differential equations, it is not easy to solve them exactly. Therefore, we apply a well-known method known as gravitational decoupling through minimal geometric deformation (MGD) approach under a specific transformation along the gravitational potentials,

$$\begin{aligned}&W(r) \longrightarrow Y(r)+\beta \, \xi (r), \end{aligned}$$
(21)
$$\begin{aligned}&\frac{1}{H(r)} \longrightarrow X(r)+\beta \, \psi (r) \end{aligned}$$
(22)

where \(\psi (r)\) and \(\xi (r)\) are called the geometric deformation functions along the spatial and temporal metric components, respectively. This deformation can be set suitably through the decoupling constant \(\beta \). As usual, when \(\beta =0\), the standard EGB scenario is recovered. Now we need to choose the suitable transformation along only one gravitational potential due to minimal deformation. In particular, we set \( \xi (r) = 0\) and \(\psi (r)\ne 0\) which generates a deformation of the radial component only while the temporal evolution is unaffected. By applying this MGD technique, the decoupled system gets divided into two subsystems. The first system corresponds to \(T_{\mu \nu }\) and other system for the new source \(\theta _{\mu \nu }\). In order to write the first system, we consider the energy–momentum tensor \({T}_{\mu \nu }\) which describes the anisotropic matter distribution given as,

$$\begin{aligned} {T}_{\mu \nu } = ({\epsilon } + p_{t})\,u_{\nu } u_{\nu }+ p_{t}\, g_{\mu \nu }+(p_r-p_{t})\chi _{\mu }\,\chi _{\nu }, \end{aligned}$$
(23)

where \(\epsilon \) represents a seed energy density while \(p_{r}\) and \(p_{t}\) denote the seed radial pressure and seed tangential pressure, respectively. Then the effective components for density and stresses can be written in terms of seed density and pressures components as:

$$\begin{aligned} \epsilon ^{\text {eff}}={\epsilon }+\beta \,\theta ^0_0, \quad p^{\text {eff}}_r=p_r-\beta \,\theta ^1_1, \quad p^{\text {eff}}_t=p_t-\beta \,\theta ^2_2.~~ \nonumber \\ \end{aligned}$$
(24)

Now the effective anisotropy takes the form,

$$\begin{aligned} \Delta ^{\text {eff}}=p^{\text {eff}}_t-p^{\text {eff}}_r= (p_t-p_r)+\beta (\theta ^1_1-\theta ^2_2). \end{aligned}$$
(25)

From the above equation, we observe that the extra component in the effective anisotropy \(\beta (\theta ^1_1-\theta ^2_2)=\Delta _{MGD}\) (let) due to gravitational decoupling along the radial deformation (22) may produce strong anisotropy in the system but this will solely depend on the behavior of \(\Delta _{MGD}\). Now the system (14)–(16) yields the following equations which depend only on the gravitational potentials X and W when \(\beta = 0\) as,

$$\begin{aligned} \epsilon= & {} \frac{1}{2r^3}[12\alpha X^\prime (X-1)-3 r (X^\prime r+2 X-2)] , \end{aligned}$$
(26)
$$\begin{aligned} p_r= & {} \frac{1}{2 r^3 W}\big (12 \alpha W^\prime X (1- X)+3\,r [W^\prime X r\nonumber \\&+2(X-1) W]\big ), \end{aligned}$$
(27)
$$\begin{aligned} p_t= & {} \frac{1}{4r^2W^2}\big [W^\prime r (X^\prime r + 4 X) W -W^{\prime 2} r^2 T + 4 \alpha \{W^{\prime 2}\nonumber \\&\times (X-1) X + X^\prime W^\prime (1 - 3 X) W - 2 W^{\prime \prime } (X -1) \nonumber \\&\times X W\} + 2 W (W^{\prime \prime } r^2 X + 2 (X^\prime r + X-1) W)\big ].~~~ \end{aligned}$$
(28)

Then the solutions of the above system of equations can be given by following line element,

$$\begin{aligned} ds^2=- W(r) dt^2 + \frac{ dr^2 }{X(r)}+ r^{2}d\Omega _3^2, \end{aligned}$$
(29)

where the mass function (\(m_{EGB}\)) for pure EGB system (i.e. when \(\beta =0\)) can be determined by the formula,

$$\begin{aligned} X(r)=1+\frac{r^2}{4 \alpha } \left( 1-\sqrt{1+\frac{16\,\alpha \, m_{EGB}}{r^4}}\right) , \end{aligned}$$
(30)

Moreover, the conservation equation for the system (26)–(28) can be determined by substituting \(\beta =0\) in Eq. (17) as,

$$\begin{aligned} -\frac{W^\prime }{2W}\,(\epsilon +p_r)-(p_r)^\prime +\frac{3}{r}(p_t-p_r)=0. \end{aligned}$$
(31)

We now move onto the process for determining the second set of equations for the new source \(\theta _{ij}\) which is obtained by turning on the decoupling constant \(\beta \) as,

$$\begin{aligned} \theta _0^0= & {} \frac{1}{2\,r^3}\big (3\, \beta \, [4 \alpha \,X^\prime \,\psi -r \,(2\, \psi + \psi ^\prime \, r) + 4 \,\alpha \, \psi ^\prime \, \nonumber \\&\times (\beta \, \psi + X-1)]\big ), ~~~~~~ \end{aligned}$$
(32)
$$\begin{aligned} \theta _1^1= & {} \frac{1}{2\,r^3 W}\big (-3 \beta \,\psi [4 \,\alpha \, W^\prime \, (1 - \beta \, \psi -2 X) \nonumber \\&+ r (W^\prime \, r + 2 W)]\big ),~~~~~~~ \end{aligned}$$
(33)
$$\begin{aligned} \theta _2^2= & {} \frac{-\beta }{4r^2W^2}\,\big [W^\prime r (4 \psi + \psi ^\prime r) W -W^{\prime 2} \psi r^2 + 2 W \nonumber \\&\times (W^{\prime \prime } \psi r^2 + 2 (\psi + \psi ^\prime r) W) + 4 \alpha \{W^{\prime \prime } \psi ( \beta \, \psi \nonumber \\&-1 + 2\, X) - 2\, W^{\prime \prime }\, \psi \, (\beta \, \psi + 2\, X-1)\, W + W^\prime \nonumber \\&\times (\psi ^\prime - 3 \beta \psi ^\prime \psi - 3 X^\prime \psi - 3 \psi ^\prime X) W\}\big ]. \end{aligned}$$
(34)

Since the new source \(\theta _{ij}\) is also conserved i.e. \(\nabla ^\mu \,\theta _{\mu \nu }=0\) which leads to the following conservation equation,

$$\begin{aligned} -\frac{W^\prime }{2W}\,(\theta ^0_0-\theta ^1_1)+(\theta ^1_1)^\prime +\frac{3}{r}(\theta ^1_1-\theta ^2_2)=0. \end{aligned}$$
(35)

In view of the above equation, it is noted that gravitational decoupling is free from the exchange of energy between these two sources \(\hat{T}_{\mu \nu }\) and \(\theta _{\mu \nu }\) in 5D and EGB gravity. Moreover, we also mention that the linear combination of the conservation equations via decoupling constant \(\beta \) leads to the conservation equation (17). Since, the MGD has been applied along the radial component of the line element, MGD may also contribute some extra mass in the stellar object. This extra component of the mass function, \(m_{\psi }\) due to the new source \(\theta _{\mu \nu }\) is given as,

$$\begin{aligned}&m_{\psi }= \frac{8\pi G}{3\,c^2}\,\int _0^r \theta ^0_0 (x)\, x^3 dx, \end{aligned}$$
(36)

Moreover, the deformation function \(\psi \) can also be expressed in terms of the mass function (\(m_\psi \)) [27]

$$\begin{aligned} \psi (r)= \frac{4 \alpha + r^2 \pm \sqrt{16 \alpha \beta m_{\psi } + [r^2 - 4 \alpha (X-1)]^2} - 4 \alpha X}{4\,\alpha \,\beta }. \nonumber \\ \end{aligned}$$
(37)

3 Minimally deformed polytropic solution in EGB gravity

In this section, we wish to determine the solution for both systems of equations (26)–(28) and (32)–(34) connected with the sources \({T}_{\mu \nu }\) and \(\theta _{\mu \nu }\). Since we have already specified that the energy–momentum tensor \({T}_{\mu \nu }\) which describes an an anisotropic fluid matter distribution, then the presence of extra source \(\theta _{\mu \nu }\) in the matter distribution will enhance the anisotropy of the system. Here we employ the generalized polytropic equation of state (EoS)

$$\begin{aligned} p_r=\chi _{1}\,\epsilon ^{1+\frac{1}{n}}+\chi _2\,\epsilon +\chi _3, \end{aligned}$$
(38)

to solve the seed system (20)–(22) related to energy–momentum tensor \({T}_{\mu \nu }\). Here, \(\chi _1\), \(\chi _2\) and \(\chi _3\) are EoS constant parameters while n is a polytropic index. It is noted that the EGB field equations are highly non-linear and it is not possible to find the exact solution of the EGB field equations under the EoS (37) for general values of n. Therefore, we chose the polytropic index \(n=1\) for solving the EGB field equations (20)–(22) and the EoS (37) becomes: \(p_r=\chi _{1}\,\epsilon ^2+\chi _2\,\epsilon +\chi _3\). On the other hand, it is important to mention that if \(\chi _1=0\), then EoS (38) will reduce to a linear EoS which also describes the MIT bag model EoS when \(\chi _1=0\), \(\chi _2=\frac{1}{3}\) and \(\chi _3=-\frac{4\mathcal {B}}{3}\), where \(\mathcal {B}\) is a bag constant. Now by taking into account EoS (38) for \(n=1\) with equations (26) and (27), we get

$$\begin{aligned}&-144 \alpha ^2 X^{\prime 2} \chi _1 (X-1)^2 W - 24 \alpha r (X-1) (W^{\prime } r^2 X \nonumber \\&\quad + X^{\prime } (\chi _2 r^2 - 3 \chi _1 (-2 + X^{\prime } r + 2 X)) W) + r^2 \big [6 W^{\prime } r^3 X \nonumber \\&\quad - \big \{9 \chi _1 (X^{\prime } r+ 2 X-2)^2 + 2 r^2 (6 + 2 \chi _3 r^2 - 6 X \nonumber \\&\quad - 3 \chi _2 (-2 + X^{\prime } r + 2 X))\big \} W\big ]=0. \end{aligned}$$
(39)

We note that Eq. (39) depends on the gravitational potentials W(r) and X(r). In order to solve the above differential equation, we use the well-known potential function proposed by Buchdahl of the form,

$$\begin{aligned} X(r)=\frac{1+Dr^2}{1+Cr^2}, \end{aligned}$$
(40)

where C and D are constants with dimension \(length^{-2}\). Now by plugging X(r) into differential equation (39) and integrating with respect to r, we obtain an exact solution for potential W(r) as,

$$\begin{aligned}&W(r)=A\,Exp\Bigg [ \frac{2 C \chi _3 r^2}{6D} - \frac{1}{6(1 + C r^2)^3} [24 \alpha (C - D)^2 \chi _1]\nonumber \\&\quad +\frac{1}{(1 + C r^2)^2}[9 (C - D) (4 \alpha D-1) \chi _1]-\frac{1}{6(1+Cr^2)} [36 C \nonumber \\&\quad + 18 D (4 \alpha D-3) \chi _1] - \frac{1}{6(C-D)}\big [6\big \{C (6 D \chi _1 - \chi _2) - D(9 D \chi _1 \nonumber \\&\quad - 12 \alpha D^2 \chi _1 - \chi _2)\big \}\ln (1 + Cr^2)\big ]-\frac{1}{6(4\alpha D-1)}[2 (C-D) (9 \chi _1\nonumber \\&\quad - 12 \alpha (1 + \chi _2) + 16 \alpha ^2 \chi _3) \ln (1 + 4 \alpha C - 4 \alpha D + C r^2)] \nonumber \\&\quad +\frac{1}{6(C-D) D^2 (4\alpha D-1)} \big [2 \big \{C D (72 \alpha D^3 \chi _1 + D (6 + 9 \chi _2) \nonumber \\&\quad - 12 D^2 (3 \chi _1 + \alpha \chi _2) - 2 \chi _3) + C^2 (9 D^2 \chi _1 - 3 D (1 + \chi _2) + \chi _3) \nonumber \\&\quad + D^2 (144 \alpha ^2 D^4 \chi _1-144 \alpha D^3 \chi _1- 3 D\, (1 + 2 \chi _2) + 12 D^2 (3 \chi _1 \nonumber \\&\quad + \alpha \chi _2) + \chi _3)\big \} \ln (1 + D r^2) \big ] \Bigg ]. \end{aligned}$$
(41)

where, A is an arbitrary constant of integration. On inserting of X(r) and W(r) into Eqs. (26)–(28) together with (40) and (41) we find the expressions for \(\epsilon \), \(p_r\) and \(p_t\) as,

$$\begin{aligned}&\epsilon = \frac{1}{(1 + Cr^2)^3} \big [3 (C- D) (2 + 4 a (C- D) + 3 C r^2 + C^2 r^4)\big ], ~~ \end{aligned}$$
(42)
$$\begin{aligned}&p_r= \frac{1}{(1 + C r^2)^6} \big [-144 \alpha D^3 \chi _1 + 144 \alpha ^2 D^4 \chi _1 - 6 D \chi _2 + 12 D^2\nonumber \\&\quad \times (3 \chi _1 + \alpha \chi _2) + \chi _3 + C^6 r^8 (9 \chi _1 + 3 \chi _2 r^2 + \chi _3 r^4) + 3 C^5 r^4 \nonumber \\&\quad \times (6 \chi _2 r^4 - D \chi _2 r^6 + 2 \chi _3 r^6 - 6 \chi _1 r^2 (-3 + D r^2) + 4 \alpha (6 \chi _1 \nonumber \\&\quad + \chi _2 r^2)) - 3 C (24 \alpha D^3 \chi _1 (8 a + 3 r^2) + D (24 \chi _1 + 8 \alpha \chi _2 \nonumber \\&\quad + 9 \chi _2 r^2) - 12 D^2 (12 \alpha \chi _1 + 3 \chi _1 r^2 + \alpha \chi _2 r^2) - 2 (\chi _2 + \chi _3 r^2)) \nonumber \\&\quad + 3 C^4 (48 \alpha ^2 \chi _1 + 14 \chi _2 r^6 - 6 D \chi _2 r^8 + 5 \chi _3 r^8 + 3 \chi _1 r^4 (13 \nonumber \\&\quad - 12 D r^2 + D^2 r^4) + \alpha (4 \chi _2 r^4 (3 - 2 D r^2) - 72 \chi _1 r^2 (Dr^2-1))) \nonumber \\&\quad + 3 C^2 (9 \chi _2 r^2 - 16 D \chi _2 r^4 + 5 \chi _3 r^4 + 4 \alpha \chi _2 (1 - 6 D r^2 + 3 D^2 r^4) \nonumber \\&\quad + 3 \chi _1 (4 + 96 \alpha ^2 D^2 - 24 D r^2 + 13 D^2 r^4 - 8 \alpha D (6 - 9 D r^2 \nonumber \\&\quad + D^2 r^4))) + 2 C^3 (-288 a^2 D \chi _1 + 24 \chi _2 r^4 - 21 D \chi _1 r^6 + 10 \chi _3 r^6 \nonumber \\&\quad + 9 \chi _1 r^2 (6 - 13 D r^2 + 3 D^2 r^4) + 6 \alpha (\chi _2 r^2 (3 - 6 D r^2 + D^2 r^4) \nonumber \\&\quad + 6 \chi _1 (2 - 9 D r^2 + 3 D^2 r^4))) \big ], \end{aligned}$$
(43)

We do not explicitly write the expression for \(p_t\) due to it being cumbersome and lengthy. The spacetime geometry for the seed solution is completely determined. We now only need to solve the second system corresponding to \(\theta \)-sector which depends on the undetermined deformation function \(\psi (r)\), in order to find the complete solution for energy–momentum tensor \(T^{\text {eff}}_{\mu \nu }\). In GR, a wide variety of approaches have been adopted to obtain the deformation function, \(\psi (r)\) [24, 29,30,31] but very few in the context of 5D EGB gravity [26,27,28]. In this work we mimic the seed energy density \(\epsilon (r)\) to \(\theta ^0_0(r)\) i.e. \(\epsilon (r)=\theta ^0_0(r)\). Now using the Eqs. (32) and (42) and integrating w.r.t r, we get a closed form solution for deformation function \(\psi (r)\) as,

$$\begin{aligned} \psi (r)=\frac{Cr^2(1+ 4 \alpha C- 4 \alpha D + C r^2)- \sqrt{\psi _1(r)}}{4 \alpha \,\beta \, C\,(1 + Cr^2)},~ \end{aligned}$$
(44)

where,

$$\begin{aligned}&\psi _1(r)=r^4 C^2 (1 + 4 \alpha (C-D) + Cr^2)^2 + 8 (C-D)\\&\quad \times \alpha \beta [1 + 2 Cr^2 + 2 C^2 r^4 + C^3 r^6 -2 \alpha (C-D) \\&\quad \times (1 + 2 Cr^2)] + 16 \alpha ^2 \beta ^2 C^2 (1 + Cr^2)^2 F_1. \end{aligned}$$

and \(F_1\) is a arbitrary constant of integration. In order to achieve a regular model, the deformed gravitational potential H(r) must be unity at the center i.e. \(H(0)=1\), which leads to

$$\begin{aligned}&H(0)=[X(0)+\beta \,\psi (0)]^{-1} =1,\nonumber \\&\quad \Longrightarrow \psi (0)=0~ \text {due ~to}~X(0)=1~~[\text {from~ Eq}.(35)],~ \end{aligned}$$
(45)

confirming that the deformation function vanishes at the center i.e. \(\psi (0)=0\). The value of the arbitrary constants \(F_1\) is determined as,

$$\begin{aligned} F_1=\frac{D-C + 2 \alpha C^2 - 4 \alpha C D + 2 \alpha D^2}{2 \alpha \beta C^2}. \end{aligned}$$
(46)

Then by plugging the value of \(F_1\) in Eq. (44), we get

$$\begin{aligned} \psi (r)=r^2\,\psi _2(r), \end{aligned}$$
(47)

where

$$\begin{aligned} \psi _2(r)= & {} \frac{1}{4 \alpha \beta (1 + Cr^2)}[1 + 4 \alpha C - 4 \alpha D+ C r^2 \nonumber \\&- \sqrt{ 8 \alpha (1 + \beta ) (C-D) \psi _3(r)}, \nonumber \\ \psi _3(r)= & {} [2 \alpha (C-D) +(1 + Cr^2)] + (1 + Cr^2)^2].~~~~ \end{aligned}$$
(48)

Then the components of the \(\theta \)-sector are,

$$\begin{aligned} \theta ^0_0= & {} \frac{1}{(1 + Cr^2)^3} \big [3 (C- D) (2 + 4 a (C- D) \nonumber \\&+ 3 C r^2 + C^2 r^4)\big ],~~ \end{aligned}$$
(49)
$$\begin{aligned} \theta ^1_1= & {} \frac{3\psi _2(r)}{2(1+Cr^2)} \big [(1 + Cr^2) (2 + r^2\,W_1(r) ) - 4 \alpha \, \nonumber \\&\times \, W_1(r) \{1 + 2 D r^2 + \beta \, \psi _2(r)\, r^2 - C r^2 \nonumber \\&\times (1 - \beta r^2\,\psi _2(r))\}\big ]. \end{aligned}$$
(50)

where the expression for \(W_1(r)\) is given in the Appendix. We circumvent the presentation of \(\theta ^2_2\) due to its length.

4 Exterior space–time and matching conditions

For determining the constants involved in the effective system we should match the interior deformed spacetime with the suitable exterior spacetime at the boundary \(r=R\). The deformed interior spacetime can be given by the following line element,

$$\begin{aligned}&ds^2_{5} = -W(r) ~dt^2 + \frac{dr^2}{X(r)+\beta \,\Phi (r)} + r^{2}d\Omega ^2_3,~~~ \end{aligned}$$
(51)

On the other hand, the suitable exterior spacetime in 5D is given by Boulware–Deser [70] exterior (vacuum) solution as,

$$\begin{aligned}&ds^2_{5} = -F(r) dt^2 + \frac{dr^2}{F(r)} + r^{2}d\Omega ^2_3, \end{aligned}$$
(52)

where \(F(r)=\Big [1+\frac{1}{4 \alpha } \Big (r^2-\sqrt{r^4+{16\alpha M}}\Big )\Big ]\) and M denotes a total mass associated with gravitational mass of the object at the surface. Moreover, the above exterior spacetime gives a 5D Schwarzschild exterior spacetime in the limit \(\alpha \rightarrow 0\). Furthermore, it can be clearly observed that the presence of the new source \(\theta _{\mu \nu }\) inside the system could in principle modify the exterior spacetime geometry as well as matter content. Then, it may not be possible to embed the stellar compact object to vacuum space–time. But, if we assume that new contributions arising from \(\theta _{\mu \nu }\) are confined within the stellar interior [24, 28], then the stellar compact object will remain embedded into a true Boulware–Deser vacuum space-time (52). Now we the fix easily the arbitrary constant parameters by joining of the interior (51) and exterior (52) spacetimes across the boundary. To do this, we consider the manifolds which have the boundaries defined by the time-like hypersurfaces

$$\begin{aligned} ds^{2}_{\Sigma } = - d\tau ^2+R^{2}\big (d \theta ^2+\sin ^2 \theta ~ d\phi ^2+\sin ^2 \theta \sin ^2 \phi ~d\psi ^2 \big ), \end{aligned}$$
(53)

where, \(\tau \) is the proper time on the boundary. Now, we can achieve the generalized Darmois–Israel formalism for Einstein–Gauss–Bonnet theory by projecting of the field equations on the shell \(\Sigma \), as (for more details see Refs. [71, 72])

$$\begin{aligned}&2\langle K_{\mu \nu }-K h_{\mu \nu }\rangle + 4\alpha \langle 3J_{\mu \nu }-Jh_{\mu \nu }+2P_{iklj}K^{kl}\rangle \nonumber \\&\quad =-\kappa ^{2}S_{\mu \nu }, \end{aligned}$$
(54)

where the \(\langle \cdot \rangle \) and J denote the jump of a defined quantity across the hypersurface \(\Sigma \) and trace of \(J_{\mu \nu }\), respectively while \(h_{\mu \nu } = g_{\mu \nu } - n_{\nu }n_{\mu }\) is called the induced metric on \(\Sigma \). Then divergence–free part of the Riemann tensor and \(J_{\mu \nu }\) are given by

$$\begin{aligned} \mathcal {R}_{\mu \nu kl}= & {} \mathcal {R}_{\mu \nu kl}+(\mathcal {R}_{\nu k}h_{l\mu }- \mathcal {R}_{\nu l}h_{k\mu })-(\mathcal {R}_{\mu k}h_{l\nu }\nonumber \\&- \mathcal {R}_{\mu l}h_{k\nu }) +\frac{1}{2}\mathcal {R}(h_{\mu k}h_{l\nu }-h_{\mu l}h_{k\nu }), \end{aligned}$$
(55)
$$\begin{aligned} J_{\mu \nu }= & {} \frac{1}{3}\big [2KK_{\mu k}K^{k}_{\nu }+K_{kl}K^{kl}K_{\mu \nu }-2K_{\mu k}K^{kl}K_{l\nu }\nonumber \\&-K^{2}K_{\mu \nu }\big ],~~~~~~ \end{aligned}$$
(56)

respectively. Hence, the extrinsic curvature \(K_{\mu \nu }\) in the present scenario takes the following form,

$$\begin{aligned} {K}^{\pm }_{\mu \nu }=-n^{\pm }_{\mu }\left( \frac{\partial ^{2}X^{\mu }}{\partial \xi ^{\mu }\partial \xi ^{\nu }}+\Gamma ^{\mu }_{\alpha \beta }\frac{\partial X^{\alpha }}{\partial \xi ^{\mu }}\frac{\partial X^{\beta }}{\partial \xi ^{\nu }}\right) _{r = R}, \end{aligned}$$
(57)

where \(\xi ^{\mu }=(\tau , \theta , \phi , \psi )\) the intrinsic coordinates at the boundary and the sign ± depends on the signature of the junction hypersurface. Now for smooth matching, we need the continuity of the first and second fundamental forms across the boundary. Then using the first fundamental form at the boundary, we get

$$\begin{aligned} \frac{1}{H(R)}= & {} X(R)+\beta \psi (R) \nonumber \\= & {} \bigg [1 + \frac{1}{4 \alpha }\bigg (R^2 - \sqrt{R^4 + {16\, \alpha M}}\bigg )\bigg ], \end{aligned}$$
(58)
$$\begin{aligned} W(R)= & {} \bigg [1 + \frac{1}{4\,\alpha }\bigg (R^2 - \sqrt{R^4 + {16\, \alpha M}}\bigg )\bigg ]. \end{aligned}$$
(59)

where the seed metric function X(R) at \(r=R\) is given as: \(X(R) = \big [1 + \frac{1}{4\,\alpha }\big (R^2 - \sqrt{R^4 + {16\, \alpha \, M_{EGB}}}\big )\big ]\), and \(M_{EGB} = m_{EGB}(R)\) denotes the mass of the compact object with radius R in pure EGB gravity for the seed spacetime (29). Then, the total mass for effective system is given as,

$$\begin{aligned} M{=}M_{EGB}+ \frac{\beta \psi (R)}{2} \left[ 2\alpha \beta \psi (R){-}\sqrt{R^4 +16 \alpha M_{EGB}}\right] , \nonumber \\ \end{aligned}$$
(60)

where the total mass in pure EGB gravity is given,

$$\begin{aligned} M_{EGB}=\frac{1}{3}\int ^R_0 \epsilon \, r^3\, dr= \frac{(1-X)}{2}\Big [2\,\alpha \,(1-X)+ R^2\Big ].\nonumber \\ \end{aligned}$$
(61)

Now we move onto the determining the second fundamental form for present situation which is more complex. The continuity of second fundamental form at the boundary yields

$$\begin{aligned} \big [(G_{\mu \nu }+\alpha \,H_{\mu \nu })\,r^{\nu }\big ]_{\Sigma }=0 ,~\Longrightarrow ~ \big [T^{\text {eff}}_{\mu \nu }\,r^{\nu }\big ]_{\Sigma }=0\,\, \end{aligned}$$
(62)

where \(r^{\nu }\) denotes a unit vector in the radial direction. Then (62) implies,

$$\begin{aligned} \big [p^{\text {eff}}_r\big ]_{\Sigma }=0 \Longrightarrow \,\big [p_r-\beta \,\theta ^1_1\big ]_{\Sigma }=0, \end{aligned}$$
(63)

where \(\Sigma \) denotes the bounding surface which is defined at \(r=R\). This matching condition then may be expressed as

$$\begin{aligned} p_r(R)-\beta \,(\theta ^1_1)^{-}(R)=-\beta \,(\theta ^1_1)^{+}(R), \end{aligned}$$
(64)

where the \((\theta ^1_1)^{-}(R)\) and \((\theta ^1_1)^{+}(R)\) are called the \(\theta \)-sector components for interior and exterior space–times at the surface, respectively. The condition (64) denotes a general expression of the second fundamental form for the effective system associated with the EGB equation of motion given by Eq. (4). Now we obtain a modified second fundamental form by plugging of the \(\theta ^1_1\) component for the interior spacetime, determined via Eq. (33), into the Eq. (64) as,

$$\begin{aligned}&p_r(R)+ \frac{1}{2\,R^3 W_{R}}\big (3 \beta \,\psi _{R} [4 \,\alpha \, W_{R}^\prime \, (1 - \beta \, \psi _{R} -2 X_{R}) \nonumber \\&\quad + R\, (W_{R}^\prime \, R + 2 W_{R})]\big )=-\beta \,(\theta ^1_1)^{+}(R),~~~ \end{aligned}$$
(65)

where the symbols denote as \(\psi _{R} = \psi (R)\), \(X_{R}=X(R)\), and \(W^\prime _{R}={\partial _r W}\big |_{r=R}\). Now by inserting \((\theta ^1_1)^{+}(R)\) for the exterior spacetime in Eq. (65), we get

Fig. 2
figure 2

Variation of effective energy density (\(\epsilon ^{\text {eff}}\)) versus radial coordinate r/R. The left figure is plotted for fixed \(\beta =-\,0.6\) with different \(\alpha \) while right figure for fixed \(\alpha =5\) with different \(\beta \)

Fig. 3
figure 3

Variation of effective radial pressure (\(p^{\text {eff}}_r\)) versus radial coordinate r/R. The left figure is plotted for fixed \(\beta =-\,0.6\) with different \(\alpha \) while right figure for fixed \(\alpha =5\) with different \(\beta \)

$$\begin{aligned}&p_r(R)+\frac{3 \beta \,\psi _{R} [4 \,\alpha \, W_{R}^\prime \, (1 - \beta \, \psi _{R} -2 X_{R}) + R\, (W_{R}^\prime \, R + 2 W_{R})]}{2\,R^3 W_{R}} \nonumber \\&\quad =\frac{3\,\beta \,\psi ^{*}_{R}}{R^3} \Bigg [ \frac{R\, \bigg (\sqrt{R^4 + {16\, \alpha \, \mathcal {M}}}-R^2\bigg )}{\sqrt{R^4 + {16 \,\alpha \, \mathcal {M}}} \bigg [4 \,\alpha + \bigg (R^2 - \sqrt{R^4 + {16\,\alpha \, \mathcal {M}}}\bigg ) \bigg ]}\nonumber \\&\qquad \times \bigg \{-4\,\alpha \,\beta \, \psi ^{*}_{R} -8\,\alpha \,\bigg [1 + \frac{1}{4\,\alpha }\bigg (R^2 - \sqrt{R^4 + {16\, \alpha \, \mathcal {M}}}\bigg )\bigg ]\nonumber \\&\qquad +4\,\alpha +R^2\bigg \}+R\Bigg ], \end{aligned}$$
(66)

where \(\psi ^{*}_{R}=\psi ^{*}(R)\) denotes a decoupling function for the exterior spacetime geometry at the surface when the extra source \(\theta _{\mu \nu }\) present in the matter distribution, which is determined by the following 5D spacetime as

$$\begin{aligned}&ds^2_{5} = - \bigg [1 + \frac{1}{4\,\alpha }\bigg (r^2 - \sqrt{r^4 + {16\, \alpha \, \mathcal {M}}}\bigg )\bigg ] dt^2 + \bigg [1 + \frac{1}{4\,\alpha }\nonumber \\&\quad \times \bigg (r^2 - \sqrt{r^4 + {16\, \alpha \, \mathcal {M}}}\bigg )+\beta \,\psi ^{*}(r)\bigg ]^{-1} dr^2 + r^{2}d\Omega ^2_3,~~ \nonumber \\ \end{aligned}$$
(67)

Now the conditions (58), (59), and (66) are known as the necessary and sufficient conditions for matching the deformed interior spacetime (51) with the exterior spacetime (52) at the boundary. As we already supposed the contributions from the new source \(\theta _{\mu \nu }\) are confined within the stellar interior only and the exterior spacetime is given by the static and spherically symmetric Boulware–Deser solution. In this situation, we must put \(\psi ^{*}_{R}=0\) in Eq. (67). Then we find a final form of the condition (66) as,

$$\begin{aligned}&p^{\text {eff}}_r(R) = p_r(R)+ \frac{1}{16 \pi \,r^3 W} \big [3 \beta \,\psi \, \big \{4 \,\alpha \, W^\prime \, (1 - \beta \, \psi \nonumber \\&\quad -2 X) + r (W^\prime \, r + 2 W)\big \}\big ] =0,~ \end{aligned}$$
(68)
$$\begin{aligned}&\text {which~is~equivalent~to,}\nonumber \\&\quad p^{\text {eff}}_r(R)=p_r(R)-\beta \,\theta ^1_1(R) = 0.~~ \end{aligned}$$
(69)

The above condition shows that the compact stellar object will be in equilibrium in a true (Boulware–Deser) exterior “vacuum” only if the effective radial pressure (\(p^{\text {eff}}_r\)) vanishes at the surface of the object. The condition (69) determines the size of the compact stellar object i.e. radius (\( r=R\)). We can also say that the matter distribution is confined in a finite spacetime region i.e. the star does not expand indefinitely beyond the boundary.

Fig. 4
figure 4

Variation of effective tangential pressure (\(p^{\text {eff}}_t\)) versus radial coordinate r/R. The left figure is plotted for fixed \(\beta =-\,0.6\) with different \(\alpha \) while right figure for fixed \(\alpha =5\) with different \(\beta \)

Fig. 5
figure 5

Variation of anisotropy contribution \(\Delta _{MGD}\) versus radial coordinate r/R. The left figure is plotted for fixed \(\beta =-\,0.6\) with different \(\alpha \) while right figure for fixed \(\alpha =5\) with different \(\beta \)

Fig. 6
figure 6

Variation of effective anisotropy (\(\Delta ^{\text {eff}}\)) versus radial coordinate r/R. The left figure is plotted for fixed \(\beta =-\,0.6\) with different \(\alpha \) while right figure for fixed \(\alpha =5\) with different \(\beta \)

5 Physical analysis for minimally deformed solution

In order to confirm that the solution obtained via the MGD approach does indeed describe a compact stellar model, albeit in higher dimensions, we subject our model to regularity and stability tests. In Fig. 2, we have plotted the effective energy density as a function of the scaled radial coordinate. The left panel of Fig. 2. displays the effective density when the EGB coupling constant is varied while the decoupling constant is held fixed. The density is a smoothly decreasing function, decreasing outwards as the stellar surface is approached. The density increases everywhere inside the bounded object as the EGB coupling constant is increased. This effect of packing more mass into a given volume has been observed in many other works on EGB stars. The left panel shows the variation of the density when \(\alpha \) is kept constant and \(\beta \) is varied. The monotonic decrease in the effective density is noted. Furthermore, as \(\beta \) becomes more negative, the density is suppressed, i.e. the density decreases at each interior point of the stellar fluid. The radial pressure is connected to the density via the EoS. In Fig. 3 (left panel), we observe the trend in the effective radial pressure when \(\alpha \) is varied and \(\beta \) is fixed. As expected, the effective pressure mimics the effective density, i.e., an increase in \(\alpha \) is accompanied by an increase \(p_r^{\text {eff}}\). Furthermore, the effective pressure vanishes for some finite value of the radial coordinate. This signifies the boundary of the compact object. On the right panel of Fig. 3, the effective radial pressure is shown when \(\beta \) is varied and \(\alpha \) is held fixed. We note the suppression in the radial pressure as the magnitude of \(\beta \) is increased. However, there is a distinct change in behaviour of the effective radial pressure compared to its corresponding effective energy density. The incremental change in the effective radial pressure is much smaller than changes in the corresponding effective energy density. It appears that the quadratic term in the EoS is ‘switched’ on when \(\beta \) is varied. The effects of \(\alpha \) and \(\beta \) on the density and pressure profiles are calculated for a compact object of radius \(R = 11km\) and are exhibited in Tables 1 and 2 below. We observe that effective central density is increased by approximately 2.34% for \(\alpha = 20\) as compared to its 5D classical GR counterpart. From Table 2. we observe the suppressive nature of \(\beta \), particularly in the effective surface density of the bounded object. The effective tangential pressure is plotted in Fig. 4. In the left panel of Fig. 4, we observe that the tangential pressure is strengthened as \(\alpha \) is increased up to some finite radius, \(r = R_0\). Beyond this radius, an increase in \(\alpha \) results in a decrease in \(p_t^{\text {eff}}\). It is interesting to note the trend when \(\beta \) is varied and the EGB coupling parameter is kept constant (right panel). As \(\beta \) becomes more negative, the effective tangential pressure decreases up to a certain radius \(r = R_1\), thereafter, \(p_t^{\text {eff}}\) increases as the magnitude of the decoupling constant increases. This ‘switch over’ in the trend of \(p_t^{\text {eff}}\) is more dramatic than its EGB counterpart (left panel). Figure 5 shows the anisotropy arising from the MGD contribution. We note that \(\Delta _{MGD}\) is positive in both the left panel (varying \(\alpha \)) and the right panel (varying \(\beta \)). A positive anisotropy parameter signifies a repulsive force which helps stabilise the bounded configuration. It is interesting to note that an increase in the EGB constant decreases \(\Delta _{MGD}\), with this effect enhanced in the surface layers of the stellar object. When the decoupling constant is made more negative, \(\Delta _{MGD}\) increases more significantly than the effect that \(\alpha \) has on \(\Delta _{MGD}\). The effective anisotropy parameter is plotted in Fig. 6. The left panel of Fig. 6 reveals that \(\Delta ^{\text {eff}}\) is positive everywhere inside the star and decreases as \(\alpha \) is increased. The right panel indicates that \(\Delta ^{\text {eff}}\) becomes negative as \(\beta \) becomes less negative. This indicates that there is a critical value of the decoupling constant which flips the sign of \(\Delta ^{\text {eff}}\). This change in sign of the effective anisotropy parameter from positive to negative tends to destabilise the stellar configuration.

Fig. 7
figure 7

Variation of gravitational redshift (z) versus radial coordinate r/R. The left figure is plotted for fixed \(\beta =-\,0.6\) with different \(\alpha \) while right figure for fixed \(\alpha =5\) with different \(\beta \)

On the other hand, it was already claimed that when seed density \(\epsilon \) is mimicking the temporal component of the \(\theta \)-sector ı.e., \(\epsilon =\theta ^{0}_{0}\), the effective mass inside the fluid sphere does not remain same due to change in energy density. To see the effect of MGD on the gravitational mass, we write effective gravitational mass formula in 5D EGB gravity as

$$\begin{aligned} M(R)=\frac{1}{3} \int ^{R}_{0}{\epsilon ^\text {eff}}(\hat{r})\, \hat{r}^{3}d\hat{r}, \end{aligned}$$
(70)

Since \(\epsilon =\theta ^{0}_{0}\), then the effective density will be \((1+\beta )\) times the seed density, i.e. \(\epsilon ^\text {eff}=(1+\beta )\,\epsilon \), then Eq. (70) leads

$$\begin{aligned} M(R)= & {} \frac{1}{3} \left( 1+\beta \right) \int ^{R}_{0}{\epsilon ^\text {eff}}(\hat{r})\, \hat{r}^{3}d\hat{r}, \end{aligned}$$
(71)
$$\begin{aligned} M(R)= & {} \frac{\big (1+\beta \big )\,(1-X)}{2}\Big [2\,\alpha \,(1-X)+ R^2\Big ].~~ \end{aligned}$$
(72)

From Eq. (72), it can be observed that the effective total mass M(R) of the object is \((1+\beta )\) times of the total mass \(M_{EGB}(R)\) under pure EGB gravity, i.e. \(M=(1+\beta )\,M_{EGB}(R)\). This implies that the object becomes less dense in the presence of MGD since \(\beta \) is negative.

On the other hand, the compactness factor u in 5D-EGB gravity is defined as,

$$\begin{aligned} u=\frac{M}{R^2}= (1+\beta )\frac{M_{EGB}}{R^2} \end{aligned}$$
(73)

Furthermore, the Buchdahl limit in the context of 5D-EGB gravity is given as, [68]

$$\begin{aligned} u_{EGB}\equiv \frac{2M_{EGB}}{R^{2}}\le \frac{3}{4}+\frac{9}{8R^{2}}\alpha \quad \forall \quad \alpha >-\frac{R^{2}}{3}, \end{aligned}$$
(74)

Since \(\beta \) is negative then u remains to satisfy the Buchdahl limit in the context in 5D-EGB gravity, and \(u\le u_{EGB}\).

Now we discuss the measurement of an important physical feature known as surface redshift (z) of the compact object. In the context of EGB gravity, the Gauss–Bonnet terms modify the upper bound of redshift of spectral lines from boundary surface of uniform density [73]. Since this upper bound of redshift is dependent on the value of density, and then it is not always possible to discover an upper bound for the redshift [68, 73]. The gravitational redshift of the minimally deformed compact object is given by

$$\begin{aligned} z=\sqrt{1/W(r)}-1, \end{aligned}$$
(75)

From the above formula, we can determine some information about the central redshift \(z_c\). So we can write

$$\begin{aligned} z_{c}=\sqrt{1/W(0)}-1= \frac{[1 + 4 \alpha (C- D)]^{A_1}\, e^{A_2}}{\sqrt{A}}-1, \end{aligned}$$
(76)

where \(A_1=\frac{(C- D) (9 \chi _2 - 12 a (1 + \chi _2) + 16 \alpha ^2 \chi _3)}{2\,(-3 + 12 \alpha D)}\), and \(A_2=\frac{1}{4}\, [8 \alpha C^2 + C\, (15 - 28 \alpha ) + D (-21 + 44 \alpha D)] \chi _1\), while the surface redshift can be found by formula (75) by taking \(r=R\). In Fig. 7., left panel, we observe the trend in the redshift as \(\alpha \) is varied and \(\beta \) is kept constant. Closer to the central regions of the star, the redshift increases as \(\alpha \) increases and this impact of \(\alpha \) vanishes as the surface of the star is reached. The left panel of Fig. 7. shows the variation of the redshift when \(\beta \) is varied. As the decoupling constant becomes more negative, the redshift decreases for higher values of the radial coordinate. The numerical values of all the discussed physical quantities are mentioned in Tables 1 and 2. We further observe that the obtained values for surface redshift \(z_{s}\) are consistent with the bound proposed in the GR scenario [74].

Table 1 Numerical values of physical parameters of the MGD solution for \(C= 0.0021\, \text {km}^{-2}\), \(D=0.0015 ~\text {km}^{-2}\), \(R=11~km\), \(\chi _1=0.2\) and \(\chi _2= 1/3\) with different coupling parameters \(\alpha \) for fix decoupling constant \(\beta =-0.6\)
Table 2 Numerical values of physical parameters of the MGD solution for \(C= 0.0021\, \text {km}^{-2}\), \(D=0.0015~\text {km}^{-2}\), \(R=11~\mathrm{km}\), \(\chi _1=0.2\) and \(\chi _2= 1/3\) with different decoupling constant \(\beta \) for fix coupling parameter \(\alpha =5~\mathrm{km}^2\)

6 Overview of findings

We now provide an over-arching commentary of the salient and novel features of our anisotropic 5D EGB stellar model obeying a quadratic EoS within the MGD formalism. Starting off with the Buchdahl ansatz for one of the metric functions together with a polytropic EoS we solved the governing MGD equation exactly to obtain the complete gravitational behaviour of an anisotropic stellar model within the framework of EGB gravity. This solution was then matched to the exterior vacuum Boulware–Deser solution which fixed the arbitrary constants arising from the integration of the master equation. We then subjected our model to physical viability tests which brought out an interesting connection between the EGB coupling constant, \(\alpha \), the decoupling parameter, \(\beta \) and the thermodynamical variables. We observed an increase in the EGB coupling constant resulted in an increase in the effective density at each interior point of the stellar configuration. This effect of packing more mass per unit volume brought about by increasing the ‘strength’ of \(\alpha \) has been observed in other works on EGB stars. An increase in the decoupling constant, with \(\alpha \) being held fixed leads to higher core densities. Since \(\beta < 0\), we can interpret this behaviour in the effective density profile as a suppression effect of \(\beta \) as it increases in magnitude. Similar trends are observed in the effective radial pressure. This is expected as \(p_r^{\text {eff}}\) and \(\rho ^{\text {eff}}\) are connected via the EoS. Recently, it has been shown that the effective density for a 4D compact object is increased in the presence of a scalar field and charge. Could there be some connection between the EGB coupling constant and the decoupling parameter to a scalar field and electromagnetic field? The effective tangential pressure has revealed an interesting trend. When the EGB coupling constant was increased while \(\beta \) was fixed, \(p_t^{\text {eff}}\) increased. At some interior point, \(r/R = 0.708\) this effect switches with \(p_t^{\text {eff}}\) decreasing as \(\alpha \) is increased. A similar switching is observed when \(\beta \) changes, but the switching takes place for a smaller radius, \(r/R = 0.549\). The effective anisotropy parameter is positive throughout the star and decreases in strength when the EGB parameter is increased. An increase in \(\alpha \) renders the configuration less stable. On the other hand, we observed that increasing the magnitude (making \(\beta \) more negative) of the decoupling constant results in an increase in the effective anisotropy parameter. It is also possible to change the sign of \(\Delta ^{\text {eff}}\) thus resulting in an attractive force due to pressure anisotropy. This attractive force is directed inwards and combines with the gravitational force to destabilise the compact object.

Introduction of anisotropy via the MGD formalism has laid bare some interesting effects of the EGB coupling constant and the decoupling parameter in terms of the stability of a 5D anisotropic star. It is possible to have stars with greater densities in the presence of increasing \(\alpha \). The effect of the higher dimension seems to compress matter into smaller volumes. At the same time, an increase in the effective density is accompanied by a destabilization of the compact object as can been elucidated from the trend in the effective anisotropy parameter. On the other hand, the decoupling constant acts to decrease the density and pressure within the fluid configuration and in the process stabilizes it. One can think of the \(\beta \) as contributing through the \(\theta \)-sector a repulsive effect at each interior point. There is a critical value of \(\beta \) where the anisotropy changes sign which tends to render the fluid unstable. This could be a possible mechanism for overturning (stable regions becoming unstable) as shown by Herrera [75] and Di Prisco and collaborators [76, 77] in 4D relativistic compact objects.