1 Introduction

Experimental observations in the recent years have indicated that the universe is expanding [1,2,3,4]. The candidate referred to for the explanation of this expansion is known as dark energy (DE). DE is thought to be the energy density residing in the cosmological constant and its value is considered \(\rho _{\Lambda }\sim 10^{-3}\,\mathrm{eV}^4\) [5]. Modification of general relativity (GR) might also explain the existence of DE. The presence of some additional terms in the matter part of gravitational action which causes a minimum modification in GR can be helpful to explore the nature of the DE [6]. Another method to explain the cosmological acceleration is to modify the geometrical part of the action by coupling curvature scalars, topological invariants and their derivatives, which results in modified theories like f(R) gravity, \(f(\mathcal {G})\) gravity, f(RT) gravity etc., where R is the Ricci scalar, \(\mathcal {G}\) is the Gauss–Bonnet invariant, and T is the trace of the energy momentum tensor.

A new modified theory by considering a general function of R and \(\mathcal {G}\) as \(f(R,\mathcal {G})\) has gained popularity in recent years [7,8,9]. There are many interesting aspects of the Gauss–Bonnet theory which motivate the researchers to study modified theories of gravity involving the Gauss–Bonnet term. In particular, it have been shown that Gauss–Bonnet gravity can address the DE problem without the need for any exotic matter components [10]. The Gauss–Bonnet term is a specific combination of curvature invariants that includes Ricci scalar, Ricci and Riemann tensors. In fact the Gauss–Bonnet invariant naturally arises in the process of quantum field theory regularization and renormalization of curved spacetime. In particular, including \(\mathcal {G}\) and R in a bivariate function provides a double inflationary scenario where the two acceleration phases are led by \(\mathcal {G}\) and R, respectively [11]. Moreover, the involvement of the Gauss–Bonnet invariant may play an important role in the early time expansion of the universe as it is connected with the string theory and the trace anomaly [12]. The viability of modified Gauss–Bonnet gravity has been studied by considering different realistic models using the weak energy condition. It was concluded that \(f(R,\mathcal {G})\) gravity models show consistency with the recent observational data [13].

The symmetry approach performs a pivotal part to find exact solutions or simply reduce a nonlinear system of equations to a linear system of equations. In the literature (see [14,15,16,17,18,19,20,21,22,23,24] for references), Noether symmetries have been studied in the context of cosmology and astrophysics, in particular, to investigate the exact solutions of field equations. Noether symmetry is a proficient method to calculate unknown variables of differential equations. Sharif and Waheed [25] studied the Bardeen model and stringy charged black holes by using approximate symmetry methods. They also explored Noether symmetries of Friedmann–Robertson–Walker (FRW) and locally rotationally symmetric (LRS) Bianchi type-I (BI) universe models by adding an inverse curvature term in Brans–Dicke theory [26]. Capozziello et al. [27] discussed the FRW universe model in \(f(R,\mathcal {G})\) gravity using the Noether symmetry approach. In modified scalar–tensor gravity, Sharif and Shafique [28] studied the BI model using Noether and Noether gauge symmetry. Sharif and Fatima [29] investigated the Noether symmetry of the flat FRW model for vacuum and non-vacuum cases in f(G) gravity.

The spatially homogeneous but largely anisotropic nature of the early universe was disclosed after the discovery of cosmic microwave background radiation (CMBR) [30]. Bianchi type universe models can be considered to quantify the change of anisotropy in the early universe through recent observations. This universe model indicates that the anisotropy of the early universe determines the acceleration rate of the universe. If the primary anisotropy is less than this rate of acceleration it would lead to a highly isotropic universe [31, 32]. Akarsu and Kilinc [33] considered the BI model to study different equations of state (EoS) models which coincide with the de Sitter universe. Sharif and Zubair [34] studied the solutions of the BI universe model by using power-law and exponential expansions in scalar–tensor gravity. Shamir [35] explored exact solutions of the LRS BI universe model and investigated the physical behavior of the cosmological parameters in f(RT) gravity. Shamir and Ahmad [36] have discussed the Noether symmetry approach for the FRW universe model in \(f(\mathcal {G},\mathcal {T})\) gravity. In Ref. [37] the same authors explored some important cosmological solutions in \(f(\mathcal {G}, \mathcal {T})\) gravity, using Noether symmetries. In particular they found some interesting results by considering the LRS BI spacetime and the recovered \(\Lambda \mathrm{CDM}\) model universe for some specific choice of the \(f(\mathcal {G}, \mathcal {T})\) gravity model. Thus it seems interesting to investigate Noether symmetry of the anisotropic universe in modified gravity.

In this paper, we have explored the Noether symmetries of the BI cosmological model. The interesting physical forms of \(f(R,\mathcal {G})\) can be determined by the existence of the Noether symmetry which allows reducing the dynamics. The Noether symmetry approach has been broadly used for modified theories which gave some applicable results for cosmological systems. In this work exponential and power-law solutions are reported for a well-known \(f(R,\mathcal {G})\) model, i.e., \(f(R,\mathcal {G})=f_0R^n\mathcal {G}^{1-n}\). Especially, Kasner’s solution is recovered and it is anticipated that the familiar de Sitter spacetime giving \(\Lambda \mathrm{CDM}\) cosmology may be reconstructed for some suitable value of n. The layout of this paper is as follows: in Sect. 2 we give the gravitational action and Einstein field equations for modified Gauss–Bonnet gravity and derive a point-like canonical Lagrangian for configuration space. We explore the Noether symmetries for some cosmological models in Sect. 3. In Sect. 4 we discuss some examples of the exact solution in the cosmological context. Final remarks are given in the last section.

2 Modified field equations and Lagrangian framework

