1 Introduction

Recently exact interior metrics were reported [1,2,3] for spherically symmetric perfect fluid distributions in the Einstein–Gauss–Bonnet (EGB) gravity theory. The exterior metric was derived by Boulware and Deser [4] for neutral spheres and by Wiltshire [5] for the charged counterpart a few decades ago. Since then various configurations of entities were studied in EGB gravity. The collapse of inhomogeneous dust was discussed by Jhingan and Ghosh [6] and a distinction was drawn between shell focussing and shell crossing hyperspheres. Ghosh and Jhingan [7] examined the case of quasispherical gravitational collapse in 5D EGB framework and showed that naked singularities result and the cosmic censorship hypothesis is violated. Abbas and Sarwar [8] examined the dynamical stability of collapsing stars in EGB utilising a Tolman–Bondi source while Abbas and Zubair [9] investigated the collapse of anisotropic spheres in EGB with a dynamical systems approach. Earlier Maeda [10] considered the final fate of collapse of dust clouds in EGB and importantly demonstrated that the 5- and 6-dimensional cases are remarkably different. Kleihaus et al. [11] studied spinning black strings in the context of 5D EGB theory. However, for some three decades compact objects were not investigated in this theory on account of the highly complicated nonlinear field equations involved. For example, the Kerr–Schild ansatz known to linearize the Einstein tensor was attempted in EGB theory [12] and it was found that the solution of the trace of the EGB equations did not solve all the field equations. Success in solving the EGB equations was achieved through a coordinate transformation [1,2,3]. This transformation was customarily used in the standard Einstein theory to convert the equation of pressure isotropy to a linear differential equation in any of the two gravitational potentials. While the defining master equation is not rendered as a linear differential equation, it nevertheless is possible to isolate a number of exact solutions. Examination of the resulting models revealed that they satisfy physically reasonable requirements demanded of stellar models. These include satisfying the energy conditions, the existence of a pressure free hypersurface determining the boundary of the sphere as well as the condition of causality. A similar programme proved successful in constructing compact pure Lovelock stars [13].

One of the key elements in developing a model corresponding to realistic matter is the existence of an equation of state. The equation of state for a star is known to be directly linked to the mass–radius ratio for observed objects. For example, in the work of Seager et al. [14] mass–radius relationships for solid exoplanets were studied in an effort to understand the constituents of such planets by analyzing the possible equations of state. A key finding reported in the aforesaid work is that the mass–radius relationships for cold terrestrial mass planets did not obey a simple power law form although the equations of state for solid planets are often taken to be modeled by a polytropic equation of state. In examining data on the planet HD 149026b, the mass–radius relations suggest that almost two thirds of the mass is contained within the core. [15]. The planet GJ 436b displayed mass–radius behavior akin to Neptune [16, 17]. Commencing with a prescribed equation of state imposes severe restrictions on the system of nonlinear differential equations and impedes the finding of exact solutions [41, 42]. What has been found is that equations of state may more readily be found when other mathematical prescriptions are made to complete the model. For example see the Finch–Skea [44] model (and its charged counterpart [37]) which has been shown to be compatible with astrophysical predictions in the theory of Walecka [47]. In the current problem, the field equations are more formidable yet we find that the equation of state may be determined. In fact, this strongly suggests that, in constructing exact models of stars, the route of specifying a geometrical component and/or another aspects of the physics (such as the electric field in our case) is a more productive means of determining the equation of state.

Charged fluid distributions have been traditionally studied despite the notion that celestial bodies are generally understood to be neutral. In earlier times efforts to apply solutions of the Einstein–Maxwell system to model the electron failed on account of an unrealistic mass–radius ratios. Nevertheless, it is mathematically worthwhile to examine the possibilities for charged compact objects to exist in modified theories of gravity. We attempt to construct such models in the present work. Since the problem in EMGB is similar to the Einstein theory in that there are 4 equations governing six unknowns which means that effectively there are 15 different two element sets of these six variables that may be chosen a priori to close the system. A listing of the various two element choices that have been made historically is contained in [18]. As in the simplified Einstein case, it is a trivial exercise to find exact solutions if the two metric potentials are prescribed at the outset. However, it is by no means trivial if other two choices are made besides both metric potentials. For example, the following problems are under study. Models of charged dust by setting the pressure to zero then require one further prescription and the process is by no means trivial. Such a model is interesting as Coulombic forces oppose the pressure to prevent the collapse of the star to a point singularity. Then if a linear barotropic equation of state is imposed, one further choice needs to be made to close the system. Again, this is a nontrivial problem and will be discussed elsewhere.

The EGB action principle is a quadratic modification of the Einstein action which is linear in the Ricci tensor. Here quadratic forms of the Riemann tensor, Ricci tensor and Ricci scalar are used to construct an action principle that yields at most second order equations of motion. EGB belongs to a larger class of Nth order polynomials discovered by Lovelock [19] that represent the most general Lagrangians that generate up to second order differential equations governing the evolution of stars. EGB is the \(N=2\) case of the Lovelock polynomial. Vacuum solutions have been determined for Lovelock gravity in general [20,21,22] as well as for dimensionally continued [5, 23,24,25], and also for pure Lovelock black holes [26, 27]. Sharma [28] showed that the limiting case of the polytropic fluid may be regarded as isothermal and is important in the study of clusters of stars. It is demonstrated by Dadhich and coworkers [29] that the Schwarzschild interior solution is universal in describing a uniform density sphere in all dimensions >3 in higher dimensional Einstein or Lovelock theory. In fact Dadhich [30] has strongly argued that the pure Lovelock theory in which only the Nth order term (and not the sum of terms up to N) constitute the more accurate theory of gravity. Indeed the \(N=1\) case is general relativity so the results in general relativity still hold for that special case.

Higher derivative gravity theories have been proposed in order to explain the cosmic accelerated expansion without resorting to exotic matter. Strong support for EGB theory lies in the fact that the effective action in heterotic string theory involves a Gauss–Bonnet term [38]. Of course, string theory relies upon the existence of higher dimensions than 4 – something which is generally unpalatable in a theory of gravitation. However, if a grand unified theory exists then higher dimensional effects must exist in gravity theory as they do in the quantum regime – whether they are accessible is an open question. Generally, higher dimensions are explained away by claiming that they are hidden topologically. These issues were also considered in [30].