For \(f(R,\mathcal {G})\) gravity the most general action in 4-dimensions is [27]

$$\begin{aligned} \mathcal {A}= \int \mathrm{d}^{4}x \sqrt{-g}\left[ \frac{1}{2\kappa ^{2}}f(R,\mathcal {G})+\mathcal {L}_\mathrm{m}\right] , \end{aligned}$$
(1)

where \(\kappa \) is the coupling constant, \(\mathcal {L}_\mathrm{m}\) is the matter Lagrangian and g denotes the determinant of the metric tensor. \(\mathcal {G}\) indicates the Gauss–Bonnet invariant

$$\begin{aligned} \mathcal {G}\equiv R^{2}-4R_{\mu \nu }R^{\mu \nu }+R_{\mu \nu \lambda \sigma }R^{\mu \nu \lambda \sigma }, \end{aligned}$$
(2)

where \(R_{\mu \nu }\) is Ricci tensor, \(R_{\mu \nu \lambda \sigma }\) represents Riemann tensor and \(R=g^{\mu \nu }R_{\mu \nu }\) is called the Ricci scalar. From now onwards, we will use \(f(R,\mathcal {G})\equiv f\), \(\frac{\partial f(R,\mathcal {G})}{\partial \mathcal {G}}\equiv f_\mathcal {G}\), \(\frac{\partial f(R,\mathcal {G})}{\partial R}\equiv f_R\), etc. Variation of (1) with respect to the metric tensor, \(g_{\mu \nu }\), leads to the modified field equations [38]

$$\begin{aligned} \nonumber 0&=\kappa ^{2}T^{\mu \nu }+\frac{1}{2}g^{\mu \nu }f-2f_\mathcal {G}RR^{\mu \nu }+4f_\mathcal {G}R^{\mu }_{\rho }R^{\nu \rho }\\&\quad -2f_\mathcal {G}R^{\mu \rho \sigma \tau } R^{\nu }_{\rho \sigma \tau }-4f_\mathcal {G}R^{\mu \rho \sigma \nu }R_{\rho \sigma }\nonumber \\&\quad +2R\nabla ^{\mu }\nabla ^{\nu }f_\mathcal {G}-2g^{\mu \nu }R \nabla ^{2}f_\mathcal {G}-4\nabla _{\rho }\nabla ^{\mu }f_\mathcal {G}R^{\nu \rho }\nonumber \\&\quad -4R^{\mu \rho }\nabla _{\rho }\nabla ^{\nu }f_\mathcal {G} +4R^{\mu \nu }\nabla ^{2}f_\mathcal {G}\nonumber \\&\quad +4g^{\mu \nu }R^{\rho \sigma }\nabla _{\rho }\nabla _{\sigma }f_\mathcal {G} -4R^{\mu \rho \nu \sigma }\nabla _{\rho }\nabla _{\sigma }f_\mathcal {G}-f_\mathcal {G}R^{\mu \nu }\nonumber \\&\quad +\nabla ^{\mu }\nabla ^{\nu }f_\mathcal {G} -g^{\mu \nu }\nabla ^{2}f_\mathcal {G}, \end{aligned}$$
(3)

where \(\nabla \) represents the covariant derivative and the energy momentum tensor \(T_{\mu \nu }\) is defined as

$$T_{\mu \nu }=\frac{-2}{\sqrt{-g}}\frac{\delta (\sqrt{-g}\mathcal {L}_\mathrm{m})}{\delta g^{\mu \nu }}.$$

Let us note that the Einstein equations for GR are recovered by putting \(f(R,\mathcal {G})=R\), and by replacing \(f(R,\mathcal {G})\) with \(f(\mathcal {G})\), we obtain the field equations for \(f(\mathcal {G})\) gravity. We consider an LRS BI universe model, defined by the line element [39]

$$\begin{aligned} \mathrm{d}s^{2}=\mathrm{d}t^{2}-A(t)^2\mathrm{d}x^{2}-B(t)^{2}(\mathrm{d}y^{2}+\mathrm{d}z^{2}), \end{aligned}$$
(4)

where A and B are known as the cosmic scale factors of the universe. We need to find a point-like canonical Lagrangian \(\mathcal {L}(q^i,\dot{q}^i)\) from the gravitational action, defined on the configuration space Q and the corresponding tangent space TQ where \(q^{i}\) represents n generalized positions and dot denotes the time derivative. By using the technique of the Lagrange multipliers we can deduce R and \(\mathcal {G}\) as constraints for dynamics. In order to reduce the order of the derivatives in the Lagrangian \(\mathcal {L}\) we use the Lagrange multiplier approach and integrate by parts so that the Lagrangian \(\mathcal {L}\) becomes canonical [40]. We rewrite the action (1) as

$$\begin{aligned} \mathcal {A}= & {} 2\pi ^{2}\int \mathrm{d}tAB^{2}\Bigg [f(R,\mathcal {G})\nonumber \\&-\,\chi _{1}\left( R+2\left( \frac{\ddot{A}}{A}+2\frac{\ddot{B}}{B}+2\frac{\dot{A}\dot{B}}{AB}+ \frac{\dot{B}^{2}}{B^{2}}\right) \right) \nonumber \\&-\,\chi _{2}\left( \mathcal {G}-8\left( \frac{\ddot{A}\dot{B}^{2}}{AB^2}+2\frac{\dot{A}\dot{B}\ddot{B}}{AB^2}\right) \right) \Bigg ], \end{aligned}$$
(5)

where dot indicates the derivative with respect to time t and \(\chi _{1},\chi _{2}\) are the Lagrange multipliers. The Ricci scalar and the Gauss–Bonnet invariant for LRS BI metric is [39]

$$\begin{aligned} R= & {} -2\left( \frac{\ddot{A}}{A}+2\frac{\ddot{B}}{B}+2\frac{\dot{A}\dot{B}}{AB}+\frac{\dot{B}^{2}}{B^{2}}\right) ,\nonumber \\ \mathcal {G}= & {} 8\left( \frac{\ddot{A}\dot{B}^{2}}{AB^2}+2\frac{\dot{A}\dot{B}\ddot{B}}{AB^2}\right) . \end{aligned}$$
(6)

The Lagrange multipliers \(\chi _{1},\chi _{2}\) are obtained by varying the action (5) with respect to R and \(\mathcal {G}\), respectively, as

$$\begin{aligned} \chi _{1}=f_R,\quad \chi _{2}=f_\mathcal {G}. \end{aligned}$$
(7)

Using Eq. (7), the action (5) becomes

$$\begin{aligned} \mathcal {A}= & {} 2\pi ^{2}\int \mathrm{d}tAB^{2}\Bigg [f-f_R \Bigg (R \nonumber \\&\left. +\,2\left( \frac{\ddot{A}}{A}+2\frac{\ddot{B}}{B}+2\frac{\dot{A}\dot{B}}{AB}+\frac{\dot{B}^{2}}{B^{2}}\right) \right) \nonumber \\&-\,f_\mathcal {G} \left( \mathcal {G}-8\left( \frac{\ddot{A}\dot{B}^{2}}{AB^2}+2\frac{\dot{A}\dot{B}\ddot{B}}{AB^2}\right) \right) \Bigg ]. \end{aligned}$$
(8)

After an integration by parts, the Lagrangian turns out to be

$$\begin{aligned} \mathcal {L}= & {} 2A\dot{B}^{2}f_R+4\dot{A}\dot{B}Bf_R+2\dot{A}B^{2}\frac{\mathrm{d}}{\mathrm{d}t}f_R +4AB\dot{B}\frac{\mathrm{d}}{\mathrm{d}t}f_R\nonumber \\&-\,8\dot{A}\dot{B}^{2}\frac{\mathrm{d}}{\mathrm{d}t}f_\mathcal {G} +AB^{2}(f-Rf_R-\mathcal {G}f_\mathcal {G}). \end{aligned}$$
(9)

This is a point-like canonical Lagrangian whose configuration space is \(\mathcal {Q}\equiv \{A,B,R,\mathcal {G}\}\) and tangent space is \(\mathcal {QT}\equiv \{A,B,R,\mathcal {G},\dot{A},\dot{B},\dot{R},\dot{\mathcal {G}}\}\). Due to the highly nonlinear nature of the Lagrangian it is complicated to deal with it. For the sake of simplicity we assume \(B=A^{m}\). The physical importance of this assumption is that it gives a constant ratio of shear and expansion scalar [41]. Thus the Lagrangian (9) takes the form

$$\begin{aligned} \mathcal {L}= & {} 2m^2A^{2m-1}\dot{A}^{2}f_R+4mA^{2m-1}\dot{A}^{2}f_R\nonumber \\&+\,2A^{2m}\dot{A}\frac{\mathrm{d}}{\mathrm{d}t}f_R+4mA^{2m}\dot{A}\frac{\mathrm{d}}{\mathrm{d}t}f_R\nonumber \\&-\,8m^2A^{2m-2}\dot{A}^{3}\frac{\mathrm{d}}{\mathrm{d}t}f_\mathcal {G}\nonumber \\&+\,A^{2m+1}[f-Rf_R-\mathcal {G}f_\mathcal {G}], \end{aligned}$$
(10)

which is now a function of A, R and \(\mathcal {G}\).

3 Noether symmetry and \(f(R,\mathcal {G})\) gravity

In the presence of the Noether symmetry the constants of motion can be selected by the reduction of the dynamical system [42]. We consider the vector field and its first prolongation, respectively, as

$$\begin{aligned} X=\xi (t,q^j)\frac{\partial }{\partial t}+\eta ^i(t,q^j)\frac{\partial }{\partial q^j}, \end{aligned}$$
(11)
$$\begin{aligned} X^{[1]}=X+(\eta ^i_{,t}+\eta ^i_{,j}\dot{q}^j-\xi _{,t} \dot{q}^i-\eta _{,j}\dot{q}^j\dot{q}^i)\frac{\partial }{\partial \dot{q}^j}, \end{aligned}$$
(12)

where \(\xi \) and \(\eta \) are the coefficients of the generators, \(q^i\) provides n, the number of the positions, and the dot gives the derivative with respect to time t [43]. The vector field X produces the Noether gauge symmetry provided the condition

$$\begin{aligned} X^{[1]}\mathcal {L}+(D\xi )\mathcal {L}=DG(t,q^i) \end{aligned}$$
(13)

is preserved. Here \(G(t,q^i)\) denotes the gauge term and D is an operator defined by

$$\begin{aligned} D=\frac{\partial }{\partial t}+\dot{q}^i\frac{\partial }{\partial q^i}. \end{aligned}$$
(14)

The Euler–Lagrange equations are given by [44]

$$\begin{aligned} \frac{\partial \mathcal {L}}{\partial q^{i}}-\frac{\mathrm{d}}{\mathrm{d}t}\left( \frac{\partial \mathcal {L}}{\partial \dot{q}^{i}}\right) =0. \end{aligned}$$
(15)

Contraction of Eq. (15) with some unknown function \(\psi ^i\equiv \psi ^i(q^j)\) yields