There are other theories of the gravitational field gaining popularity.The trace-free Einstein equations (also known as unimodular gravity) have been proposed by Ellis [31, 32] as the true theory of gravity. This idea, first proposed by Weinberg [33], meant to address the great difference in the value of the vacuum energy density predicted by quantum theory in comparison to the actual value of the cosmological constant from astronomical observations. Starobinsky’s f(R) theory [34] is also well studied, however, unlike Lovelock theory fourth order equations of motion emerge. The theory has been shown to be conformally equivalent to scalar tensor theory plus general relativity. Of late f(RT) theory [35] has been proposed where the Lagrangian is functionally dependent on the Ricci scalar as well as the trace of the energy momentum tensor \(T_{ab}\). These investigations show that modified theories of gravity are indeed worthwhile areas of study and corrections to the standard theory may result. It is also important to note that studies of data collected by observations of celestial phenomena are grounded in the results of general relativity. If such computer codes were written using the modifications to the theory (such as the EGB corrections herein) the results that emerge may well be different and could convey a different portrait of the universe, stellar structures and galaxy formation and evolution. In this spirit, it is believed that the implications of extended theories are important.

In this paper we develop the governing equations for a spherically symmetric distribution of matter coupled with an electric field in the EGB framework. Exact solutions for the resulting Einstein–Maxwell–Gauss–Bonnet (EMGB) field equations are then sought. The equation of pressure isotropy is recast into an equivalent form with the help of a coordinate transformation. The analysis amounts to solving a system of four partial differential equations in six unknowns: energy density \(\rho \), pressure p, electric field intensity E, proper charge density \(\sigma \) and two metric potentials \(\nu \) and \(\lambda \). As is characteristic of the EGB framework the isotropy equation is of second order in one variable and of first order in the other. Unlike the Einstein theory, nonlinearity is inherent in both formulations of the isotropy equation.

Ordinarily an equation of state is selected to help close the system, however, one further assumption may be made to generate a unique model. This has generally proved a difficult route in the standard Einstein gravity. An alternative viable route is to propose functional forms for two of the six variables and endeavor to solve the system. Note that the four dynamical variables may all be expressed in terms of the metric potentials \(\nu \) and \(\lambda \) and so specifying the geometry will trivially produce a unique model without needing to perform any integrations. This approach has been followed by Krori et al. [36] to generate a singularity free model but the drawback is that all control over the pressure and density is sacrificed. We elect to specify one of the metric potentials and the electric field intensity in order to solve the system of field equations. This approach has been shown to yield physically viable charged star models in Einstein theory and importantly consisting of a barotropic equation of state [37]. Therefore this route is being pursued in this work. The form of the potential \(\lambda \) selected corresponds to a generalized version of a spheroidal spacetime and contains a number of well studied ansatze in the Einstein theory and we investigate their behavior in this modified EMGB theory.

The paper is arranged as follows: We recall basic elements of EGB gravity and then extend the theory to incorporate the electric field by supplementing the field equations with the Maxwell equations. The field equations for a static spherically symmetric perfect fluid in a charged field are written and converted to an equivalent form. We then postulate a general form for the metric potential \(\lambda \) and the electric field that permits the complete integration of the field equations. Special cases of the potential are then considered and the exact model is exhibited in these cases.

2 Einstein–Gauss–Bonnet gravity

The action principle in the standard Einstein theory of relativity is the Einstein–Hilbert action given by

$$\begin{aligned} S=\frac{1}{2\kappa } \int R \sqrt{-g} \mathrm{d}^4 x \end{aligned}$$
(1)

where \(g = \det (g_{ab}) \) is the determinant of the metric tensor \(g_{ab}\), R is the Ricci scalar and \(\kappa = 8\pi Gc^{-4}\) where G is the Newton gravitational constant and c is the speed of light in vacuum. The Einstein field equations

$$\begin{aligned} R_{ab} - \frac{1}{2} g_{ab} R = \kappa T_{ab} \end{aligned}$$
(2)

consequently arise where \(T_{ab} \) is the energy momentum tensor for the matter configuration. If the cosmological constant \(\Lambda \) is included then the Lagrangian has the form

$$\begin{aligned} S= \int \frac{1}{2\kappa }\left( R - 2\Lambda \right) \sqrt{-g} d^4 x \end{aligned}$$
(3)

and the associated Einstein field equations are given by

$$\begin{aligned} R_{ab} - \frac{1}{2} g_{ab} R + \Lambda g_{ab} = \kappa T_{ab}. \end{aligned}$$
(4)

The Lovelock [19] Lagrangian is written as

$$\begin{aligned} \mathcal {L} = \sum ^t_{n=0} \alpha _n \mathcal {R}^n \end{aligned}$$
(5)

where \( \mathcal {R}^n = \frac{1}{2^n} \delta ^{c_1 d_1 \cdots c_n d_n}_{a_1 b_1 \cdots a_n b_n} \Pi ^n_{r=1} R^{a_r b_r}_{c_r d_r} \) and \(R^{a b}_{c d}\) is the Riemann or curvature tensor. Also \( \delta ^{c_1 d_1 \cdots c_n d_n}_{a_1 b_1 \cdots a_n b_n} = \frac{1}{n!} \delta ^{c_1}_{\left[ a_1\right. } \delta ^{d_1}_{b_1} \cdots \delta ^{c_n}_{a_n} \delta ^{d_n}_{\left. b_n \right] }\) is the required Kronecker delta.

The Lovelock action (5) may be expanded as

$$\begin{aligned} \mathcal {L}= & {} \sqrt{-g}\left( \alpha _0 + \alpha _1R + \alpha _2 \left( R^2 + R_{a b c d} R^{a b c d}\right. \right. \nonumber \\&\left. \left. - 4R_{c d} R^{c d} \right) + \alpha _3 \mathcal {O}(R^3)\right) , \end{aligned}$$

from which we define the Gauss–Bonnet (GB) term as

$$\begin{aligned} \mathcal {R}^2 = R^2 + R_{a b c d} R^{a b c d} - 4R_{c d} R^{c d} \end{aligned}$$

denoted as L GB. This term arises in the low energy effective action of heterotic string theory [38]. As a result the Einstein–Gauss–Bonnet field equations are given by

$$\begin{aligned} G^{a}_{b} + \alpha H^{a}_{b} = T^{a}_{b} \end{aligned}$$
(6)

where

$$\begin{aligned} H_{ab}= & {} 2\left( R R_{ab} - 2R_{ac}R^c_b - 2R^{cd}R_{acbd} + R^{cde}_{a} R_{bcde} \right) \\&-\, \frac{1}{2} g_{ab} \mathcal {R}^2. \end{aligned}$$