$$\begin{aligned} \psi ^i\left( \frac{\partial \mathcal {L}}{\partial q^{i}}-\frac{\mathrm{d}}{\mathrm{d}t}\left( \frac{\partial \mathcal {L}}{\partial \dot{q}^{i}}\right) \right) =0, \end{aligned}$$
(16)

It is easy to verify that

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}t}\left( \psi ^i\frac{\partial \mathcal {L}}{\partial \dot{q}^i}\right) -\left( \frac{\mathrm{d}}{\mathrm{d}t}\psi ^i\right) \frac{\partial \mathcal {L}}{\partial \dot{q}^i}=\psi ^i\frac{\mathrm{d}}{\mathrm{d}t}\left( \frac{\partial \mathcal {L}}{\partial \dot{q}^i}\right) . \end{aligned}$$
(17)

Putting this value in Eq. (16) provides us with

$$\begin{aligned} L_{X}\mathcal {L}=\left( \frac{\mathrm{d}}{\mathrm{d}t}\psi ^i\right) \frac{\partial \mathcal {L}}{\partial \dot{q}^i}+\psi ^i\frac{\mathrm{d}}{\mathrm{d}t}\left( \frac{\partial \mathcal {L}}{\partial \dot{q}^i}\right) =\frac{\mathrm{d}}{\mathrm{d}t}\left( \psi ^i\frac{\partial \mathcal {L}}{\partial \dot{q}^i}\right) , \end{aligned}$$
(18)

where \(L_{X}\) is the Lie derivative with respect to the Noether vector X. The Lagrangian generates a Noether symmetry if the Lie derivative, for a vector field X, vanishes,

$$\begin{aligned} L_{X}\mathcal {L}=0. \end{aligned}$$
(19)

The energy condition is given by

$$\begin{aligned} \sum _i\dot{q}^i \frac{\partial \mathcal {L}}{\partial \dot{q}^i}=E_\mathcal {L}. \end{aligned}$$
(20)

We derive the Euler–Lagrange equations (15) for A, R, \(\mathcal {G}\), respectively:

$$\begin{aligned} \nonumber&2m(2m^2+3m-2)A^{2m-2}\dot{A}^{2}f_R\\ \nonumber&\quad +\,4m(m+2)A^{2m-1}\ddot{A}f_R+4m^2A^{2m-1}\dot{A}\frac{\mathrm{d}^2}{\mathrm{d}t^2}f_R\\ \nonumber&\quad -\,32m^2(m-1)A^{2m-3}\dot{A}^{3}\frac{\mathrm{d}}{\mathrm{d}t}f_\mathcal {G}+2(2m+1)A^{2m}\frac{d^2}{dt^2}f_R\\ \nonumber&\quad -\,48m^2A^{2m-2}\dot{A}\ddot{A}\frac{\mathrm{d}}{\mathrm{d}t}f_\mathcal {G} +4(m+1)A^{2m-1}\dot{A}\frac{\mathrm{d}}{\mathrm{d}t}f_R\\ \nonumber&\quad -\,24m^2A^{2m-2}\dot{A}^{2}\frac{d^2}{dt^2}f_\mathcal {G}-(2m+1)A^{2m}\big [f-Rf_R\\&\quad -\,\mathcal {G}f_\mathcal {G}\big ]=0, \end{aligned}$$
(21)
$$\begin{aligned} \nonumber&\left[ R+2\left( \frac{\ddot{A}}{A}+3m^2\left( \frac{\dot{A}}{A}\right) ^{2}+2m\frac{\dot{A}}{A}\right) \right] f_{RR}\\ \nonumber&\quad +\, \left[ \mathcal {G} +8\left( 2m^2\left( \frac{\dot{A}}{A}\right) ^{4}-2m^3\left( \frac{\dot{A}}{A}\right) ^{4}\right. \right. \\&\left. \left. \quad -\,3m^2\frac{\dot{A}^{2}\ddot{A}}{A^3}\right) \right] f_{R\mathcal {G}}=0, \end{aligned}$$
(22)
$$\begin{aligned} \nonumber&\left[ R+2\left( \frac{\ddot{A}}{A}+3m^2\left( \frac{\dot{A}}{A}\right) ^{2}+2m\frac{\ddot{A}}{A}\right) \right] f_{R\mathcal {G}}\\ \nonumber&\quad +\, \left[ \mathcal {G} +8\left( 2m^2\left( \frac{\dot{A}}{A}\right) ^{4}-2m^3\left( \frac{\dot{A}}{A}\right) ^{4}\right. \right. \\&\quad \left. \left. -\,3m^2\frac{\dot{A}^{2}\ddot{A}}{A^3}\right) \right] f_{\mathcal {G}\mathcal {G}}=0. \end{aligned}$$
(23)

It is important to note that (22) and (23) are symmetric. The energy condition (20) takes the form

$$\begin{aligned}&\left( \frac{\dot{A}}{A}\right) ^{2}f_R+\frac{\dot{A}}{A}\frac{\mathrm{d}}{\mathrm{d}t}f_R\nonumber \\&\quad -4\left( \frac{\dot{A}}{A}\right) ^{3}\frac{\mathrm{d}}{\mathrm{d}t}f_{\mathcal {G}} -\frac{1}{6}[f-Rf_R-\mathcal {G}f_{\mathcal {G}}]=0. \end{aligned}$$
(24)

The corresponding vector field becomes

$$\begin{aligned} X=\alpha \frac{\partial }{\partial A}+\beta \frac{\partial }{\partial R}+\gamma \frac{\partial }{\partial \mathcal {G}}+\dot{\alpha }\frac{\partial }{\partial \dot{A}}+\dot{\beta }\frac{\partial }{\partial \dot{R}}+\dot{\gamma }\frac{\partial }{\partial \dot{\mathcal {G}}}, \end{aligned}$$
(25)

The symmetry generators \(\alpha \), \(\beta \) and \(\gamma \) are functions of A, R and \(\mathcal {G}\). Using the Lagrangian (10) and the Noether equation (25), we get a system of partial differential equations (PDEs),

$$\begin{aligned} \nonumber&2m^3\alpha f_R + 3m^2\alpha f_R-2m\alpha f_R\nonumber \\&\quad +\,m^2\beta Af_{RR}+2m\beta Af_{RR}+m^2\gamma Af_{R\mathcal {G}}\nonumber \\&\quad +\,2m\gamma Af_{R\mathcal {G}}+ 2m^2A\frac{\partial \alpha }{\partial A}f_R\nonumber \\&\quad +\,4mA\frac{\partial \alpha }{\partial A}f_R+A^2\frac{\partial \beta }{\partial A}f_R+2mA^2\frac{\partial \beta }{\partial A}f_{RR}\nonumber \\&\quad +\,A^2\frac{\partial \gamma }{\partial A}f_{R\mathcal {G}}+2mA^2\frac{\partial \gamma }{\partial A}f_{R\mathcal {G}}=0, \end{aligned}$$
(26)
$$\begin{aligned}&2m\alpha f_{RR}+4m^2\alpha f_{RR}+2m\beta Af_{RRR}\nonumber \\&\quad +\,\beta Af_{RRR}+\gamma Af_{RR\mathcal {G}}+2m\gamma Af_{RR\mathcal {G}}\nonumber \\&\quad +\,A\frac{\partial \alpha }{\partial A}f_{RR}+2mA\frac{\partial \alpha }{\partial A}f_{RR}+2m^2A\frac{\partial \alpha }{\partial R}f_R\nonumber \\&\quad +\,4m\frac{\partial \alpha }{\partial R}f_R+A\frac{\partial \beta }{\partial R}f_{RR}\nonumber \\&\quad +\,2mA\frac{\partial \beta }{\partial R}f_{RR}+A\frac{\partial \gamma }{\partial R}f_{R\mathcal {G}}+2mA\frac{\partial \gamma }{\partial R}f_{R\mathcal {G}}=0, \end{aligned}$$
(27)
$$\begin{aligned}&2m\alpha f_{R\mathcal {G}}+4m^2\alpha f_{R\mathcal {G}}+\beta Af_{RR\mathcal {G}}\nonumber \\&\quad +\,2m\beta Af_{R\mathcal {G}\mathcal {G}}+\gamma Af_{RR\mathcal {G}}+2m\gamma Af_{R\mathcal {G}\mathcal {G}}\nonumber \\&\quad +\,A\frac{\partial \alpha }{\partial A}f_{R\mathcal {G}}+2mA\frac{\partial \alpha }{\partial A}f_{R\mathcal {G}}\nonumber \\&\quad +\,2m^2\frac{\partial \alpha }{\partial \mathcal {G}}f_R+4m\frac{\partial \alpha }{\partial \mathcal {G}}f_{R} +2mA\frac{\partial \beta }{\partial \mathcal {G}}f_{RR} \nonumber \\&\quad +\,A\frac{\partial \beta }{\partial \mathcal {G}}f_{RR}+A\frac{\partial \gamma }{\partial \mathcal {G}}f_{R\mathcal {G}} +2mA\frac{\partial \gamma }{\partial \mathcal {G}}f_{R\mathcal {G}}=0, \end{aligned}$$
(28)
$$\begin{aligned}&2m\alpha f_{R\mathcal {G}}-2\alpha f_{R\mathcal {G}}+\beta Af_{RR\mathcal {G}}\nonumber \\&\quad +\,\gamma Af_{R\mathcal {G}\mathcal {G}}+3A\frac{\partial \alpha }{\partial A}f_{R\mathcal {G}}+A\frac{\partial \beta }{\partial R}f_{R\mathcal {G}} +A\frac{\partial \gamma }{\partial R}f_{\mathcal {G}\mathcal {G}}=0,\nonumber \\ \end{aligned}$$
(29)
$$\begin{aligned}&2m\alpha f_{\mathcal {G}\mathcal {G}}-2\alpha f_{\mathcal {G}\mathcal {G}}+\beta Af_{R\mathcal {G}\mathcal {G}}\nonumber \\&\quad +\,\gamma Af_{\mathcal {G}\mathcal {G}\mathcal {G}}+3A\frac{\partial \alpha }{\partial A}f_{\mathcal {G}\mathcal {G}}+A\frac{\partial \beta }{\partial \mathcal {G}}f_{R\mathcal {G}} +A\frac{\partial \gamma }{\partial \mathcal {G}}f_{\mathcal {G}\mathcal {G}}=0,\nonumber \\ \end{aligned}$$
(30)
$$\begin{aligned} \frac{\partial \alpha }{\partial R}f_{R\mathcal {G}}+2m\frac{\partial \alpha }{\partial R}f_{R\mathcal {G}}+\frac{\partial \alpha }{\partial \mathcal {G}}f_{RR}+2m\frac{\partial \alpha }{\partial \mathcal {G}}f_{RR}=0, \end{aligned}$$
(31)
$$\begin{aligned} \frac{\partial \alpha }{\partial R}f_{R\mathcal {G}}=0,\quad \frac{\partial \alpha }{\partial R}f_{\mathcal {G}\mathcal {G}}+\frac{\partial \alpha }{\partial \mathcal {G}}f_{R\mathcal {G}}=0, \end{aligned}$$
(32)
$$\begin{aligned} \frac{\partial \alpha }{\partial R}f_{RR}+2m\frac{\partial \alpha }{\partial R}f_{RR}= & {} 0,\nonumber \\ \frac{\partial \alpha }{\partial \mathcal {G}}f_{R\mathcal {G}}+2m\frac{\partial \alpha }{\partial \mathcal {G}}f_{R\mathcal {G}}= & {} 0,\end{aligned}$$
(33)
$$\begin{aligned} \frac{\partial \alpha }{\partial \mathcal {G}}f_{\mathcal {G}\mathcal {G}}=0,\quad \frac{\partial \beta }{\partial A}f_{R\mathcal {G}}+\frac{\partial \gamma }{\partial A}f_{\mathcal {G}\mathcal {G}}=0, \end{aligned}$$
(34)
$$\begin{aligned}&(2m+1)\alpha [f-Rf_R -\mathcal {G}f_{\mathcal {G}}]-\beta A[Rf_{RR} +\mathcal {G}f_{R\mathcal {G}}]\nonumber \\&\quad -\,\gamma A[Rf_{R\mathcal {G}}+\mathcal {G}f_{\mathcal {G}\mathcal {G}}]=0. \end{aligned}$$
(35)