The Gauss–Bonnet action is written as

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

where \(\alpha \) is the GB coupling constant. The constant \(\alpha \) is linked with the string tension in string theory [38]. The remarkable feature of the GB action lies in the fact that despite the Lagrangian being quadratic in the Ricci tensor, Ricci Scalar and the Riemann tensor, the equations of motion turn out to be second order quasilinear. The GB term has no effect for \(n \le 4\) but is generally non-zero for \(n > 4\).

3 Field equations for charged spheres

The generic 5-D line element for static spherically symmetric spacetimes may be expressed as

$$\begin{aligned} \mathrm{d}s^{2}= & {} -e^{2 \nu } \mathrm{d}t^{2} + e^{2 \lambda } \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 \mathrm{d}\psi ^2 \right) \end{aligned}$$
(8)

where \( \nu (r) \) and \( \lambda (r) \) are the gravitational potentials. The Einstein–Maxwell–Gauss–Bonnet (EMGB) system of field equations is given by

$$\begin{aligned}&G_{ab} = T_{ab} \nonumber \\&\qquad = M_{ab} + E_{ab} \end{aligned}$$
(9)
$$\begin{aligned}&F_{ab;c} + F_{bc;a} + F_{ca;b} = 0 \end{aligned}$$
(10)
$$\begin{aligned}&F^{ab}{}{}_{;b} = J^a \end{aligned}$$
(11)

where \(\mathbf{T}\) is the total energy-momentum tensor, \(\mathbf{M}\) is the energy-momentum tensor for neutral matter, \(\mathbf{E}\) is the contribution of the electromagnetic field, \(\mathbf{F}\) is the electromagnetic field tensor and \(\mathbf{J}\) is the five-current density.

The electromagnetic contribution E to the total energy-momentum tensor is given by

$$\begin{aligned} E_{ab} = F_{ac}F_b{}^{c} - \frac{1}{4}g_{ab}F_{cd}F^{cd} \end{aligned}$$
(12)

where \(\mathbf{F}\) is skew-symmetric. The five-current density for a non-conducting fluid can be written as

$$\begin{aligned} J^a=\sigma u^a \end{aligned}$$
(13)

where \(\sigma \) is the proper charge density. The electromagnetic field tensor \(\mathbf{F}\) is defined in terms of the five-potential \(\mathbf{A}\) by

$$\begin{aligned} F_{ab} = A_{b;a} - A_{a;b} \end{aligned}$$
(14)

Gauge freedom allows us to choose the five-potential as

$$\begin{aligned} A_a = (\phi (r),0,0,0,0) \end{aligned}$$

so that the effects of the magnetic field are suppressed and only the electric field contributes. Only one non-zero component of the Faraday tensor \(F_{ab}\) survives and is given by

$$\begin{aligned} F_{01} = -\phi '(r) \end{aligned}$$
(15)

where we have utilized (14). The corresponding contravariant component has the form

$$\begin{aligned} F^{01} = e^{-2(\nu +\lambda )}\phi '(r) = e^{-(\nu +\lambda )}E(r) \end{aligned}$$

where we have put

$$\begin{aligned} E(r) = e^{-(\nu +\lambda )}\phi '(r) \end{aligned}$$
(16)

following Herrera and Ponce de Leon [48] for the 4-dimensional Einstein–Maxwell equations. The quantity E(r) is interpreted as the electrostatic field intensity. The components of the electromagnetic field energy tensor (12) are given by

$$\begin{aligned} E^a_{b}=\text{ diag } \left( -\frac{1}{2}E^2,\, -\frac{1}{2}E^2,\, \frac{1}{2}E^2,\, \frac{1}{2}E^2, \frac{1}{2} E^2 \right) \end{aligned}$$
(17)

where we have used (15). The energy-momentum tensor \(\mathbf{M}\) for the comoving fluid velocity vector \(u^a=e^{-\nu } \delta ^{a}_{0}\) has the form

$$\begin{aligned} M^a_{b}= \text{ diag } \left( -\rho ,\, p ,\, p ,\, p,\, p\right) \end{aligned}$$
(18)

for uncharged matter.

The field equation (11) gives the relationship

$$\begin{aligned} e^{-\lambda }\left( r^2 E\right) '=r^2 \sigma \end{aligned}$$
(19)

for the value \(a = 0\). The conservation laws \(T^{ab}_{}{}_{;b} = 0 \) generate the equation

$$\begin{aligned} p' + (\rho + p)\nu ' = \frac{E}{r^2}\left[ r^2 E\right] ' , \end{aligned}$$
(20)

which can be substituted for one of the field equations.

For this line element the EMGB field equations are given by