The system of PDEs obtained is over-determined. Hence it can be solved by assigning the suitable values to the unknown function \(f(R,\mathcal {G})\). Here we propose \(f(R,\mathcal {G})\) as a linear combination of power-law forms of R and \(\mathcal {G}\) as

$$\begin{aligned} f(R,\mathcal {G})=f_0R^l+f_1\mathcal {G}^n, \end{aligned}$$
(36)

where \(f_0,~f_1\) are the arbitrary constants and ln are any non-zero real numbers. We get a number of solutions, as follows:

$$\begin{aligned} l=1,\quad n=1,\quad \alpha =c_1A^{-m+\frac{1}{2}},\quad \beta =0,\quad \gamma =0, \end{aligned}$$
(37)
$$\begin{aligned} \nonumber l\ne & {} 1,\quad l=\frac{4m^2+4m+1}{3m^2+2m+1},\quad n=1,\quad \alpha =c_2A^{-\frac{3m^2}{2m+1}}, \\ \beta= & {} -\frac{c_2A^{-\frac{3m^2}{2m+1}}R(3m^2+2m+1)}{A(2m+1)},\quad \gamma =0. \end{aligned}$$
(38)

Here we have explored some additional symmetries and it would be worthwhile to mention that Eq. (37) agrees with [27] for special cases when \(m=1\). The corresponding Lagrangian for the particular functional form \(f(R,\mathcal {G})=f_{0}R+f_{1}\mathcal {G}\) becomes

$$\begin{aligned} \mathcal {L}=2m(m+2)f_0A^{2m-1}\dot{A}^2. \end{aligned}$$
(39)

The Euler–Lagrange equations and energy equation are calculated as

$$\begin{aligned} 2\frac{\ddot{A}}{A}+(2m-1)\left( \frac{\dot{A}}{A}\right) ^{2}=0, \end{aligned}$$
(40)
$$\begin{aligned} R+2\left( (2m+1)\frac{\ddot{A}}{A}+3m^2\frac{\dot{A}^{2}}{A^{2}}\right) =0, \end{aligned}$$
(41)
$$\begin{aligned} \mathcal {G}-8\left( m(2m+1)\frac{\ddot{A}\dot{A}^{2}}{A^{3}}+2m^2(m-1)\frac{\dot{A}^{4}}{A^4}\right) =0, \end{aligned}$$
(42)
$$\begin{aligned} \left( \frac{\dot{A}}{A}\right) ^{2}=0. \end{aligned}$$
(43)

In these equations the Gauss–Bonnet term \(\mathcal {G}\) disappears so this theory becomes nothing but General Relativity. If we consider the vacuum case we obtain the Minkowski spacetime.

3.1 Recovering Noether symmetries in f(R) and \(f(\mathcal {G})\) theories of gravity

Here we investigate the solution of the determining system of equations mainly for two different cases, for f(R) gravity and \(f(\mathcal {G})\) gravity. First we explore solutions for \(f(R,\mathcal {G})=f_0R^{n}\). The solutions of the determining equations are given by

$$\begin{aligned} \nonumber m= & {} \pm \frac{n-2+\sqrt{3n-2n^2}}{3n-4},\quad \alpha =c_3A^{\frac{-5n\pm 2\sqrt{3n-2n^2}+3n^2}{3n^2-4n}}, \\ \beta= & {} -\frac{c_3A^{\frac{-5n\pm 2\sqrt{3n-2n^2}+3n^2}{3n^2-4n}}R(n\pm 2\sqrt{3n-2n^2})}{(3n-4)An}. \end{aligned}$$
(44)

It is worthwhile to mention here that, for a special case when \(n={\frac{3}{2}}\), we obtain

$$\begin{aligned} m=1,\quad \alpha =\frac{c_3}{A},\quad \beta =-\frac{2c_3R}{A^2}, \end{aligned}$$
(45)

and the results agree with [21, 45]. To recover the Noether symmetries in \(f(\mathcal {G})\) gravity we choose \(f(R,\mathcal {G})=f_0\mathcal {G}^n\). The solution in this case turns out to be

$$\begin{aligned} m=-\frac{1}{2},\quad \alpha =c_4 A,\quad \gamma =0. \end{aligned}$$
(46)

4 Some exact cosmological solutions

Here we reconstruct some important cosmological solutions using an interesting \(f(R,\mathcal {G})\) model, i.e., \(f(R,\mathcal {G})=f_0R^n\mathcal {G}^{1-n}\) [27]. For the simplest non-trivial case, we choose \(n=2\). In this case the point-like Lagrangian (10) takes the form

$$\begin{aligned} \nonumber \mathcal {L}= & {} \frac{4f_{0}\dot{A}}{\mathcal {G}}\left[ (m^2+2m)A^{2m-1}\dot{A}R+(2m+1)A^{2m}\dot{R}\right. \nonumber \\&-\,(2m+1)A^{2m}\dot{\mathcal {G}}\frac{R}{\mathcal {G}}+4m^2A^{2m-2}\dot{A}^{2}\dot{R}\frac{R}{\mathcal {G}}\nonumber \\&\left. -\,4m^2A^{2m-2}\dot{A}^{2}\dot{\mathcal {G}}\left( \frac{R}{\mathcal {G}}\right) ^{2}\right] . \end{aligned}$$
(47)

Here the Euler–Lagrange equations becomes

$$\begin{aligned} \nonumber&m(2m^2+3m-2)A^{2m-2}\dot{A}^{2}\frac{R}{\mathcal {G}}+2m(m+2)A^{2m-1}\ddot{A}\frac{R}{\mathcal {G}}\\ \nonumber&\quad +\,2m(m+2)A^{2m-1}\dot{A}\frac{\dot{R}}{\mathcal {G}}\\ \nonumber&\quad -\,2m(m+2)A^{2m-1}\dot{A}\frac{R\dot{\mathcal {G}}}{\mathcal {G}^2}+(2m+1)A^{2m}\frac{\ddot{R}}{\mathcal {G}}\\ \nonumber&\quad -\,2(2m+1)A^{2m}\frac{\dot{R}\dot{\mathcal {G}}}{\mathcal {G}^2}-2(m+1)A^{2m}\frac{R\ddot{\mathcal {G}}}{\mathcal {G}^2} \\ \nonumber&\quad +\,2(2m+1)A^{2m}\frac{R\dot{\mathcal {G}^2}}{\mathcal {G}^3} +16m^2(m-1)A^{2m-3}\dot{A}^3\frac{R\dot{R}}{\mathcal {G}^2}\\ \nonumber&\quad +\,24m^2A^{2m-2}\dot{A}\ddot{A}\frac{R\dot{R}}{\mathcal {G}^2} \\ \nonumber&\quad +\,12m^2(m-1)A^{2m-3}\dot{A}^2\frac{\dot{R}^2}{\mathcal {G}^2}+12m^2A^{2m-2}\dot{A}^2\frac{R\ddot{R}}{\mathcal {G}^2}\\\nonumber&\quad -\,48m^2A^{2m-2}\dot{A}^2\frac{R\dot{R}\dot{\mathcal {G}}}{\mathcal {G}^3} \\ \nonumber&\quad -\,12m^2(m-1)A^{2m-3}\dot{A}^3\frac{R^2\dot{\mathcal {G}}}{\mathcal {G}^3}-24m^2A^{2m-2}\dot{A}\ddot{A}\frac{R^2\dot{\mathcal {G}}}{\mathcal {G}^3}\\&\quad -\,12m^2A^{2m-2}\dot{A}^2\frac{R^2\ddot{\mathcal {G}}}{\mathcal {G}^3} +36m^2A^{2m-2}\dot{A}^2\frac{R^2\dot{\mathcal {G}^2}}{\mathcal {G}^4}=0,\nonumber \\ \end{aligned}$$
(48)
$$\begin{aligned}&(2m+1)A^{2m}\ddot{A}+3m^2A^{2m-1}\dot{A}^2\nonumber \\&\quad +\,8m^2(m-1)A^{2m-3}\dot{A}^4\frac{R}{\mathcal {G}} +12m^2A^{2m-2}\dot{A}^2\ddot{A}\frac{R}{\mathcal {G}}=0,\nonumber \\ \end{aligned}$$
(49)

and the energy condition (20) takes the form

$$\begin{aligned} \nonumber&m(m+2)A^{2m-1}\dot{A}^2R+(2m+1)A^{2m}\dot{A}\dot{R}\\&\quad -\,(2m+1)A^{2m}\dot{A}\frac{R\dot{\mathcal {G}}}{\mathcal {G}} +12m^2A^{2m-2}\dot{A}^3\frac{R\dot{R}}{\mathcal {G}}\nonumber \\&\quad -\,12m^2A^{2m-2}\dot{A}^3\frac{R^2\dot{\mathcal {G}}}{\mathcal {G}^2}=0. \end{aligned}$$
(50)

By putting the corresponding values of R and \(\mathcal {G}\) and using Eq. (50), we get

$$\begin{aligned} \nonumber&12m^4(m^4-5m^3+2m+2)\dot{A}^8\nonumber \\&\quad +\,m(132m^5-52m^4-41m^3-57m^2\nonumber \\ \nonumber&\quad -53m-10)A^2\dot{A}^4\ddot{A}^3 \nonumber \\&\quad +\,(16m^4+8m^3-12m^2-10m-2)A^4\ddot{A}^4\nonumber \\ \nonumber&\quad +(80m^5+36m^4+40m^3+61m^2+24m+2)A^3\dot{A}^2\ddot{A}^3\nonumber \\&\quad +\,m(4m^4+8m^3-3m^2-7m-2)A^3\dot{A}^3\ddot{A}\dddot{A}\nonumber \\&\quad +\,m^2(92m^5-110m^4-45m^3\nonumber \\&\quad -\,44m^2+14m+12)A\dot{A}^6\ddot{A}\nonumber \\&\quad +\,m^2(10m^2+29m^3+24m^2\nonumber \\&\quad +\,14m+4)A^2\dot{A}^5\dddot{A}=0. \end{aligned}$$
(51)

4.1 Exponential-law solutions

Here we assume the metric coefficients to have exponential-law form, i.e.,