$$\begin{aligned} \rho + \frac{1}{2}E^2= & {} -\frac{3}{e^{4 \lambda } r^{3}} \left( 4 \alpha \lambda ^{'} + r e^{2 \lambda } - r e^{4 \lambda } - r^{2} e^{2 \lambda } \lambda ^{'} \right. \nonumber \\&\left. -\, 4 \alpha e^{2 \lambda } \lambda ^{'} \right) \end{aligned}$$
(21)
$$\begin{aligned} p -\frac{1}{2} E^2= & {} \frac{3}{e^{4 \lambda } r^{3}} \left( - r e^{4 \lambda } + \left( r^{2} \nu ^{'} + r + 4 \alpha \nu ^{'} \right) e^{2 \lambda } - 3 \alpha \nu ^{'} \right) \nonumber \\\end{aligned}$$
(22)
$$\begin{aligned} p + \frac{1}{2} E^2= & {} \frac{1}{e^{4 \lambda } r^{2}} \left( -e^{4 \lambda } - 4 \alpha \nu ^{''} + 12 \alpha \nu ^{'} \lambda ^{'} - 4 \alpha \left( \nu ^{'} \right) ^{2} \right) \nonumber \\&+ \frac{1}{e^{2 \lambda } r^{2}} \left( 1 - r^{2} \nu ^{'} \lambda ^{'} + 2 r \nu ^{'} - 2 r \lambda ^{'} + r^{2} \left( \nu ^{'} \right) ^{2} \right) \nonumber \\&+ \frac{1}{e^{2 \lambda } r^{2}} \left( r^{2} \nu ^{''} - 4 \alpha \nu ^{'} \lambda ^{'} + 4 \alpha \left( \nu ^{'} \right) ^{2} + 4 \alpha \nu ^{''} \right) . \nonumber \\\end{aligned}$$
(23)
$$\begin{aligned} e^{-\lambda }\left( r^2 E\right) '= & {} r^2 \sigma \end{aligned}$$
(24)

in the canonical spherical coordinates.

Employing the transformations \( e^{2 \nu } = y^{2}(x) \), \( e^{-2 \lambda } = Z(x) \) and \( x = C r^{2}\) (C a constant) the field equations (21)–(24) may be rewritten as

$$\begin{aligned}&\frac{3 (1-Z) ( 1 - 4 \alpha C \dot{Z} )}{x} -3\dot{Z} = \frac{\rho }{C} + \frac{E^2}{2C} \end{aligned}$$
(25)
$$\begin{aligned}&\frac{3 (Z - 1)}{x} + \frac{6 Z \dot{y}}{y} - \frac{24 \alpha C (Z - 1) Z \dot{y}}{x y} = \frac{p}{C} - \frac{E^2}{2C} \end{aligned}$$
(26)
$$\begin{aligned}&2 x Z \left( 4 \alpha C [1-Z] + x \right) \ddot{y} + \left( x^{2} \dot{Z} \right. \nonumber \\&\quad \left. +\, 4 \alpha C \left[ x \dot{Z} - 2 Z + 2 Z^{2} - 3 x Z \dot{Z} \right] \right) \dot{y} \nonumber \\&\quad +\, \left( 1 + x \dot{Z} - Z -\frac{E^2}{C} x \right) y = 0 \end{aligned}$$
(27)
$$\begin{aligned}&\frac{4Z}{x}\left( x\dot{E} + E \right) ^2 = \frac{\sigma ^2}{C} \end{aligned}$$
(28)

where (27) is the equation of pressure isotropy. Equation (27) has been arranged as a second order differential equation in y. However, it should be noted that (27) may also be regarded as a first order ordinary differential equation in Z. Essentially the system (25)–(28) comprise an under-determined system of four coupled partial differential equations in six unknowns. To complete the system two choices for the geometric or matter variables may be made or alternatively a functional dependence of one quantity on another, such as an equation of state, may be selected and then a second choice made. Clearly all the matter variables may be written explicitly in terms of the metric functions Z and y. This means that any metric can satisfy the EMGB field equations. This is also true for the simpler Einstein–Maxwell field equations. However, arbitrary choices of metrics will not easily yield dynamical variables that may be considered physically reasonable. It would hardly be expected that an equation of state may exist if random metrics are selected. Prescribing an equation of state then creates the problem of an intractable system – nevertheless this is a viable direction that is being pursued by the author in a different work. For the purposes of this investigation we elect to nominate an electric field intensity that behaves essentially as the reciprocal of the radius to conform with the Newtonian case. The metric ansatz chosen, namely the Vaiyda–Tikekar one, has been extensively studied and shown to generate models that do satisfy the elementary requirements for physical acceptability. Hence, this is a route we pursue in order to study the effect of the higher curvature terms on the gravitational behavior of the charged fluid when compared to general relativity (GR).

Note that on setting \(\alpha = 0\) in the system (25)–(28) these equations take the form

$$\begin{aligned}&\frac{3 (1-Z) }{x} -3\dot{Z} = \frac{\rho }{C} + \frac{E^2}{2C}, \end{aligned}$$
(29)
$$\begin{aligned}&\frac{3 (Z - 1)}{x} + \frac{6 Z \dot{y}}{y} = \frac{p}{C} - \frac{E^2}{2C}, \end{aligned}$$
(30)
$$\begin{aligned}&2 x^2 Z \ddot{y} + x^{2} \dot{Z} \dot{y} +\left( \dot{Z} x - Z + 1 - \frac{E^2}{C} x \right) y = 0, \end{aligned}$$
(31)
$$\begin{aligned}&\frac{4Z}{x}\left( x\dot{E} + E \right) ^2 = \frac{\sigma ^2}{C}, \end{aligned}$$
(32)

which constitute the 5-dimensional Einstein equations for static charged perfect fluid spheres. In what follows we report new exact models for the EMGB field equations and then analyze the role of the Gauss–Bonnet coupling by setting it to zero to facilitate a comparison with the 5-D Einstein charged spacetime.

The following conditions are usually imposed on models as elementary physical requirements. It is required that the energy density (\(\rho \)) and pressure (p) are positive. The pressure should vanish for some radial value \(r = R\). The sound speed should be less than the speed of light, that is, \(0< \frac{\mathrm{d}p}{\mathrm{d}\rho } < 1\). Across the boundary \(r=R\) the interior metric should match with the exterior charged Boulware–Deser spacetime [5]

$$\begin{aligned} \mathrm{d}s^2= & {} -\mathcal{{F}}(r) \mathrm{d}t^2 + \frac{\mathrm{d}r^2}{\mathcal{{F}}} + r^{2} \nonumber \\&\times \left( \mathrm{d}\theta ^{2} + \sin ^{2} \theta \mathrm{d} \phi ^2 + \sin ^{2} \theta \sin ^{2} \phi \mathrm{d}\psi ^2 \right) \end{aligned}$$
(33)

where \(\mathcal{{F}}(r) = K + \frac{r^2}{4\alpha } \left( 1-\sqrt{1 + \frac{8\alpha M}{r^4} - \frac{8\alpha Q^2}{3r^6}} \right) \) in the absence of the cosmological constant. Recall that \(\alpha \) is a coupling constant related to the string tension in string theory and K is an arbitrary constant. Note that M and Q represent the gravitational mass and charge of the fluid as measured by an observer at spatial infinity. It should be disclosed that these boundary conditions are extrapolated from the standard Einstein case. The junction conditions for the EGB framework was discussed by Davis [40]; however, these results have yet to be transformed to an explicit usable form for modeling purposes.

4 Generalized Vaidya–Tikekar ansatz

As the EMGB field equations constitute a system of four field equations in six unknowns, functional forms for any two of the matter or geometrical quantities may be postulated and by integration the remaining variables may be determined. The alternative approach is to specify an equation of state relating the isotropic particle pressure and the energy density, that is \(p=p(\rho )\). This approach has given rise to difficulties in the simpler version of the Einstein equations therefore is not pursued in this framework at present. For example, see the work of Nillson and Uggla [41, 42] where the analysis of both the barotropic gamma law equation of state as well as the polytropic distribution was discussed numerically in the context of general relativity. Exact solutions were not located. A more productive approach appears to be selecting a form of one of the gravitational potentials y or Z and also prescribing how the electric field E behaves. This is the route followed here.

In our investigation we study the gravitational potential in the form

$$\begin{aligned} e^{-2\lambda } = Z=\frac{1+ax}{1+bx} \end{aligned}$$
(34)

where a and b are two real parameters. This may be recognized as a generalisation of the Vaidya–Tikekar ansatz [43]. Setting \(b=1\) then the parameter a is understood as the spheroidal parameter as discussed in [43]and which has been used in the construction of models of superdense stars. Setting \(a=0\) and \(b=1\) regains the Finch–Skea metric [44]. The case \(b=0\) and \(a=1\) corresponds to the Schwarzschild interior metric in Einstein gravity and which has been shown to be a persistent solution in other theories of gravity such as Lovelock gravity [19]. This case deserves special consideration and will be considered in a different article. Putting \(a=b\) reduces the metric to a Minkowski spacetime for \(Z=1\). More general constant gravitational potentials deserve detailed treatment in their own right as they may generate isothermal fluid spheres with the Newtonian behavior density falling off according to the inverse square law and a linear barotropic equation of state. It has been shown that isothermal fluids are universal in Lovelock gravity [45] and that the necessary and sufficient condition for isothermal behavior is a constant gravitational potential. The Einstein version [46] was regained as a special case.

With the general ansatz (34), the master field equation (27) assumes the form

$$\begin{aligned}&2x(1+ax)(1+bx)(1-ak+b(k+x))\ddot{y} \nonumber \\&\quad +\, (a-b)x(1+3bk+bx+ak(2bx-1))\dot{y} \nonumber \\&\quad -\,(1+bx)\left( (a-b)bx +(1+bx)^2\frac{E^2}{C}\right) y=0 \end{aligned}$$
(35)

where we have put \(4\alpha C = k\). It now remains to select suitable forms for the electrostatic function E to allow for the complete integration of (35). The choice

$$\begin{aligned} \frac{E^2}{C} = \frac{(b-a)bx}{(1+bx)^2} \end{aligned}$$
(36)

for the electric field is motivated by the fact that the last term on the left of (35) vanishes thus effectively reducing the order of the differential equation to first order. Moreover, it is a physically viable choice and has the property that the electric field disappears at the stellar center \(x=0\). Also the right hand side is positive provided \(b(a-b)<0\). The electric field has a maximum or minimum value (depending on whether \(a > b\) or not, of \(\frac{C(b-a)}{4}\) when \(x=\frac{1}{b}\).

With this prescription, the field equation (35) is solved exactly by

$$\begin{aligned} y(x)= & {} c_1 \left( \frac{(a-b) (2 a k+1) \log \left( 2 a b x+2 \sqrt{ab(1+ax)(1+bx)}+a+b\right) }{2 a^{3/2} \sqrt{b}} \right. \nonumber \\\end{aligned}$$
(37)
$$\begin{aligned}&\left. +\frac{k^{3/2} (a-b) \log (-a k+b (k+x)+1)}{\sqrt{b(ak-1)}} \right. \nonumber \\&\left. -\frac{k^{3/2} (a-b) \log \left( \sqrt{b} \left( 2 a b k x+2 \sqrt{bk(ak-1)(1+ax)(1+bx)} + (a+b) k -b x-1\right) \right) }{\sqrt{b(ak-1)}} \right. \nonumber \\&\left. +\frac{\sqrt{(1+ax)(1+bx)} }{a}\right) +c_2 \end{aligned}$$
(38)

where \(c_1\) and \(c_2\) are constants of integration. Note immediately that the choices \(a=0\) and \(b=0\) are excluded from the solution (38). These cases must be treated separately. The energy density, pressure and proper charge density may now be obtained with the help of (25), (26) and (28), however, given the lengthy form of the solution (38), it will be instructive to examine the physical behavior for specific cases with a known Einstein analogue.

4.1 Vaidya–Tikekar case \(a=1\), \(b=2\)

The case \(Z=\frac{1+2x}{1+x}\) was investigated thoroughly by Vaidya and Tikekar [43] for a 4-dimensional perfect fluid source without charge. The electric field in our case simplifies to

$$\begin{aligned} \frac{E^2}{C} = \frac{2x}{(1+2x)^2} \end{aligned}$$
(39)

while the gravitational potential has the form

$$\begin{aligned} y= & {} c_1 \left( \!\frac{k^{3/2}}{ \sqrt{k-1}} \log \frac{\left( \sqrt{2} \left( k(4 x+ 3) + 2 \sqrt{2(k-1)k(x+1)(2 x+1)} -(2 x+1)\right) \right) }{ (2 (k+x)-k+1)} \right. \nonumber \\&\left. -\frac{(2 k+1) \log \left( 4 x+2 \sqrt{2(x+1)(2 x+1)}+3\right) }{2 }+\sqrt{2(x+1)(2 x+1)}\right) +c_2 \nonumber \\ \end{aligned}$$
(40)

for \(k\ne 1\). The energy density is given by

$$\begin{aligned} \frac{\rho }{C} =\frac{ \left( 3 k+10 x^2+17 x+6\right) }{(2 x+1)^3} \end{aligned}$$
(41)

while the pressure has the form

$$\begin{aligned} \frac{p}{C} = \frac{x}{(2 x+1)^2}-\frac{3}{2 x+1} -\frac{24 c_1 \sqrt{x+1} \, V}{ \sqrt{2x+1} \, L H S } \end{aligned}$$
(42)

where we have made the redefinitions \(H=\left( k (4 x+3) -(2 x+1) +2 \sqrt{2k(k-1)(x+1)(2x+1)} \right) \) \(J=\left( 8 x^2+4 \left( \sqrt{2(x+1)(2x+1)} +3\right) x +3 \sqrt{2(x+1)(2x+1)}+4\right) \) \(L=\left( 4 x+ 3 + 2 \sqrt{2(x+1)(2x+1)} \right) \) \(S= 2 \sqrt{2} c_1 k^{3/2} \log \frac{(k+2 x+1)}{\sqrt{2}H} - 2 \sqrt{k-1} \left( c_1 \sqrt{(x+1)(2x+1)} +c_2\right) - \sqrt{2} c_1 (2 k+1) \sqrt{k-1} \log L\) \(V = 2 \sqrt{k} J(k-1) +\sqrt{k-1}L \left( k (4 x+3) - (2 x+1) \right) \) for simplicity. The expression for the sound speed is easily achievable but is omitted for brevity. Similarly it is straightforward to write the constants \(c_1\) and \(c_2\) in terms of M, Q and R using the zero boundary pressure condition \(p(R)=0\) as well as the continuity of \(g_{11}\) across \(r=R\), since this amounts to solving two algebraic equations linear in \(c_1\) and \(c_2\); however, we do not display the lengthy expressions. An important observation in this model is that an equation of state exists and is easily calculated. From Eq. (41) x may be expressed in terms of \(\rho \) and the resulting expression for \(\rho \) may be substituted in (42) to give the functional dependence of pressure on density as desired.

4.2 Finch–Skea case

The Finch–Skea [44] case is obtained for \(a=0\) and \(b=1\), that is, \(Z = \frac{1}{1+x}\). In this case the other gravitational potential is given by

$$\begin{aligned} y= & {} \frac{2}{3} c_1 \bigg (3 k^{3/2} \tan ^{-1}\bigg (\frac{\sqrt{x+1}}{\sqrt{k}}\bigg ) \nonumber \\&+\,\sqrt{x+1} (-3 k+x+1)\bigg )+c_2 \end{aligned}$$
(43)

for integration constants \(c_1\) and \(c_2\). This case is of particular importance as it has been demonstrated to correspond to realistic stellar distributions in Einstein gravity according to the theory of Walecka [47]. The electric field intensity is given by

$$\begin{aligned} \frac{E^2}{C} =\frac{x}{(x+1)^2} =\frac{Cr^2}{(1+Cr^2)^2} \end{aligned}$$
(44)

and correspondingly the proper charge density assumes the form

$$\begin{aligned} \frac{\sigma ^2}{C} = \frac{C (x+3)^2}{(x+1)^5} = \frac{C(3 +Cr^2)^2}{(1+Cr^2)^5} \end{aligned}$$
(45)

The energy density and pressure have the forms

$$\begin{aligned} \frac{\rho }{C}= & {} \frac{6 k+5 x^2+17 x+12}{2 (x+1)^3} \end{aligned}$$
(46)
$$\begin{aligned} \frac{p}{C}= & {} \frac{2 c_1 (x+1) \left( 3 k (5 x+6)-5 x^2+7 x+12\right) -3 c_2 \sqrt{x+1} (5 x+6)}{2 (x+1)^{5/2} \left( 6 c_1 k^{3/2} \tan ^{-1}\left( \frac{\sqrt{x+1}}{\sqrt{k}}\right) +2 c_1 \sqrt{x+1} (-3 k+x+1)+3 c_2\right) } \nonumber \\&- \frac{ 6 c_1 k^{3/2} \sqrt{x+1} (5 x+6) \tan ^{-1}\left( \frac{\sqrt{x+1}}{\sqrt{k}}\right) }{2 (x+1)^{5/2} \left( 6 c_1 k^{3/2} \tan ^{-1}\left( \frac{\sqrt{x+1}}{\sqrt{k}}\right) +2 c_1 \sqrt{x+1} (-3 k+x+1)+3 c_2\right) }, \nonumber \\ \end{aligned}$$
(47)

respectively. Note that solving the cubic equation (46) for x and plugging into (47) gives a barotropic equation of state for this model. The equation of state is explicitly given by

$$\begin{aligned} p= & {} 18\sqrt{6}\left( 60-3\sqrt{6}h -\frac{5}{108\rho ^3} \left( h^2 -6\rho \right) ^3 \right. \nonumber \\&\left. + \frac{17}{18\rho ^2} \left( 6\rho - h^2\right) ^2 +\frac{1}{6\rho } \left( h^2 - 6\rho \right) \left( 104 - 5\sqrt{\frac{3}{2\rho ^2}} h\right) \right. \nonumber \\&\left. -\sqrt{\frac{6}{\rho ^2}} h \left( 6 + \frac{5}{6\rho } \left( h^2 -6\rho \right) \right) \tanh ^{-1} \frac{h}{\sqrt{6\rho }} \right) \nonumber \\&\bigg / \left( \left( \frac{1}{\rho } h^2\right) ^{\frac{5}{2}} \left( 3 -\sqrt{\frac{8}{3\rho ^2}} h + \frac{1}{3\sqrt{6}\rho ^3} h \left( h^2 -6\rho \right) \right. \right. \nonumber \\&\left. \left. + 6\tanh ^{-1} \frac{h}{\sqrt{6\rho }} \right) \right) \end{aligned}$$
(48)

where we have substituted

$$\begin{aligned} h= & {} \bigg (-\sqrt{3}{3 \sqrt{3} \sqrt{\rho ^2 (16 \rho (243 \rho +301)+1775)}-9 \rho (36 \rho +35)-125} \nonumber \\&+\frac{-42 \rho -25}{\sqrt{3}{3 \sqrt{3} \sqrt{\rho ^2 (16 \rho (243 \rho +301)+1775)}-9 \rho (36 \rho +35)-125}}+5\bigg )^{1/2}\nonumber \\ \end{aligned}$$
(49)

to shorten the lengthy expression for \(p(\rho )\). Although cumbersome and complicated, the equation of state does indeed exist and this underscores the methodology used that of specifying a gravitational potential and the electric field intensity. If an equation of state were imposed early in the model the mathematical complexity might not have permitted a complete discovery of the model.

The sound speed may be expressed as

$$\begin{aligned} \frac{\mathrm{d}p}{\mathrm{d}\rho }= & {} -\left\{ (x+1) \left( 12 c_1 k^{3/2} (k+x+1) \left( c_1 \sqrt{x+1} \right. \right. \right. \nonumber \\&\times \left( 5 \left( 2 x^2+3 x+1\right) -6 k (5 x+7)\right) \nonumber \\&\left. \left. \left. +3 c_2 (5 x+7)\right) \tan ^{-1}\left( \frac{\sqrt{x+1}}{\sqrt{k}}\right) \right. \right. \nonumber \\&\left. \left. +\,36 c_1^2 k^3 (5 x+7) (k+x+1) \tan ^{-1}\left( \frac{\sqrt{x+1}}{\sqrt{k}}\right) ^2 \right. \right. \nonumber \\&\left. \left. +\,6 c_1 c_2 \sqrt{x+1} \left( -6 k^2 (5 x+7)-k \left( 20 x^2+57 x+37\right) \right. \right. \right. \nonumber \\&\left. \left. \left. +5 (x+1)^2 (2 x+1)\right) +4 c_1^2 (x+1) \right. \right. \nonumber \\&\times \left. \left. \left( 9 k^3 (5 x+7)+3 k^2 \left( 5 x^2+21 x+16\right) \right. \right. \right. \nonumber \\&\left. \left. \left. -\,k (x+1)^2 (25 x+17 ) +(x+1)^3 (5 x-29)\right) \right. \right. \nonumber \\&\left. \left. +\,9 c_2^2 (5 x+7) (k+x+1)\right) \right\} / \left\{ (k+x+1)\right. \nonumber \\&\times \left( 18 k+5 x^2+24 x+19\right) \left( 6 c_1 k^{3/2} \tan ^{-1}\left( \frac{\sqrt{x+1}}{\sqrt{k}}\right) \right. \nonumber \\&\left. \left. +\,2 c_1 \sqrt{x+1} (-3 k+x+1)+3 c_2\phantom {\left( \frac{\sqrt{x+1}}{\sqrt{k}}\right) }\right) ^2\right\} \end{aligned}$$
(50)

The mass function is computed from \(m(r)=\int \rho (r) r^2 dr\) and is given by

$$\begin{aligned}&(m(r))_{\mathrm{EGB}} = \frac{1}{8} \left( \frac{r \left( 20 r^4+29 r^2+3\right) }{\left( r^2+1\right) ^2}-3 \tan ^{-1}(r)\right) \end{aligned}$$
(51)
$$\begin{aligned}&(m(r))_{\mathrm{GR}} = \frac{1}{2} \left( -\frac{7 r}{2 \left( r^2+1\right) }+5 r-\frac{3}{2} \tan ^{-1}(r)\right) \end{aligned}$$
(52)

for the EGB and GR frameworks, respectively. Solving the vanishing boundary condition and the continuity of metric potentials across \(r=R\) we obtain

$$\begin{aligned} c_1= & {} \frac{(5X+1) \left( -3 k K+(X-1)\left( \sqrt{3} \sqrt{\frac{24 \alpha M R^2-8 \alpha Q^2+3 R^6}{R^6}}-3 \right) \right) }{k \sqrt{X} \left( f-36X\right) } \end{aligned}$$
(53)
$$\begin{aligned} c_2= & {} \frac{\left( 30 k^{3/2} (X-1) \tan ^{-1}\left( \frac{\sqrt{X}}{\sqrt{k}}\right) X -f\sqrt{X}\right) \left( 3 k K- (X-1)\left( \sqrt{3} \sqrt{\frac{24 \alpha M R^2-8 \alpha Q^2+3 R^6}{R^6}}+3 \right) \right) }{3 k \sqrt{X} \left( f-36X\right) } \end{aligned}$$
(54)

for the integration constants and where we have put \(X=1+CR^2\) and \(f=15 k (X-1) +18 k -5 X^2 +17X \). Note that a boundary certainly exists in this model as setting \(p=0\) amounts to solving a cubic algebraic equation and the existence of at least one real-valued solution is guaranteed. In order to examine the physical properties of our model graphically we select the following parameter values: \(c_1 =c_2= k=C=1\). Plots of the dynamical quantities have been generated with the help of Mathematica 11.

Fig. 1
figure 1

Plot of energy density \(\rho /C\) versus radial value x

Fig. 2
figure 2

Plot of pressure p / C versus radial value x

The plots display some important information about the viability of our model to represent realistic distributions of charged fluids. The pressure plot Fig. 2 reveals that the pressure is zero for the radial value \(x=3\) units (EGB) and \(x=2,5\) units (GR). This suggests that spheres of larger radius are admitted through the introduction of higher derivative terms in the lagrangian density. Additionally note that the pressure decreases monotonically outwards from the center for both EGB and GR. Within these radii, Fig. 1 shows that the energy density is always positive and also has a negative gradient. Moreover, for the same radius the sphere in EGB has a greater density in general.

To date formulas for the sound speed as well as the gravitational mass in EGB are not explicitly known. We consider the quantity \(\frac{\mathrm{d}p}{\mathrm{d}\rho }\), which represents the sound speed in general relativity as a naive value for the speed of sound in EGB so as to make comparisons. Finding the correct expression for the sound speed will entail examining the adiabatic perturbations to the static background and to derive the wave equation for the density fluctuations. This is a rigorous calculation beyond the scope of this article. We note that Fig. 3 demonstrates that the sound speed remains lower than the light speed in that \(0< \frac{\mathrm{d}p}{\mathrm{d}\rho } < 1\) within the boundary for the EGB case. On the other hand, the graphs suggest that causality is violated in the radial interval \(0< x < 1\) for the GR framework. In other words, the higher curvature terms due to the Gauss–Bonnet contribution have the effect of correcting the defects in the general theory of relativity. It has also been established graphically that the quantity \(\frac{\mathrm{d}p}{\mathrm{d}\rho }\) is stable under radial perturbations. Observe that stability criteria for the sound speed developed by Herrera [48] through the concept of cracking are applicable to anisotropic distributions and for the standard Einstein equations. In this regard Hossein et al. [49] used the idea of cracking to test their anisotropic model for a stable sound speed. These concepts have yet to be adapted to isotropic spheres in higher derivative gravity regimes.

Fig. 3
figure 3

Plot of sound speed \(\frac{\mathrm{d}p}{\mathrm{d}\rho }\) versus radial value x

Fig. 4
figure 4

Plot of EGB energy conditions \(\rho - p, \rho + p, \rho + 3p\) versus radial value x

Fig. 5
figure 5

Plot of GR energy conditions \(\rho - p, \rho + p, \rho + 3p\) versus radial value x

Fig. 6
figure 6

Plot of electric field intensity \(E^2/C\) versus radial value x

Fig. 7
figure 7

Plot of proper charge density \(\sigma ^2/C\) versus radial value x

Fig. 8
figure 8

Plot of compactification function \(\frac{m(r)}{r}\) versus radial value r

The energy conditions are plotted in Figs. 4 and 5 and we can observe that the weak, strong and dominant energy conditions are satisfied everywhere within the fluid for both gravity models: \(\rho - p> 0, \rho + p > 0\) and \(\rho + 3p > 0\). From Figs. 6 and 7 it can be noted that the electric field increases for a while and then slowly drops off towards the boundary and the proper charge density is always positive and a smoothly decreasing function outwardly. Since E and \(\sigma \) are independent of y, the plots for EGB and GR are the same. Finally Fig. 8 demonstrates a higher compactification values for the function \(\frac{m(r)}{r}\) in the EGB framework when compared to GR. Interestingly both compactification functions have the same \(\displaystyle {\lim _{r\rightarrow \infty }} = \frac{5}{2}\). All of these are reasonable conditions for a perfect fluid sphere in an Einstein–Maxwell field. Clearly the higher curvature terms have a marked impact on the gravitational behavior of the static charged fluid sphere and the indications are that undesirable features such as causality violation may be eliminated through the introduction of higher curvature terms.

4.3 Schwarzschild metric ansatz

Setting \(a=1\) and \(b=0\) generates the Schwarzschild potential \(Z=1+x\). The solution (35) simplifies to

$$\begin{aligned} y=c_1\sqrt{1+x} + c_2 \end{aligned}$$
(55)

which is also identical to the remaining Schwarzschild potential for a constant density perfect fluid in Einstein gravity. The reason for this is that for this choice of Z the electric field vanishes. This means that a different functional form for E should be chosen to obtain a model of a charged fluid. This will be pursued in a different article.

4.4 Isothermal type potential

The case of a constant gravitational potential \(Z = B\) for B some constant, generates the solution

$$\begin{aligned} y= c_1 + c_2\left( x+k(B-1)\ln (k(1-B)+x) \right) \end{aligned}$$
(56)

The complete solution for the energy density, pressure, charge density and speed of sound, respectively, is given by

$$\begin{aligned}&\frac{\rho }{C} = \frac{5 (1-B)}{2 x} \end{aligned}$$
(57)
$$\begin{aligned}&\frac{p}{C} = \frac{5 (B-1)^2 c_1 k \log (k(1-B)+x)+(17 B-5) c_1 x+5 (B-1) c_2}{2 x \left( (B-1) c_1 k \log (k(1-B)+x)+c_1 x+c_2\right) } \end{aligned}$$
(58)
$$\begin{aligned}&\frac{\sigma ^2}{C^2} = \frac{(1-B) B }{x^2} \end{aligned}$$
(59)
$$\begin{aligned}&\frac{E^2}{C} = \frac{1-B}{x} \end{aligned}$$
(60)
$$\begin{aligned}&\frac{\mathrm{d}p}{\mathrm{d}\rho } = \frac{12 B c_1^2 x^3}{5 (B-1) ((B-1) k-x) \left( (B-1) c_1 k \log (k(1-B)+x)+c_1 x+c_2\right) {}^2}-1 \nonumber \\ \end{aligned}$$
(61)

Demanding a positive energy density requires \(B<1\) from (57) while ensuring the right hand side of (59) and (60) remains positive restricts B to \(0< B < 1\). Therefore this model will only be physically reasonable if \(0<B<1\). The vanishing of the pressure is also possible although this requires solving a non-algebraic equation – however, such a radial value exists demarcating the boundary of the fluid. Observe that the energy density obeys the inverse square law \(\rho \sim \frac{1}{r^2}\), which is characteristic of isothermal fluid spheres in Newtonian gravity. However, the linear barotropic equation of state (\(p \sim \rho \)) is not in effect here. An equation of state does indeed exist for this solution as x may easily be found in terms of \(\rho \) via (57) and this may then be substituted in (58) to give the equation of state \(p=p(\rho )\) explicitly. It has also been established by Dadhich et al. [45] that a constant gravitational potential is a necessary and sufficient condition for isothermal behavior for pure Lovelock gravity where the action is constructed using the \(N^{th}\) order term in the Lovelock polynomial. To ensure a subluminal sound speed, it is required that (61) lie between 0 and 1. The forms of the expressions do not allow for an analytic treatment and the use of graphical representations may prove useful. The vanishing of the surface pressure at the boundary \(r = R\) together with the matching of gravitational potentials \(g_{00}\) of the charged Boulware–Deser (33) metric fix the values of the integration constants as

$$\begin{aligned}&c_1 = -\frac{5 (B-1) V}{12 \alpha \left( (5-17 B) C R^2+5 (B-1) \text {CR}^2\right) } \end{aligned}$$
(62)
$$\begin{aligned}&c_2 = \frac{\left( 5 (B-1)^2 k \log \left( -B k+C R^2+k\right) +(17 B-5) C R^2\right) V}{12 \alpha \left( (5-17 B) C R^2+5 (B-1) \text {CR}^2\right) }\nonumber \\ \end{aligned}$$
(63)

in terms of the mass M and charge Q of the fluid and where we have put

\(V=R^2 \left( \sqrt{\frac{72 \alpha M}{R^4}-\frac{24 \alpha Q^2}{R^6}+9}-3\right) -12 \alpha K\) for simplicity.

5 Discussion

We have written the EMGB field equations governing the behavior of a static ball of perfect fluid matter in the presence of an electric field. Exact solutions of the field equations were obtained by prescribing one of the metric potentials as well as by prescribing the electric field intensity to behave dimensionally as the reciprocal of the radius. The metric ansatz utilized generalized the spheroidal geometry discussed by Vaidya and Tikekar for their superdense star models. Special cases included the Vaidya–Tikekar [43] geometry, the Finch–Skea [44] metric, the Schwarzschild interior metric as well as the constant gravitational potential fluid sphere. The Schwarzschild choice coupled with the electric field prescribed failed to produce a charged distribution. A different electric field intensity must be selected to construct an EMGB model. In the remaining cases, it was possible to explicitly obtain exact solutions yielding the metric potentials, the energy density, pressure, electric field intensity and proper charge density. It was also demonstrated that in each case a hypersurface of zero pressure existed identifying the fluids boundary. Across this boundary the matching of gravitational potentials allowed one to the settle all integration constants. In the case of the Finch–Skea ansatz it was demonstrated graphically that suitable parameter values existed in order to generate a model that satisfied elementary physical requirements. In particular, it was shown that the sound speed always remained lower than the speed of light so that causality was maintained. The higher curvature terms support spheres of greater radius and density in the EGB regime when compared to the 5-dimensional Einstein case. Moreover, the GB term ensured that the model was causal, while the Einstein case suffered the defect of the fluid being superluminal from the center to a radial value well inside the boundary. This illustrates the potential of the Gauss–Bonnet higher curvature terms in correcting the physical behavior of realistic objects which is a clear improvement on general relativity. Importantly, it has been shown in each case that a barotropic equation of state exists in the EGB framework. This investigation therefore leads us to conclude that compact star models indeed do exist in the EMGB framework and that GB higher curvature terms improve the likelihood of models conforming to realistic distributions. The important open questions under investigation include the behavior of simple charged dust as well as the consequences of imposing a linear equation of state at the outset on the nonlinear system. In addition it will be useful to check the impact of the higher curvature terms on the properties of compact objects such as neutron stars and fluid planets. These studies are presently being undertaken.