$$\begin{aligned} A=e^{\varphi t}, \end{aligned}$$
(52)

where \(\varphi \) is an arbitrary constant. The solution metric for this case is

$$\begin{aligned} \mathrm{d}s^2=\mathrm{d}t^2-e^{2\varphi t}\mathrm{d}x^2 -\,e^{2m\varphi t}(\mathrm{d}y^2+\mathrm{d}z^2). \end{aligned}$$
(53)

Using Eq. (52) in Eq. (51), we get the constraint equation

$$\begin{aligned}&(12m^8+32m^7+32m^6+40m^5+23m^4\nonumber \\&\quad +16m^3+5m^2+2m)=0. \end{aligned}$$
(54)

The real solutions for Eq. (54) are

$$\begin{aligned} m=0,~~m=-2. \end{aligned}$$
(55)

Hence we obtain two cosmological solutions by considering \(n=2\) in the \(f(R,\mathcal {G})\) model. Many other solutions can be reconstructed by choosing some other values of the parameter. It is anticipated that a \(\Lambda \mathrm{CDM}\) universe may be generated for \(m=1\) and some suitable value of n.

4.2 Power-law solutions

We assume \(A=t^\zeta ,\) to extract a power-law solution, while \(\zeta \) is any non-zero real number. In this case we obtain the constraint equation:

$$\begin{aligned}&12m^4(m^4-5m^3+2m+2){\zeta }^4\nonumber \\&\quad +\,2(m-1)(2m+1)^3({\zeta }^4-4{\zeta }^3+6{\zeta }^2-4{\zeta }+1) \nonumber \\&\quad +\,m(2m+1)(-10+m(-33\nonumber \\&\quad +\,m(9+m(-59+66m))))({\zeta }^4-2{\zeta }^3+{\zeta }^2)\nonumber \\&\quad +\,m^2(12+m(14+m(-44\nonumber \\&\quad +\,m(-45+2m(-55+46m)))))({\zeta }^4-{\zeta }^3)\nonumber \\&\quad +\,(2m+1)^2(2+m(16\nonumber \\&\quad +\,m(-11+20m)))({\zeta }^4-3{\zeta }^3+3{\zeta }^2-{\zeta })\nonumber \\&\quad +\,m^2(2+m)(2m+1)(2\nonumber \\&\quad +\,m(2+5m))({\zeta }^4-3{\zeta }^3+2{\zeta }^2)\nonumber \\&\quad +\,m(2m+1)^2(m^2+m\nonumber \\&\quad -\,2)({\zeta }^4-4{\zeta }^3+5{\zeta }^2-2{\zeta })=0. \end{aligned}$$
(56)

In order to get a particular solution, we put \({\zeta }=-\frac{1}{3}\), so that (56) gives

$$\begin{aligned} m=-2,\quad m=-1,\quad m=-\frac{2}{3}. \end{aligned}$$
(57)

It is interesting to notice that, for \(m=-2\), the metric of the solutions turns out to be

$$\begin{aligned} \mathrm{d}s^2=\mathrm{d}t^2-t^{\frac{-2}{3}}\mathrm{d}x^2-t^{\frac{4}{3}}(\mathrm{d}y^2+\mathrm{d}z^2), \end{aligned}$$
(58)

which is the same as the well-known Kasner metric [46].

5 Final remarks

Specifically we study \(f(R,\mathcal {G})\) gravity, where the function f consists of the Ricci scalar R and of the Gauss–Bonnet invariant \(\mathcal {G}\). There are many interesting aspects of the Gauss–Bonnet theory which make it interesting for the researchers. The Gauss–Bonnet term is a specific combination of curvature invariants that includes the Ricci scalar, the Ricci and the Riemann tensors. In fact Gauss–Bonnet invariant naturally arises in the process of quantum field theory regularization and renormalization of curved spacetime. In particular, including \(\mathcal {G}\) and R in a bivariate function provides a double inflationary scenario where the two acceleration phases are led by \(\mathcal {G}\) and R, respectively [11]. Moreover, the involvement of the Gauss–Bonnet invariant may play an important role in the early time expansion of the universe as it is connected with the string theory and the trace anomaly [12].

In this paper the Noether symmetry approach has been considered for an anisotropic cosmological model in modified Gauss–Bonnet gravity. The Lagrange multiplier approach allows us to deal with these difficulties related to the \(f(R,\mathcal {G})\) model and reduces the Lagrangian into a canonical form. In particular we consider an LRS BI model. Due to highly nonlinear and complicated field equations we use as physical assumption \(B=A^m\). A system of PDEs has been constructed using Noether symmetries. A detailed analysis of the determining equations is presented. A model with \(f(R,\mathcal {G})=f_0R^l+f_1\mathcal {G}^n\) is proposed and the corresponding Noether symmetries are investigated. The results in this regard agree with [27] for special cases when \(m=1\). More importantly we have also recovered the Noether symmetries for f(R) and \(f(\mathcal {G})\) theories of gravity and the results agree with [21, 45] for f(R) gravity.

The last part of the paper deals with the reconstruction of some important cosmological solutions. Exponential and power-law solutions are reported for a well-known \(f(R,\mathcal {G})\) model, i.e., \(f(R,\mathcal {G})=f_0R^n\mathcal {G}^{1-n}\) [27]. Especially, the Kasner solution is recovered and it is anticipated that the familiar de Sitter spacetime giving \(\Lambda \mathrm{CDM}\) cosmology may be reconstructed for \(m=1\) and some suitable value of n. In this paper, we have just discussed a few examples where some important Noether symmetries are reported. Many other cases can be explored giving important cosmological solutions. It is worth mentioning that our results agree with [27] for the special case when \(m=1\).