1 Introduction

The aim of this article is to fully integrate Einstein’s vacuum equation, with a cosmological constant, for the class of \((n+2)-\)dimensional spaces with the line element

$$\begin{aligned} ds^2 = (S_x + S_y)\left[ H^{ij}_x d\sigma _i d\sigma _j + \frac{dx^2}{\Delta _x^2} + \frac{dy^2}{\Delta _y^2} \right] \,, \end{aligned}$$
(1)

where the indices ij run from 1 to n. The subscripts x and y indicate that a function depends just on the coordinate x and y respectively. Thus, for instance, the components of the \(n\times n\) symmetric matrix \(H^{ij}_x\) are functions of x, \(H^{ij}_x = H^{ij}_x(x)\). In particular, none of these functions depend on the coordinates \(\sigma _i\), so that these spaces are endowed with n commuting vector fields, namely \(\partial _{\sigma _i}\). Note that the functions \(\Delta _x\) and \(\Delta _y\) can be easily gauged away by redefining the coordinates x and y. Nevertheless, instead of setting these functions to 1, we shall keep them and make a more convenient choice afterwards. As we shall see in the sequel, the general solution of Einstein’s vacuum equation can be elegantly written in terms of the exponential of a symmetric constant matrix \(\varvec{Q_0}\). In particular, the special case in which the matrix \(\varvec{Q_0}\) is diagonal leads to higher-dimensional generalizations of Kasner spacetimes [1,2,3,4, 4], which are generally used to model homogeneous but anisotropic cosmological systems [5, 6]. However, the most interesting cases are the ones in which the matrix \(\varvec{Q_0}\) cannot be diagonalized, namely when \(\varvec{Q_0}\) is complex. As far as the authors know, the latter higher-dimensional solutions have not been described in the literature yet.

The origin of the interest in the line elements of the form presented in Eq. (1) is due to a broader program of integration of Einstein’s equation for a class of \((n+2)\)-dimensional metrics found by Benenti and Fracaviglia possessing n commuting Killing vectors and a Killing tensor of rank two [10]. These spaces have inverse metric given by

$$\begin{aligned} g^{ab}\partial _{a}\partial _{b} =&\,\frac{1}{S_{x}+S_{y}}\, \Big [ \,G_{x}^{ij}\,\partial _{\sigma _i}\partial _{\sigma _j}\, +\,G_{y}^{ij}\,\partial _{\sigma _i}\partial _{\sigma _j}\\&+ \Delta _{x}^2\, \partial _{x}^{2}+\Delta _{y}^2\, \partial _{y}^{2}\, \Big ] \, , \end{aligned}$$

while the Killing tensor reads

$$\begin{aligned} \varvec{K}=&\,\frac{1}{S_{x}+S_{y}}\,\Big [ \,S_{x}\,G_{y}^{ij}\, \partial _{\sigma _i}\partial _{\sigma _j} + S_{x}\,\Delta _{y}^2 \,\partial _{y}^{2} \\&- S_{y}\,G_{x}^{ij}\,\partial _{\sigma _i}\partial _{\sigma _j} - S_{y} \,\Delta _{x}^2 \, \partial _{x}^{2} \, \Big ] \,. \end{aligned}$$

From the physical and geometrical points of view, the interesting property of these spacetimes is that their geodesics are integrable. Since the task of integrating Einstein’s vacuum equation for this whole class of spacetimes seems to be unbearable, we have tackled this problem by considering special cases, as exemplified by the previous articles [7,8,9]. In the present work we are considering the particular case in which the matrix \(G_{y}^{ij}\) vanishes. In this case the line element reduces to (1), with \(H^{ij}_x\) standing for the inverse of the matrix \(G_{x}^{ij}\). In what follows, we shall see that whenever the line element (1) obeys Einstein’s vacuum equation, either the function \(S_y\) can be set to zero or \(S_x\) can be assumed to vanish. In the first case, when \(S_y=0\), we see that \(\Delta _y \partial _y\) becomes a Killing vector field and the Killing tensor is just the square of this Killing vector, so that it does not lead to an extra conservation law along the geodesics. On the other hand, if \(S_x=0\) the Killing tensor becomes

$$\begin{aligned} \varvec{K}\,=\,- \Big [ G_{x}^{ij}\,\partial _{\sigma _i}\partial _{\sigma _j} + \Delta _{x}^2 \partial _{x}^{2} \Big ] \,, \end{aligned}$$
(2)

which is nontrivial. Thus, in both cases, either when \(S_y=0\) or when \(S_x=0\), the geodesics of the space can be integrated. In the first case, when \(S_y=0\), the space has \(n+1\) independent Killing vector fields plus the metric, which is a Killing tensor of rank two. While in the second case, when \(S_x=0\), we have the n independent Killing vector fields \(\partial _{\sigma _i}\), and two Killing tensors, namely the metric and \(\varvec{K}\).

The case \(n=2\) of the problem treated in this article has already been considered recently in Ref. [7], where it has been proved that almost all solutions that arise from integrating Einstein’s vacuum equation for the line element (1) when \(n=2\) are already known, a particular example being the Kasner metric with cosmological constant [11, 12]. Nevertheless, it turns out that one solution for the latter problem had not been described in the literature before its appearance in Ref. [7]. Differently from Kasner spacetime, in this new solution one of the Killing vectors \(\partial _{\sigma _i}\) is not orthogonal to a family of hypersurfaces, so that the line element is non-diagonal when we use the cyclic coordinates \(\sigma _i\). Thus, besides leading to a whole class of new higher-dimensional solutions of Einstein’s vacuum equation, the problem considered in the present article serves also to shed light on the origin of the new four-dimensional solution obtained in Ref. [7].

Since the establishment of General Relativity, interest in spacetimes with dimension greater than four has being increasing, specially over the last two decades. The reasons for studying these spaces are abundant. For instance, the gravity/gauge duality provides a map between field theories in d dimensions and gravitational theories in \(d+1\) dimensions, linking the weak coupling regime of one side to the strong coupling regime of the other side [13,14,15]. Such tool has been used, for example, to obtain results on strongly coupled quantum chromodynamics, which is a field theory in four dimensions, by performing calculations with a weak gravitational field in five dimensions [16]. A particularly exciting illustration are the experimentally verified results on quark-gluon plasma [17, 18]. Another important motivation for studying higher-dimensional spacetimes is string theory, which, among other things, provides a description of quantum gravity. In order to be consistent, string theory requires spacetime to have 10 dimensions [19]. Besides these two examples, there are several other theories that seek to explain our Universe through the use of spaces with dimension greater than four, for reviews see [20, 21]. With these motivations in mind, the solutions presented here shall be of particular application to cosmological models, inasmuch as some of them have spatial homogeneity.

The outline of the article is the following. In the next section we establish the basic notation used throughout the article and introduce a frame in order to compute the components of the Ricci tensor through Cartan’s structure equations. Then, in Sect. 3 we fully integrate Einstein’s vacuum equation with a cosmological constant, namely \(R_{ab}=\Lambda g_{ab}\). In Sect. 4 we show that these spaces have integrable geodesics. The solutions obtained depend on the exponential of a symmetric matrix, which is generally hard to compute explicitly. Thus, in Sect. 5 we use some theorems of matrix theory along suitable coordinate transformations in order to provide an explicit form for the solutions obtained in the preceding section. Particularly, we stress that the solutions can have different algebraic structures depending on the canonical form of the symmetric matrix. Then, in Sect. 6 we work out some examples for the solutions found in Sect. 3. Finally, in Sect. 7 we integrate Einstein’s equation for spacetimes possessing homogeneous space-like hypersurfaces in the presence of a perfect fluid matter field. Also, the conclusions and perspectives of the article are presented in Sect. 8.

2 Introducing a vielbein and computing the curvature

In what follows, we shall use the frame formalism in order to compute the curvature and integrate Einstein’s equations. In this preliminary section we shall define the vielbein and then compute the spin coefficients and use them to calculate the Ricci tensor. Before proceeding, let us establish our index conventions. Indices from the beginning of the alphabet, like a, b and c, run over the number of spacetime dimensions, from 1 to \(n+2\), whereas indices i, j and k, from the middle of the alphabet, range from 1 to n.

First let us define the functions \(F_x^{ij}\) to be such that \(H_x^{ij} = \sum _{k=1}^n F_x^{ki}F_x^{kj}\). Defining the \(n\times n\) matrices \(\varvec{H_x}\) and \(\varvec{F_x}\) to be the ones whose components are \(H_x^{ij}\) and \(F_x^{ij}\) respectively, the latter relation means that

$$\begin{aligned} \varvec{H_x} = \varvec{F_x}^t \, \varvec{F_x} \,, \end{aligned}$$

with \(\varvec{F_x}^t\) standing for the transpose of the matrix \(\varvec{F_x}\). Since \(\varvec{H_x}\) is a symmetric matrix, it turns out that such decomposition is always possible, as a consequence of Takagi’s factorization, see corollary 4.4.6 (page 207) of [22]. In particular, since the matrix \(\varvec{H_x}\) is invertible (otherwise the line element would be singular), it follows that \(\varvec{F_x}\) is also invertible. Thus, it is possible to define the matrix \(\varvec{A_x}\) as

$$\begin{aligned} \varvec{A_x} = \varvec{F_x}'\,\varvec{F_x}^{-1}\,, \end{aligned}$$
(3)

where in the above definition we have used the convention adopted henceforth that a prime over a function means a derivative with respect to its variable. Thus, \(\varvec{F_x}'\) stands for \(\frac{d}{dx}\varvec{F_x}\).

Then, defining the frame of 1-forms

$$\begin{aligned} e^i&= \sqrt{S_x+S_y} \,F_x^{ij}d\sigma _j\,, \\ e^{\hat{x}}&= e^{n+1} = \sqrt{S_x+S_y} \,\frac{dx}{\Delta _x} \,, \\ e^{\hat{y}}&= e^{n+2} = \sqrt{S_x+S_y} \,\frac{dy}{\Delta _y}\,, \end{aligned}$$

it follows that the line element is given by

$$\begin{aligned} ds^2 = \sum _{a=1}^{n+2} \, (e^a)^2\,. \end{aligned}$$

So, the vielbein \(\{e^a\}\) is orthonormal, namely if \(\{e_a\}\) is the dual frame of vector fields and \(\varvec{g}\) is the metric tensor, then \(\varvec{g}(e_a,e_b) = \delta _{ab}\). Depending on the signature of the metric, the frame might be complex in order to enable the existence of such a basis. Indeed, generally the reality conditions of a frame with specified inner products are intimately connected to the signature of the metric [23].

Now, since we shall assume the Levi-Civita connection, which is torsion-less, the first Cartan equation reads

$$\begin{aligned} de^a + \omega ^a_{\phantom {a}b}\wedge e^b = 0 \,, \end{aligned}$$
(4)

where \(\omega ^a_{\phantom {a}b}\) are 1-forms known as spin coefficients or connection 1-forms. Since our connection is compatible with the metric and the components of the metric on the frame \(\{e^a\}\) are constant, it follows that \(\omega ^a{}_b=-\omega ^b{}_a\). Equation (4) can be solved for the spin coefficients \(\omega ^a{}_b\), to be given in terms of the functions \(S_x\), \(S_y\), \(\Delta _x\), \(\Delta _y\) and \(F^{ij}_x\). After some algebra, we eventually arrive at the following solution:

$$\begin{aligned} \omega ^i{}_j&= - \frac{\Delta _x(A^{ij}_x-A^{ji}_x)}{2\sqrt{S_x+S_y}} \, e^{\hat{x}}, \\ \omega ^i{}_{\hat{x}}&= \Delta _x\Big [\frac{(A^{ij}_x+A^{ji}_x)}{2\sqrt{S_x+S_y}}+\frac{S'_x\delta ^i_j}{2(S_x+S_y)^{3/2}}\Big ] \,e^j, \\ \omega ^i{}_{\hat{y}}&=\frac{\Delta _y S'_y}{2(S_x+S_y)^{3/2}} \, e^i, \\ \omega ^{\hat{x}}{}_{\hat{y}}&=\frac{(\Delta _y S'_y \,e^{\hat{x}}-\Delta _x S'_x \,e^{\hat{y}} )}{2(S_x+S_y)^{3/2}}\,, \end{aligned}$$

where \(A_x^{ij}\) stands for the components of the matrix \(\varvec{A_x}\) defined in Eq. (3).

With these spin coefficients at hand, one can straightforwardly compute the components of the curvature tensor by means of the second Cartan equation, which is given by

$$\begin{aligned} \frac{1}{2}\,R^a_{\phantom {a}bcd}\,e^c\wedge e^d = d\omega ^a{}_b+\omega ^a{}_c\wedge \omega ^c{}_b\,, \end{aligned}$$

where \(R^a_{\phantom {a}bcd}\) stands for the components of the Riemann tensor in the frame. Performing these calculations and then computing the components of the Ricci tensor \(R_{ab} = R^c_{\phantom {c}acb}\), we eventually arrive at the following expressions

$$\begin{aligned} R_{ij}=&\frac{-\Delta _x^2}{2(S_x+S_y)} \left[ \left( tr(\varvec{A_x}) + \frac{n S_x'}{2(S_x+S_y)}\right. \right. \nonumber \\&\left. + \frac{\Delta _x'}{\Delta _x}\right) ( \varvec{A_x} +\varvec{A_x}^t)-\varvec{A_x}\varvec{A_x}^t+\varvec{A_x}^t \varvec{A_x} \nonumber \\&\left. + \varvec{A_x}' +\varvec{A_x}'^{\,t} \,\right] _{ij} \nonumber \\&- \frac{\delta _{ij}}{2(S_x+S_y)^2}\left[ \Delta _x^2 \left( tr(\varvec{A_x}) \, S_x' + S_x'' \right. \right. \nonumber \\&\left. + \frac{(n-2) (S'_x)^2}{2(S_x+S_y)} + \frac{S_x'\Delta '_x }{\Delta _x } \right) \nonumber \\&\left. + \Delta _y^2 \left( S_y'' + \frac{(n-2) (S'_y)^2}{2(S_x+S_y)} + \frac{S_y'\Delta '_y }{\Delta _y } \right) \right] \,, \nonumber \\ R_{\hat{x}\hat{x}}=&\frac{-\Delta _x^2}{2(S_x+S_y)} \left[ \, tr(\varvec{A_x} \varvec{A_x}^t) + tr(\varvec{A_x}^2) \right. \nonumber \\&\left. + \left( \frac{S'_x}{S_x+S_y} + \frac{2\Delta '_x}{\Delta _x} \right) tr(\varvec{A_x})+ 2tr(\varvec{A_x}') \, \right] \nonumber \\&- \frac{(n+1)\Delta _x^2}{2(S_x+S_y)^2}\left[ S''_x - \frac{(S'_x)^2}{S_x+S_y} + \frac{S'_x\Delta '_x}{\Delta _x} \right] \nonumber \\&- \frac{\Delta _y^2}{2(S_x+S_y)^2} \left[ S''_y + \frac{(n-2)(S'_y)^2}{2(S_x+S_y)} + \frac{S'_y\Delta '_y}{\Delta _y} \right] \,,\nonumber \\ R_{\hat{y}\hat{y}}=&\frac{-\Delta _x^2}{2(S_x+S_y)^2} \left[ tr(\varvec{A_x})\,S'_x + S''_x \right. \nonumber \\&\left. + \frac{(n-2)(S'_x)^2}{2(S_x+S_y)} + \frac{S'_x\Delta '_x}{\Delta _x}\, \right] \nonumber \\&+ \frac{(n+1)\Delta _y^2}{2(S_x+S_y)^2} \left[ \,\frac{(S'_y)^2}{S_x+S_y} - S''_y - \frac{S'_y\Delta '_y}{\Delta _y}\, \right] \,, \nonumber \\ R_{\hat{x}\hat{y}}&=\frac{3n \Delta _x \Delta _y S'_xS'_y}{4(S_x+S_y)^3}\,, \qquad R_{i\hat{x}}=0\,, \qquad R_{i\hat{y}}=0. \end{aligned}$$
(5)

In these expressions, \(tr(\varvec{A_x})\) denotes the trace of the matrix \(\varvec{A_x}\), whereas \(R_{ij}\) denotes the projection of the components of the Ricci along the vielbein frame. At this point, it is worth mentioning that, since our frame is orthonormal, the frame indices can be risen or lowered without changing the value of the component. Thus, \(R^{a}_{\phantom {a}b} = R_{ab} = R^{b}_{\phantom {b}a}\), where the symmetry of the Ricci tensor has been used in the last equality.

3 Integration of Einstein’s vacuum equation

In this section we will fully integrate Einstein’s field equation in vacuum with a cosmological constant \(\Lambda \). Namely, we shall attain the most general solution for the equation

$$\begin{aligned} R_{ab}=\Lambda \, \delta _{ab}\,. \end{aligned}$$

In particular, the component \(\hat{x}\hat{y}\) of the latter equation implies \(R_{\hat{x}\hat{y}}=0\). Thus, looking at Eq. (5), we conclude that the combination \(\Delta _x \Delta _y S'_xS'_y\) should be identically zero. Since \(\Delta _x\) and \(\Delta _y\) cannot be zero (otherwise the line element (1) would be meaningless), it follows that \(S_x'S_y'\) must vanish. Therefore, we have two possibilities: (A) \(S_y\) is constant; (B) \(S_x\) is constant and \(S_y\) non-constant. In particular, note that case (A) encompasses the possibility of both functions \(S_x\) and \(S_y\) being constant as well as the case in which just \(S_y\) is constant, with \(S'_x\) not identically zero. In what follows, we shall tackle the cases (A) and (B) separately.

3.1 The case \(S'_y=0\)

In this subsection we will integrate Einstein’s equation for the case (A), namely when \(S_y\) is constant. Since \(S_y\) shows up in the metric only through the combination \(S_x+S_y\), we can absorb the constant value of \(S_y\) into \(S_x\) and assume that \(S_y\) vanishes. We shall also redefine the coordinate y in such a way to eliminate the dependence on the function \(\Delta _y\) of this line element. More precisely, we will replace the coordinate y by \(\tilde{y} = \int dy/\Delta _y\). Dropping the tilde after the transformation, this amounts to assuming \(\Delta _y=1\) in the line element (1). Therefore, in this subsection we shall set

$$\begin{aligned} S_y = 0 \;\;\text { and }\;\; \Delta _y = 1 \,, \end{aligned}$$
(6)

which represent no loss of generality. Inserting these choices into (5), it follows that the non-vanishing components of the Ricci tensor are

$$\begin{aligned} R_{ij}=&\frac{-\Delta _x^2}{2S_x} \left[ \left( tr(\varvec{A_x}) + \frac{n S_x'}{2S_x} + \frac{\Delta _x'}{\Delta _x}\right) (\varvec{A_x}+\varvec{A_x}^t)\right. \nonumber \\&\left. - \varvec{A_xA_x}^t+\varvec{A_x}^t \varvec{A_x} + \varvec{A_x}' +\varvec{A_x}'^{\,t} \,\right] _{ij}+\delta _{ij}R_{\hat{y}\hat{y}}\,,\nonumber \\ R_{\hat{x}\hat{x}}=&\frac{-\Delta _x^2}{2S_x} \left[ \, tr(\varvec{A_x}^2+\varvec{A_xA_x}^t) + \left( \frac{S'_x}{S_x} \right. \right. \nonumber \\&\left. + \frac{2\Delta '_x}{\Delta _x} \right) tr(\varvec{A_x})+ 2tr(\varvec{A_x}')\nonumber \\&\left. + \frac{(n+1)}{S_x}\left( S''_x - \frac{(S'_x)^2}{S_x} + \frac{S'_x\Delta '_x}{\Delta _x} \right) \right] \,, \nonumber \\ R_{\hat{y}\hat{y}}&=\frac{-\Delta _x^2}{2S_x^2} \left[ tr(\varvec{A_x})\,S'_x + S''_x + \frac{(n-2)(S'_x)^2}{2S_x} + \frac{S'_x\Delta '_x}{\Delta _x} \right] \,. \end{aligned}$$
(7)

Now, let us impose Einstein’s equation \(R_{ab}=\Lambda \delta _{ab}\). Due to the assumption (6), which guarantees \(R_{\hat{x}\hat{y}}=0\), and since \(R_{i\hat{x}}\) and \(R_{i\hat{y}}\) are already zero for the class of spaces considered here, the only parts of Einstein’s equation that need to be solved are \(R_{ij}=\Lambda \delta _{ij}\), \(R_{\hat{x}\hat{x}}=\Lambda \), and \(R_{\hat{y}\hat{y}}=\Lambda \). Hence, the left hand side of the last equation in (7) can be equated to \(\Lambda \delta _{ij}\), which cancels the term \(R_{\hat{y}\hat{y}}\delta _{ij}\) on the right hand side of this equation, thus yielding

$$\begin{aligned}&\left[ tr(\varvec{A_x}) + \frac{n S_x'}{2S_x} + \frac{\Delta _x'}{\Delta _x}\right] (\varvec{A_x}+\varvec{A_x}^t) \nonumber \\&\quad -\varvec{A_xA_x}^t+\varvec{A_x}^t\varvec{A_x} + \varvec{A_x}'+\varvec{A_x}'^{\,t}=0\,. \end{aligned}$$
(8)

Therefore, the problem of solving Einstein’s equation for the case \(S'_y=0\) reduces to setting \(R_{\hat{x}\hat{x}}=\Lambda \) and \(R_{\hat{y}\hat{y}}=\Lambda \) in Eq. (7), along with solving the matrix equation (8).

A further simplification can be accomplished by noting that the function \(\Delta _x\) can be chosen as desired by means of redefining the coordinate x. Therefore, without loss of generality, let us choose \(\Delta _x\) to be the function that makes the expression enclosed by the square brackets in Eq. (8) identically zero, namely let us assume

$$\begin{aligned} tr(\varvec{A_x}) + \frac{n S_x'}{2S_x} + \frac{\Delta _x'}{\Delta _x}=0\,. \end{aligned}$$
(9)

With this gauge choice, Eq. (8) boils down to

$$\begin{aligned} \varvec{A_x}' +\varvec{A_x}'^{\,t}-\varvec{A_xA_x}^t+\varvec{A_x}^t \varvec{A_x} =0\,. \end{aligned}$$
(10)

Then, by taking the trace of this equation, we find out that, in these coordinates, the trace of the matrix \(\varvec{A_x}\) is constant. We shall denote this constant by \(a_1\)

$$\begin{aligned} tr(\varvec{A_x}) = a_1\,. \end{aligned}$$
(11)

With this in mind, we are now able to solve Eq. (9), the general solution being given by

$$\begin{aligned} \Delta _x=c_1 e^{-a_1 x}(S_x)^{-n/2}\,, \end{aligned}$$
(12)

where \(c_1\) is an integration constant. Likewise, multiplying Eq. (10) on the left by \(\varvec{A_x}\) and taking the trace of the resulting equation, we find that \(tr(\varvec{A_x}^2+\varvec{A_x A_x}^t)\) is a constant, conveniently denoted here by \(2a_2/(n+1)\). Thus, we have

$$\begin{aligned} tr(\varvec{A_x}^2+\varvec{A_x A_x}^t)=\frac{2}{n+1}\,a_2\,. \end{aligned}$$
(13)

This piece of information is particularly useful since the latter combination appears in the expression for \(R_{\hat{x}\hat{x}}\) in Eq. (7). Using Eqs. (13) and (7), it follows from the integration of \(R_{\hat{x}\hat{x}}-R_{\hat{y}\hat{y}}=0\) that

$$\begin{aligned} S_x = s_1\!\left[ e^{a_1x}\cosh \!\left( \! \sqrt{\frac{a_2-a_1^2}{n}}(x-x_0)\!\right) \right] ^{\frac{-2}{n+1}}\!\!\!\!, \end{aligned}$$
(14)

where \(s_1\) and \(x_0\) are new integration constants. Then, inserting Eqs. (12) and (14) into the equation \(R_{\hat{y}\hat{y}}=\Lambda \), we find that the constant \(a_2\) must be related to \(s_1\), \(\Lambda \), \(c_1\) and \(a_1\) through the following relation:

$$\begin{aligned} a_2= \frac{1}{c_1^2}\left[ c_1^2a_1^2+n(n+1)s_1^{n+1}\Lambda \right] \,. \end{aligned}$$
(15)

Now, it only remains to solve the matrix equation (10). In order to accomplish this task, let us first define the matrices \(\varvec{Q_x}=\frac{1}{2}(\varvec{A_x}+\varvec{A_x}^t)\) and \(\varvec{P_x}=\frac{1}{2}(\varvec{A_x}-\varvec{A_x}^t)\), which represent independent degrees of freedom of the matrix \(\varvec{A_x}\), namely its symmetric and anti-symmetric parts respectively. By means of such definitions, equation (10) can be written as

$$\begin{aligned} \varvec{Q_x}'=[\varvec{P_x},\varvec{Q_x}]\,, \end{aligned}$$
(16)

where the symbol \([\,\,,\,]\) stands for the ordinary matrix commutator. This equation is a Lax pair equation, which is generally connected to integrable systems and leads to an infinity amount of conserved charges [24,25,26]. In particular, since the trace of a commutator is zero, it follows from Eq. (16) that \(tr(\varvec{Q_x})\) is a constant. More generally, the trace of an arbitrary power of \(\varvec{Q_x}\) must be constant, which stems from the relation

$$\begin{aligned} \frac{d}{dx}(\varvec{Q_x}^p)=[\varvec{P_x},\varvec{Q_x}^p]\,. \end{aligned}$$

In order to continue the integration process, notice that rather than finding \(\varvec{A_x}\) and \(\varvec{F_x}\), we are mainly interested in obtaining \(\varvec{H_x}= \varvec{F_x}^t \varvec{F_x}\), which is the matrix appearing on the line element (1). Bearing this in mind, let us find a differential equation for \(\varvec{H_x}\). From the very definition of \(\varvec{A_x}\), see Eq. (3), it follows that

$$\begin{aligned} \frac{d}{dx} \varvec{F_x} = \varvec{A_x F_x} =(\varvec{Q_x}+\varvec{P_x}) \varvec{F_x} \,. \end{aligned}$$

Taking the transpose of the latter relation, it follows that

$$\begin{aligned} \frac{d}{dx} \varvec{F_x}^t = \varvec{F_x}^t(\varvec{Q_x}-\varvec{P_x}) \,. \end{aligned}$$

Thus, differentiating \(\varvec{H_x}=\varvec{F_x}^t \varvec{F_x}\) and using these relations along with (16), we eventually arrive at

$$\begin{aligned} \frac{d^p}{dx^p} \varvec{H_x} = 2^p \varvec{F_x}^t \varvec{Q_x}^p \varvec{F_x} \,. \end{aligned}$$

Therefore, all the derivatives of \(\varvec{H_x}\) at one point are determined by the values of \(\varvec{F_x}\) and \(\varvec{Q_x}\) at this single point. In particular, denoting the values of \(\varvec{F_x}\) and \(\varvec{Q_x}\) at \(x=0\) by \(\varvec{F_0}\) and \(\varvec{Q_0}\) respectively, it follows that

$$\begin{aligned} \left. \frac{d^p}{dx^p} \varvec{H_x}\,\right| _{x=0} = 2^p \varvec{F_0}^t \varvec{Q_0}^p \varvec{F_0} \,, \end{aligned}$$

so that the Taylor series of \(\varvec{H_x}\) reads

$$\begin{aligned} \varvec{H_x}(x) = \varvec{F_0}^t\,\sum _{p=0}^{\infty } \frac{(2x)^p}{p!}\,\varvec{Q_0}^p \, \varvec{F_0} = \varvec{F_0}^t\,e^{2x\varvec{Q_0}}\,\varvec{F_0} \,. \end{aligned}$$
(17)

From this, we have that the line element (1), for the case \(S'_y=0\), can be written as

$$\begin{aligned} ds^2 = S_x\left[ \varvec{d\sigma }^t \,\varvec{F_0}^t\,e^{2x \varvec{Q_0}}\,\varvec{F_0} \,\varvec{d\sigma } + \frac{dx^2}{\Delta _x^2} + dy^2 \right] \,, \end{aligned}$$

where \(\varvec{d\sigma }\) is the \(n\times 1\) matrix whose components are the \(d\sigma _i\). Actually, since \(\varvec{F_x}\) is invertible, it follows that the dependence on \(\varvec{F_0}\) can be gauged away by defining the cyclic coordinates \(\tilde{\sigma }_i\) as

$$\begin{aligned} \tilde{\sigma }_i = F_0^{ij}\,\sigma _j\,. \end{aligned}$$
(18)

In terms of these, the final line element is given by

$$\begin{aligned} ds^2 = S_x\left[ \varvec{d\tilde{\sigma }}^t \,e^{2x \varvec{Q_0}}\,\varvec{d\tilde{\sigma }} + \frac{dx^2}{\Delta _x^2} + dy^2 \right] \,. \end{aligned}$$
(19)

In this final solution, the functions \(\Delta _x\) and \(S_x\) are given respectively by (12) and (14), whereas \(\varvec{Q_0}\) is an arbitrary constant symmetric matrix. Since the integration constants \(a_1\) and \(a_2\) appearing in the expressions for \(\Delta _x\) and \(S_x\) are related to the traces of \(\varvec{A_x}\) and \((\varvec{A_x}^2 + \varvec{A_x} \varvec{A_x}^t)\), see Eqs. (11) and (13), it follows that they must be determined by the traces of \(\varvec{Q_0}\) and its powers. Indeed, one can check that they must be given by

$$\begin{aligned} a_1 = tr(\varvec{Q_0}) \quad \text {and} \quad a_2 = (n+1)\,tr(\varvec{Q_0}^2) \,. \end{aligned}$$
(20)

This is the most general solution for Einstein’s equation in the case \(S'_y=0\).

In particular, from the expression for \(S_x\), (14), we see that the case in which \(S_x\) and \(S_y\) are both constant can be attained by setting \(a_1\) and \(a_2\) to zero. Nevertheless, going through the whole integration process assuming \(S_x' = 0\) from the very beginning, one can check that this last requirement is, actually, not necessary. Rather, the constants \(a_1\) and \(a_2\) are just constrained by the relation \(a_2 = (n+1)a_1^2\). Thus, the case \(a_2 = a_1 = 0\) is just a particular solution. So, the most general solution for this case is provided by the metric (19) with \(S_x=s_1\), \(\Delta _x\) given by (12), and \(\varvec{Q_0}\) satisfying \(tr(\varvec{Q_0})^2=tr(\varvec{Q_0}^2)\). Moreover, one can easily see from the condition \(R_{\hat{y}\hat{y}}=\Lambda \) that if \(S_x\) and \(S_y\) are both constant one must have \(\Lambda =0\) in order to attain a solution, see (7).

3.2 Subcase \(S'_x=0\) and \(S'_y\ne 0\)

Now, let us consider the subcase in which \(S_x\) is constant while \(S_y\) is a nonconstant function of y. Here we follow steps analogous to the ones taken in the previous subsection. For instance, absorbing the constant value of \(S_x\) into \(S_y\), we can assume, without any loss of generality, that

$$\begin{aligned} S_x=0 \,. \end{aligned}$$

With this choice, the nonzero components of the Ricci tensor are

$$\begin{aligned} R_{ij}=&\,\frac{-\Delta _x^2}{2S_y} \left[ \left( tr(\varvec{A_x})+ \frac{\Delta _x'}{\Delta _x}\right) (\varvec{A_x}+\varvec{A_x}^t)\right. \\&\left. -[\varvec{A_x},\varvec{A_x}^t]+ \varvec{A_x}' +\varvec{A_x}'^t \,\right] _{ij}\\&-\frac{\Delta _y^2\delta _{ij}}{2S_y^2}\left[ S_y'' + \frac{(n-2) (S'_y)^2}{2S_y} + \frac{S_y'\Delta '_y }{\Delta _y } \right] \,,\\ R_{\hat{x}\hat{x}}=&\,\frac{-\Delta _x^2}{2S_y} \left[ \, tr(\varvec{A_x}^2+\varvec{A_x}\varvec{A_x}^t) \right. \\&\left. +\left( \frac{2\Delta '_x}{\Delta _x} \right) tr(\varvec{A_x})+ 2tr(\varvec{A_x}') \, \right] \\&- \frac{\Delta _y^2}{2S_y^2} \left[ S''_y + \frac{(n-2)(S'_y)^2}{2S_y} + \frac{S'_y\Delta '_y}{\Delta _y} \right] \,, \\ R_{\hat{y}\hat{y}}=&\,\frac{-(n+1)\Delta _y^2}{2S_y^2} \left[ \,S''_y-\frac{(S'_y)^2}{S_y} + \frac{S'_y\Delta '_y}{\Delta _y}\, \right] \,. \end{aligned}$$

Now, recall that the functions \(\Delta _x\) and \(\Delta _y\) can be chosen arbitrarily, which is equivalent to performing coordinate transformations in x and y respectively. Thus, let us conveniently choose them to be such that the following equations hold

$$\begin{aligned}&\frac{\Delta _x'}{\Delta _x}+tr(\varvec{A_x})=0\,, \end{aligned}$$
(21)
$$\begin{aligned}&\frac{\Delta _y^2}{2S_y^2}\left[ S_y'' + \frac{(n-2) (S'_y)^2}{2S_y} + \frac{S_y'\Delta '_y }{\Delta _y } \right] =-\Lambda \,. \end{aligned}$$
(22)

With these choices, it follows that the part \(R_{ij}=\Lambda \delta _{ij}\) of Einstein’s equation reduces to

$$\begin{aligned} \frac{d}{dx}(\varvec{A_x} + \varvec{A_x}^{t}) = [ \varvec{A_x}, \varvec{A_x}^t] \,, \end{aligned}$$

which is the same matrix equation that we have addressed in the previous subsection, with the general solution for \(\varvec{H_x}\) being given by (17). In particular, the traces of \(\varvec{A_x}\) and \((\varvec{A_x}^2+\varvec{A_x}\varvec{A_x}^t)\) are constant. Thus, let us define the constants \(a_1\) and \(a_2\) as follows

$$\begin{aligned} tr(\varvec{A_x}) = a_1 \;\; \text {and} \;\; tr(\varvec{A_x}^2+\varvec{A_x A_x}^t)=\frac{2}{n+1}a_2 \,. \end{aligned}$$
(23)

Taking this into account, it follows that the general solutions for (21) and (22) are

$$\begin{aligned} \left\{ \begin{array}{ll} \Delta _x(x)=c_1 e^{-a_1x}\,, \\ \quad \\ \Delta _y=-\frac{S_y }{S_y'} \sqrt{\frac{d_1}{(S_y)^n}-\frac{4\Lambda S_y}{n+1}} \,, \end{array} \right. \end{aligned}$$
(24)

where \(c_1\) and \(d_1\) are arbitrary integration constants.

Now, the equations \(R_{\hat{x}\hat{x}}=\Lambda \) and \(R_{\hat{y}\hat{y}}=\Lambda \) imply the following constraints on the integration constants:

$$\begin{aligned} a_2=(n+1)a_1^2 \quad \text {and} \quad d_1=0 \,. \end{aligned}$$
(25)

Then, performing the coordinate transformation (18) on the cyclic coordinates, it follows that the general solution of Einstein’s equation for the case considered in the present subsection is given by

$$\begin{aligned} ds^2&= S_y \Big [ \varvec{d\tilde{\sigma }}^t \,e^{2x \varvec{Q_0}}\,\varvec{d\tilde{\sigma }} + e^{2a_1 x} dx^2 - \frac{(n+1)(S_y')^2}{4 \Lambda (S_y)^3} dy^2 \Big ] \,, \end{aligned}$$
(26)

where we have set \(c_1 = 1\), a choice that can be accomplished by means of a translation on the coordinate x along with a coordinate transformation in the cyclic coordinates. Note that no restriction has been placed over the function \(S_y\), conveying the fact that we still have a coordinate freedom to choose \(S_y\) to be any non-constant function of y, each choice corresponding to a different coordinate system but representing the same physical spacetime. In the latter line element, the matrix \(\varvec{Q_0}\) is an arbitrary \(n\times n\) symmetric matrix such that

$$\begin{aligned} tr(\varvec{Q_0})=a_1 \quad \text {and} \quad tr(\varvec{Q_0}^2)=a_1^2\,, \end{aligned}$$
(27)

where the last constraint stems from Eqs. (23) and (25). This is the general solution for Einstein’s vacuum equation when \(S_x'=0\), with \(S_y'\) non-vanishing.

4 Integrability of geodesics

As mentioned in the introduction, in the class of spacetimes considered here the geodesic equation is fully integrable, due to the existence of enough symmetries. The aim of the present section is to show explicitly how one can separate the geodesic equation of the solutions that we have found. In order to do so, it is worth recalling that if \(V^a\) is a geodesic vector field with affine parametrization, \(V^a\nabla _aV^b=0\), and \(Q^a\) is a Killing vector field, it follows that \(V^a Q_a\) is constant along the geodesic flow. Likewise, if \(K_{ab}\) is a rank two Killing tensor, i. e., \(\nabla _{(a}K_{bc)}=0\), then \(V^aV^b K_{ab}\) must also be constant along the geodesic curves. In particular, since the metric \(g_{ab}\) is covariantly constant it is also a Killing tensor, so that \(V^aV^b g_{ab}\) is constant along the flow.

For the case (A), in which \(S_y=0\) and \(\Delta _y=1\), the line element reads

$$\begin{aligned} ds^2 = S_x \left[ H^{ij}_x d\sigma _i d\sigma _j + dy^2 + \frac{dx^2}{\Delta _x^2} \right] \,, \end{aligned}$$

so that besides the Killing vector fields \(\partial _{\sigma _i}\), it follows that \(\partial _y\) is also a Killing vector. Thus, if \((\sigma _i(s), y(s), x(s))\) is a geodesic curve, with s being an affine parameter, it turns out that the following conservation laws hold:

$$\begin{aligned} \left\{ \begin{array}{ll} S_x\,H^{ij}_x\,\frac{d\sigma _j}{ds} = \alpha _i\,,\;\; S_x\frac{dy}{ds} = \beta \,,\;\; \\ \quad \\ \frac{d\sigma _i}{ds}\alpha _i + \beta \,\frac{dy}{ds} + \frac{S_x}{\Delta _x^2}\left( \frac{dx}{ds}\right) ^2 = \epsilon \,, \end{array} \right. \end{aligned}$$
(28)

where \(\alpha _i\), \(\beta \), and \(\epsilon \) are constants to be determined by the initial condition of the trajectory. Resolving the first two of these equations for \(d\sigma _i/ds\) and dy / ds and inserting the results into the last conservation law, we are lead to

$$\begin{aligned} \frac{dx}{ds} =\frac{\Delta _x}{S_x} \sqrt{ \epsilon \,S_x - \alpha _i\alpha _j G_x^{ij} - \beta ^2 \,} \,, \end{aligned}$$
(29)

where \(G_x^{ij}\) stands for the inverse of the matrix \(H_x^{ij}\), namely since \(\varvec{H_x} = e^{2x\varvec{Q_0}}\), we have \(\varvec{G_x} = e^{-2x\varvec{Q_0}}\). Inasmuch as we have already found \(S_x\) and \(\Delta _x\) in the previous section, one can insert their expressions in (29) and find x(s). With this at hand, one can replace \(S_x\) and \(H_x^{ij}\) as functions of s in the first two relations of (28) and finally find \(\sigma _i(s)\) and y(s), proving that the geodesic equation is separable and, therefore, integrable.

Concerning the case (B), when \(S_x=0\), one does not gain an extra Killing vector. Nonetheless, instead, another Killing tensor besides the metric shows up, as commented in the introduction, see Eq. (2). Hence, in this case the conservation laws read:

$$\begin{aligned} \left\{ \begin{array}{ll} S_y\,H^{ij}_x\,\frac{d\sigma _j}{ds} = \alpha _i\,,\;\; \frac{\beta }{S_y} + \frac{S_y}{\Delta _y^2} \left( \frac{dy}{ds}\right) ^2 = \epsilon \,,\;\; \\ \quad \\ S_y^2\left[ H_x^{ij}\frac{d\sigma _i}{ds}\frac{d\sigma _j}{ds} + \frac{1}{\Delta _x^2} \left( \frac{dx}{ds}\right) ^2 \right] =\beta \,. \end{array} \right. \end{aligned}$$
(30)

Integrating the second of these equations one can find y(s), which plugging into the third equation along with using the first conservation law yields x(s). With these at hand, one can integrate the first equation in (30) and finally attain \(\sigma ^i(s)\). This shows that in case (B) the geodesic equation is also separable.

5 Putting the solution in a treatable form

Although the solutions (19) and (26) have been expressed in an elegant and compact form, the exponential \(e^{2x\varvec{Q_0}}\) will mostly result in an extremely cumbersome matrix, specially for solutions in dimension higher than four, namely when the values of n are greater than two. Actually, no general expression exists for the exponential of an \(n\times n\) matrix when \(n>2\). In spite of this, the intent of the present section is to show that, by means of a suitable choice of cyclic coordinates, the term \(\varvec{d\tilde{\sigma }}^t e^{2x\varvec{Q_0}} \varvec{d\tilde{\sigma }}\) can always be explicitly written as a finite sum of terms.

Recall that the matrix \(\varvec{Q_0}\) appearing on the exponential must be symmetric. Therefore, due to the spectral theorem, it follows that if \(\varvec{Q_0}\) is real then it can be put in a diagonal form by means of an orthogonal transformation on the basis. Once put in the diagonal form, it is trivial to compute its exponential. However, the case in which \(\varvec{Q_0}\) is complex is trickier. Fortunately, there exists a complementary theorem for complex symmetric matrices. It states that if the complex symmetric matrix \(\varvec{Q_0}\) can be diagonalized this will be accomplished by a complex orthogonal transformation (see for instance theorem 4.4.13 (page 211) of [22]). Moreover, in the case in which \(\varvec{Q_0}\) cannot be diagonalized, there always exist an orthogonal complex matrix \(\varvec{M}\) such that \(\varvec{M}^{-1} \varvec{Q_0 M}\) is the sum of a nilpotent matrix plus a diagonal matrix that commutes with it, so that the exponential can also be easily computed [27, 28]. By “orthogonal complex matrix” we mean an \(n\times n\) matrix \(\varvec{M}\) with complex entries obeying the relation \(\varvec{M}^t \varvec{M}=\varvec{I_n}\), where \(\varvec{I_n}\) stands for the \(n\times n\) identity matrix. In what follows we shall consider the cases in which \(\varvec{Q_0}\) is diagonalizable or not separately.

In the context of gauge/gravity duality, another class of line-elements determined by the exponential of a matrix have been found in Ref. [29], in which case the matrix being exponentiated is the stress-energy tensor of a field theory in the boundary of the spacetime.

5.1 Diagonalizable case

In this subsection we consider the symmetric matrix \(\varvec{Q_0}\) to be diagonalizable. Thus, according to the theorem described above, there exits an orthogonal matrix \(\varvec{M}\) such that

$$\begin{aligned} \varvec{M}^{-1} \varvec{Q_0 M} = \text {diag}(q_1,q_2,\cdots ,q_n)\,, \end{aligned}$$

where \(q_i\) are the eigenvalues of \(\varvec{Q_0}\) [22]. Following this reasoning, let us perform the change of coordinates \(\tilde{\sigma }_i \rightarrow \tau _i\) defined by

$$\begin{aligned} \varvec{\tilde{\sigma }} = \varvec{M} \cdot \varvec{\tau }\,, \end{aligned}$$
(31)

where \(\varvec{\tau }\) is an \(n\times 1\) matrix with entries \(\tau _i\). Additionally, let us use the identity \(\varvec{M}^{-1} e^{\varvec{Q}}\varvec{M}=e^{ \varvec{M}^{-1}\varvec{Q M}}\), which always holds. Then, since \(\varvec{M}\) is orthogonal, it follows that \(\varvec{M}^{-1}=\varvec{M}^t\), so that we can write

$$\begin{aligned} \varvec{d\tilde{\sigma }}^t e^{2x\varvec{Q_0}} \varvec{d\tilde{\sigma }}&= \varvec{d\tau }^t \varvec{M}^{t} e^{2x\varvec{Q_0}} \varvec{M} \varvec{d\tau } \\&= \varvec{d\tau }^t e^{2x \varvec{M}^t \varvec{Q_0} \varvec{M}} \varvec{d\tau } =\sum _{i=1}^{n} e^{2x q_i} (d\tau _{i})^2 \,. \end{aligned}$$

Therefore, in the case in which \(\varvec{Q_0}\) is diagonalizable, the line elements (19) and (26) also become diagonal,

$$\begin{aligned} ds^2 = (S_x + S_y)\left[ \sum _{i=1}^{n} e^{2x q_i} d\tau _{i}^2 + \frac{dx^2}{\Delta _x^2} + \frac{dy^2}{\Delta _y^2} \right] \,, \end{aligned}$$
(32)

where the functions \(S_x\), \(S_y\), \(\Delta _x\) and \(\Delta _y\) should be the ones found in the previous section while integrating Einstein’s vacuum equation.

5.2 Nondiagonalizable case

In this subsection we shall consider the case in which \(\varvec{Q_0}\) is not diagonalizable. We begin by stating the result that for any complex symmetric matrix \(\varvec{Q_0}\) there exists a complex orthogonal matrix \(\varvec{M}\) such that \(\varvec{M}^{-1}\varvec{Q_0 M}\) is block-diagonal, with each block possessing a canonical form [27, 28]. More explicitly, we have

$$\begin{aligned} \varvec{M}^{-1}\varvec{Q_0} \varvec{M}=\varvec{Q_1}\oplus \varvec{Q_2}\oplus \cdots \oplus \varvec{Q_\ell } \,, \end{aligned}$$

where \(\varvec{Q_\nu }\) is an \(m_{\nu }\times m_\nu \) matrix given by

$$\begin{aligned} \varvec{Q_\nu } = q_\nu \, \varvec{I_{m_\nu }} + \varvec{P_{m_\nu ,0}} \,. \end{aligned}$$

In the latter expression \(\varvec{I_{m_\nu }}\) stands for the \(m_{\nu }\times m_\nu \) identity matrix, \(q_\nu \) is an eigenvalue of \(\varvec{Q_0}\), whereas \(\varvec{P_{m_\nu ,0}}\) is a nilpotent matrix described in the sequel. The index \(\nu \) range from 1 to \(\ell \), with \(\ell \) being the number of blocks in the canonical form of \(\varvec{Q_0}\).

In order to define \(\varvec{P_{m,0}}\) it is useful to define the set of \(m\times m\) matrices \(\varvec{P_{m,k}}\), with k being an integer, as the matrices whose components are given by

$$\begin{aligned} P_{m,p}^{ij}&=\frac{1}{2}\Big [(\delta _{i,j+p+1}+\delta _{i,j-p-1})\Big .\nonumber \\&\quad \Big .+i(\delta _{i,m-p-j}-\delta _{i,m+p-j+2})\Big ]\, , \end{aligned}$$
(33)

where the indices i and j range from 1 to m. As can easily be checked, these matrices have the following properties:

$$\begin{aligned} \left\{ \begin{array}{ll} (\varvec{P_{m,0}})^{p+1}=\varvec{P_{m,p}}\,, \\ \quad \\ \varvec{P_{m,p}}=0 \; \text {if} \; p\ge m-1 \,. \end{array} \right. \end{aligned}$$
(34)

In particular, note that the matrix \(\varvec{P_{m,0}}\) is nilpotent, with index m. Moreover, note that \(\varvec{P_{1,0}}=0\), so that if the block \(\varvec{Q_\nu } = q_\nu \varvec{I_{m_\nu }} + \varvec{P_{m_\nu ,0}}\) is a \(1\times 1\) matrix it becomes just the eigenvalue \(q_\nu \).

With these tools at hand, we are now ready to compute the exponential \(e^{2x \varvec{Q_0}}\). First, since \(\varvec{M}\) is an orthogonal matrix we have that \(\varvec{M}^{-1} = \varvec{M}^t\). Therefore, by defining the coordinates \(\tau _i\) just as we did in Eq. (31), it follows that

$$\begin{aligned} \varvec{d\tilde{\sigma }}^t e^{2x\varvec{Q_0}} \varvec{d\tilde{\sigma }}&= \varvec{d\tau }^t \varvec{M}^t\,e^{2x \varvec{Q_0}}\, \varvec{M}\varvec{d\tau }\\&= \varvec{d\tau }^t \varvec{M}^{-1}\,e^{2x \varvec{Q_0}}\, \varvec{M}\varvec{d\tau }\\&= \varvec{d\tau }^t \,e^{2x \varvec{M}^{-1}\varvec{Q_0}\varvec{M}}\, \varvec{d\tau }\\&= \varvec{d\tau }^t \,\left( e^{2x\varvec{Q_1}}\oplus \cdots \oplus e^{2x\varvec{Q_\ell }}\right) \, \varvec{d\tau }\\&= \sum _{\nu =1}^{\ell }\,\varvec{d\tau _\nu }^t \,e^{2x\varvec{Q_\nu }}\, \varvec{d\tau _\nu } \,, \end{aligned}$$

where \(\varvec{d\tau _\nu }\) is a \(m_{\nu }\times 1\) column matrix. Thus, the problem of computing the exponential \(e^{2x \varvec{Q_0}}\) has been reduced to the task of calculating \(e^{2x\varvec{Q_\nu }}\). At first glance it may seem that we have accomplished nothing, since we still have to exponentiate a matrix, although generally smaller. Nevertheless, now these matrices \(\varvec{Q_\nu }\) have a canonical form that greatly facilitate the job. Indeed, due to the property (34) it follows that \((\varvec{P_{m_\nu ,0}})^{m_\nu } = 0\), so that in the exponential series \(e^{2x\varvec{P_{m_\nu ,0}}}\) we just need to consider terms up to the power \((\varvec{P_{m_\nu ,0}})^{m_\nu -1}\). Thus, since \(\varvec{Q_\nu } = q_\nu \varvec{I_{m_\nu }} + \varvec{P_{m_\nu ,0}}\) and since the identity matrix \(\varvec{I_{m_\nu }}\) commutes with every other \(m_\nu \times m_\nu \) matrix, we can conclude that

$$\begin{aligned} e^{2x\varvec{Q_\nu }}&= e^{2x q_\nu \varvec{I_{m_\nu }}} e^{2x\varvec{P_{m_\nu ,0}}} \nonumber \\&= e^{2x q_\nu } \sum _{p=0}^{m_\nu -1}\frac{(2x)^p}{p!}\varvec{P_{m_\nu ,p-1}} \,. \end{aligned}$$
(35)

Therefore, when \(\varvec{Q_0}\) cannot be diagonalized the final form of our line element becomes:

$$\begin{aligned} ds^2 =&(S_x + S_y)\bigg [ \frac{dx^2}{\Delta _x^2} + \frac{dy^2}{\Delta _y^2} \Big .\nonumber \\&+ \bigg . \sum _{\nu =1}^\ell \sum _{p=0}^{m_\nu -1}\frac{(2x)^p e^{2x q_\nu }}{p!} \left( \varvec{d\tau _\nu }^t\,\varvec{P_{m_\nu ,p-1}} \,\varvec{d\tau _\nu } \right) \bigg ] \,, \end{aligned}$$
(36)

where the matrices \(\varvec{P_{m,p}}\) have been defined in Eq. (33). The functions \(S_x\), \(S_y\), \(\Delta _x\) and \(\Delta _y\) should be the ones found in the previous section while integrating Einstein’s vacuum equation. In particular, note that the above line element is not diagonal, so that some of the Killing vector fields \(\partial _{\tau _i}\) are not orthogonal to a family of hyper-surfaces.

Thus, now we have a recipe to explicitly construct new solutions for Einstein’s vacuum equation in arbitrary dimensions. For each value of n we can have solutions with different algebraic structures depending on the size of the blocks of the canonical form of \(\varvec{Q_0}\). For instance, when \(n=4\) we have five possibilities: (I) the line element is diagonal, namely the canonical form of \(\varvec{Q_0}\) is the direct sum of one-dimensional blocks; (II) the canonical form of \(\varvec{Q_0}\) is the direct sum of two \(2\times 2\) blocks; (III) the canonical form of \(\varvec{Q_0}\) is the direct sum of a \(2\times 2\) block plus two \(1\times 1\) blocks; (IV) the canonical form of \(\varvec{Q_0}\) is the direct sum of a \(3\times 3\) block plus one \(1\times 1\) block; and (V) \(\varvec{Q_0}\) cannot be broken in smaller blocks by a similarity transformation, it is a single \(4\times 4\) block. In general, for a given n, the number of different algebraic structures for the line element is the number of partitions of the integer n. In the next section we shall explore the possibilities for \(n=2\) and \(n=3\) in full detail.

6 Examples

In this section we work out explicit examples of the solutions found above, for both cases regarding whether the matrix \(\varvec{Q_0}\) is diagonalizable or not. Particularly, in the former case all the solutions turn out to be higher-dimensional generalizations of the Kasner metric. On the other hand, when \(\varvec{Q_0}\) is nondiagonalizable new solutions are attained. As stressed at the introduction, the special case \(n=2\) of our solutions, namely when spaces are four-dimensional, has already been addressed previously in Ref. [7]. Thus, as we will check below, all solutions for \(n=2\) should coincide with the ones of Ref. [7].

6.1 Diagonalizable case

In this subsection we shall deal with the case in which the complex symmetric matrix \(\varvec{Q_0}\) can be diagonalized. During the integration process of Einstein’s equation, we had to consider separately two possibilities: (A) when \(S_y'=0\); and (B) when \(S_x'=0\) and \(S_y'\ne 0\). Likewise, here we shall treat these two possibilities separately.

6.1.1 Case (A), \(S_y'=0\)

We begin by analyzing the solution for the case \(S_y'=0\), considering \(\varvec{Q_0}\) to be a diagonalizable matrix with eigenvalues given by \(q_i\), for \(i=1,\ldots ,n\). In this case, the solution is given by the metric (32) with \(S_y=0\), \(\Delta _y=1\), while functions \(\Delta _x\) and \(S_x\) are given respectively by (12) and (14). In addition, the constants \(a_1\) and \(a_2\) are related to each other by means of (15). In terms of the eigenvalues \(q_i\), these constants are given by:

$$\begin{aligned} a_1=\sum _{i=1}^{n}q_i \quad \text {and} \quad a_2=(n+1)\sum _{i=1}^{n}q_i^2 \,, \end{aligned}$$
(37)

which is a consequence of Eq. (20). In particular, in terms of (37), relation (15) becomes

$$\begin{aligned} \sum _{i=1}^{n}q_i^2=\frac{1}{(n+1)}\left( \sum _{i=1}^{n}q_i\right) ^2+\frac{n s_1^{n+1}\Lambda }{c_1^2} \,. \end{aligned}$$
(38)

Now, defining constants \(p_i\), for i running from 1 to n, and \(p_{n+1}\) by

$$\begin{aligned} p_i&=\frac{[(n+1)q_i-a_1]c_1}{(n+1)^{3/2}\sqrt{s_1^{n+1}\Lambda }}+\frac{1}{n+1}\,,\nonumber \\ p_{n+1}&=\frac{-a_1 c_1}{(n+1)^{3/2}\sqrt{s_1^{n+1}\Lambda }}+\frac{1}{n+1}\,, \end{aligned}$$
(39)

and performing the coordinate transformation \((x,\tau _i,y)\rightarrow (r,\tilde{\tau }_i,\tilde{\tau }_{n+1})\) defined by

$$\begin{aligned} x&=\frac{c_1\log \left[ \tan \big (\sqrt{(n+1)\Lambda }\,r/2\big )\right] }{\sqrt{(n+1)s_1^{n+1}\Lambda }}+x_0\,,\\ \tau _i&=\frac{2^{(p_i-\frac{1}{n+1})}e^{x_0(\frac{a_1}{n+1}-q_i)}}{s_1^{1/2}\big (\sqrt{(n+1)\Lambda }\,\big )^{p_i}}\tilde{\tau }_i\,,\\ y&=\frac{2^{(p_{n+1}-\frac{1}{n+1})}e^{\frac{a_1 x_0}{n+1}}}{s_1^{1/2}\big (\sqrt{(n+1)\Lambda }\,\big )^{p_{n+1}}}\tilde{\tau }_{n+1}\,, \end{aligned}$$

the solution becomes

$$\begin{aligned} ds^2=dr^2+L_r^{2/(n+1)}\sum _{\alpha =1}^{n+1} e^{2\left( p_\alpha -\frac{1}{n+1}\right) N_r}(d\tilde{\tau }_\alpha )^2\,, \end{aligned}$$
(40)

where

$$\begin{aligned} L_r&=\frac{\sin \big (\sqrt{(n+1)\Lambda }\,r\big )}{\sqrt{(n+1)\Lambda }} \,,\nonumber \\ N_r&=\log \Bigg [\frac{2 \tan \big (\frac{1}{2}\sqrt{(n+1)\Lambda }\,r\big )}{\sqrt{(n+1)\Lambda }} \Bigg ]\,. \end{aligned}$$
(41)

In this case, the parameters \(p_\alpha \) obey the following relations:

$$\begin{aligned} \sum _{\alpha =1}^{n+1}p_\alpha =1 \quad \text {and} \quad \sum _{\alpha =1}^{n+1}(p_\alpha )^2=1\,, \end{aligned}$$
(42)

the first relation being a direct consequence of definition (39), while the second one is obtained through Eq. (38). Notice that, by setting \(n=2\), namely for a four-dimensional space, the later solution becomes the Kasner metric generalized to contain a nonzero cosmological constant [11]. Indeed, the metric (40), along with (41) and (42), is the natural generalization of Kasner metric with cosmological constant for any number of dimensions and have been obtained before in Ref. [30]. In particular, evaluating the limit \(\Lambda \rightarrow 0\) we are lead to

$$\begin{aligned} ds^2=dr^2+\sum _{\alpha =1}^{n+1} r^{2p_\alpha }d\tilde{\tau }_\alpha ^2\,, \end{aligned}$$
(43)

with the parameters \(p_\alpha \) obeying (42). This Ricci-flat metric is the \((n+2)\)-dimensional version of the Kasner metric [31, 32].

Similarly, the case where both the functions \(S_x\) and \(S_y\) are constant is given by the line element (32) with \(S_x=s_1\), \(S_y=0\), \(\Delta _x=c_1 e^{-a_1 x}\) and \(\Delta _y=1\). In this case, the eigenvalues of \(\varvec{Q_0}\) are constrained by the following expression:

$$\begin{aligned} \bigg ( \sum _{i=1}^{n} q_i \bigg )^2=\sum _{i=1}^{n}q_i^2\,. \end{aligned}$$
(44)

Then, defining constants \(p_i=q_i/a_1\) and performing the coordinate transformation

$$\begin{aligned} \tau _i&=s_1^{(p_i-1)/2}(a_1 c_1)^{-p_i}\tilde{\tau }_i\,,\\ x&=a_1^{-1} \log \big [(a_1 c_1 r)/s_1^{1/2}\big ]\,,\\ y&=s_1^{-1/2}\tilde{\tau }_{n+1}\,, \end{aligned}$$

the present solution reduces to (43) with \(p_{n+1}=0\), while the relation (44) boils down to (42), again with \(p_{n+1}=0\). Therefore, this solution is a particular case of the \((n+2)\)-dimensional Ricci-flat Kasner metric. It is worth mentioning that for the choice \(n=2\) such solution degenerates to the four-dimensional flat space, in accordance with Ref. [7].

6.1.2 Case (B), \(S_x'=0\) and \(S_y'\ne 0\)

Now we carry out the analysis of the case \(S_x'=0\) and \(S_y'\ne 0\), with \(\varvec{Q_0}\) being a diagonalizable matrix with eigenvalues \(q_i\), for \(i=1,\ldots ,n\). The solution for this case is given by the line element (26) with \(\varvec{Q_0}=\text {diag}(q_1,\cdots ,q_n)\). Moreover, the following constraints must hold:

$$\begin{aligned} a_1 = \sum _{i=1}^n q_i \;\text { and }\; \sum _{i=1}^n q_i^2 = \left( \sum _{i=1}^n q_i\right) ^2 \,, \end{aligned}$$
(45)

which are a direct consequence of Eq. (27). In this solution, the function \(S_y\) can be chosen to be any nonconstant function, as stressed in the last paragraph of Sect. 3.2. Therefore, for convenience, let us choose \(S_y\) to be given by \(S_y=-(n+1)/(\Lambda y^2)\), so that \(\Delta _y=1\). Thus, performing the coordinate transformation \((x,\tau _i,y)\rightarrow (r,\tilde{\tau }_i,\tilde{\tau }_{n+1})\)

$$\begin{aligned} x&=a_1^{-1}\log (a_1 r)\,,\\ \tau _i&=(a_1 )^{-p_i}\tilde{\tau }_i\,,\\ y&= \tilde{\tau }_{n+1}\,, \end{aligned}$$

where we have defined \(p_i=q_i/a_1\), it follows that the line element is given by

$$\begin{aligned} ds^2 =-\frac{n+1}{\Lambda \tilde{\tau }_{n+1}^2} \Bigg [\,dr^2+\sum _{i=1}^{n} r^{2p_i}d\tilde{\tau }_i^2 + d\tilde{\tau }_{n+1}^2 \Bigg ]\,. \end{aligned}$$
(46)

The constraints (45) are now written in terms of \(p_i\) as

$$\begin{aligned} \sum _{i=1}^{n} p_i=\sum _{i=1}^{n} p_i^2=1\,. \end{aligned}$$

This solution is conformal to the Kasner metric (43) with \(p_{n+1}=0\). As mentioned above, this particular case of Kasner metric reduces to the four-dimensional flat space when we set \(n=2\) and, hence, solution (46) becomes a four-dimensional maximally symmetric space when \(n=2\), which is in perfect accordance with Ref. [7].

Since we have defined \(p_i=q_i/a_1\), the special case \(a_1=0\) must be handled separately. Doing so, we obtain that

$$\begin{aligned} \sum _{i=1}^{n} q_i=\sum _{i=1}^{n} q_i^2=0\,, \end{aligned}$$

and the solution reduces to a line element already presented in the literature, see Ref. [4]. Such spaces descend from Kasner spacetimes and their Kasner parameters \(q_i\) are either all zero or some of them must be complex, in which case the spacetime may admit closed time-like curves [4].

6.2 Nondiagonalizable case

Now, we shall deal with the most interesting case, namely when \(\varvec{Q_0}\) cannot be diagonalized. For \(n\ge 3\), this case leads to solutions that, as far as the authors know, have not been described in the literature yet. But, first, let us start considering the case \(n=2\) and showing that the solution obtained here coincides with the one of Ref. [7]. Then, we shall consider the case \(n=3\).

6.2.1 Case \(n=2\)

In this subsection we provide a few examples of metrics built from a nondiagonalizable \(\varvec{Q_0}\) when \(n=2\). Using the construction exhibited in Sect. 5.2, it follows that in such a case \(\varvec{Q_0}\) admits just one eigenvalue, here denoted by q, and there exists an orthogonal complex matrix \(\varvec{M}\) such that \(\varvec{M}^{t} \varvec{Q_0 M} =\varvec{Q_1}\) assumes the following canonical form:

$$\begin{aligned} \varvec{Q_1}= q \varvec{I_2}+\varvec{P_{2,0}} = q\left[ \begin{array}{cc} 1&{} 0 \\ 0 &{} 1 \\ \end{array} \right] + \frac{1}{2}\left[ \begin{array}{cc} i &{} 1 \\ 1 &{} -i \\ \end{array} \right] \,. \end{aligned}$$

Thus, in accordance with Eq. (35), the exponential of \(2x\varvec{Q_1}\) reads:

$$\begin{aligned} e^{2x\varvec{Q_1}}&= e^{2x q} \sum _{p=0}^{1}\frac{(2x)^p}{p!}\varvec{P_{2,p-1}} \\&= e^{2x q} \left[ \begin{array}{cc} 1+i x &{} x \\ x &{} 1-i x \\ \end{array} \right] \,, \end{aligned}$$

where it has been used the fact that \(\varvec{P_{2,-1}}\) is simply the identity, as can be checked from (33). Thus, the part of the line element involving the exponential is given by

$$\begin{aligned}&\varvec{d\tau _1}^t \,e^{2x\varvec{Q_1}}\, \varvec{d\tau _1} \\&\quad =e^{2x q} \left[ \begin{array}{cc} d\tau _1 &{} d\tau _2 \\ \end{array} \right] \left[ \begin{array}{cc} 1+i x &{} x \\ x &{} 1-i x \\ \end{array} \right] \left[ \begin{array}{c} d\tau _1 \\ d\tau _2\\ \end{array} \right] \\&\quad =e^{2x q}\left[ (1+ix)d\tau _1^2+(1-ix)d\tau _2^2+2x d\tau _1 d\tau _2\right] \,. \end{aligned}$$

Notice that this result, along with \(tr(\varvec{Q_0})=tr(\varvec{Q_1})=2q\) and \(tr(\varvec{Q_0}^2)=tr(\varvec{Q_1}^2)=2q^2\), is valid for all the cases regarding the constancy of the functions \(S_x\) and \(S_y\).

Thus, for instance, for the case (A), when \(S_y\) is a constant, the solution is given by the line element (19), which now reads

$$\begin{aligned} ds^2 =&\, S_x\bigg \{ e^{2x q}\left[ (1+ix)d\tau _1^2+(1-ix)d\tau _2^2+2x d\tau _1 d\tau _2\right] \Big .\nonumber \\&+\frac{dx^2}{\Delta _x^2} + dy^2 \bigg . \bigg \} \,, \end{aligned}$$

with functions \(S_x\) and \(\Delta _x\) given by

$$\begin{aligned} S_x&=s_1\big \{ e^{2qx} \cosh [q(x-x_0)] \big \}^{-2/3}\,,\\ \Delta _x&=\frac{\sqrt{3s_1^3\Lambda }}{q}\, e^{-2q x}S_x^{-1}\,. \end{aligned}$$

Then, performing the coordinate transformation \((\tau _1,\tau _2,x,y)\rightarrow (\phi , t, r, \theta )\) below:

$$\begin{aligned} \tau _1&=\frac{e^{3i\pi /4-q x_0/3}}{2^{11/6}s_1^{1/2}q^{1/2}}[\phi -(2(x_0+i)q-\log \Lambda )t]\,,\\ \tau _2&=\frac{e^{i\pi /4-q x_0/3}}{2^{11/6}s_1^{1/2}q^{1/2}}[\phi -(2(x_0-i)q-\log \Lambda )t]\,,\\ x&=\frac{1}{2q}(r-\log \Lambda )+x_0\,,\\ y&=\frac{e^{2qx_0/3}\theta }{2^{1/3}s_1^{1/2}\Lambda ^{1/2}}\,, \end{aligned}$$

we obtain the following line element:

$$\begin{aligned} ds^2=\frac{e^{-r} dr^2}{3(1+\Lambda e^{-r})^2}+\frac{e^{-r}d\theta ^2-dt(r dt+d\phi )}{(1+ \Lambda e^{-r} )^{2/3}}\,. \end{aligned}$$
(47)

This solution is a Kundt spacetime of Petrov type II, which has recently been obtained in Ref. [7], and, therefore, represents no novelty. Nevertheless, the current work helps to shed light on the origin of such solution, inasmuch as we have just proved that (47) is nothing more than the simplest member of an arbitrary-dimensional class of solutions of Einstein’s vacuum equation depending on the exponential of a non-diagonalizable symmetric matrix. Since in our recent work [7] we have identified several geometrical properties of the four-dimensional metric (47) and used such characterization to thoroughly look for previous appearance of this exact solution in the literature, with no success, we were confident that it comprised a new solution. Following this reasoning, since the non-diagonalizable solutions presented here contain this new four-dimesional metric as a particular case, we are also positive that the higher-dimensional family of solutions presented here have not been attained before. Of course, in addition to this reasoning, we have also searched for higher-dimensional exact solutions with the same number of commuting killing vectors and have not found in the literature any spacetime equivalent to the non-diagonal class of solutions presented here.

For the case (B), where \(S_x'=0\) and \(S_y\ne 0\), a similar treatment provides that the solution is a maximally symmetric space, as already anticipated in Ref. [7]. In such case, we notice that even though the part \(\varvec{d\tilde{\sigma }}^t e^{2x\varvec{Q_0}} \varvec{d\tilde{\sigma }}\) of the line element cannot be diagonalized using cyclic coordinates, the metric as a whole can.

6.2.2 Case \(n=3\)

As a second example, let us consider \(n=3\). In this case we have three different algebraic types for the canonical form of the matrix \(\varvec{Q_0}\): (I) it can be diagonal; (II) it can be the direct sum of a \(2\times 2\) plus a \(1\times 1\) blocks; (III) it can be a single \(3\times 3\) block. The case (I) has already been considered above for arbitrary n, whereas the case (II) can be easily tackled by adding the term \(e^{2x q_2}d\tau _3^2\) to the line element obtained in the previous Sect. (case \(n=2\)), in accordance with Eq. (36), which yields

$$\begin{aligned} ds^2 =&(S_x + S_y)\bigg \{ \frac{dx^2}{\Delta _x^2} + \frac{dy^2}{\Delta _y^2} + e^{2x q_2}d\tau _3^2\Big .\nonumber \\&+ e^{2x q_1}\left[ (1+ix)d\tau _1^2+(1-ix)d\tau _2^2+2x d\tau _1 d\tau _2\right] \bigg \} \,. \end{aligned}$$

In order to eliminate the complex character of this metric we can perform the change of coordinates \((\tau _1,\tau _2)\rightarrow (\tilde{\tau }_1,\tilde{\tau }_2)\) defined by

$$\begin{aligned} \tau _1= \frac{e^{3i\pi /4}}{2}(\tilde{\tau }_1+i\tilde{\tau }_2) \quad \text {and} \quad \tau _2=\frac{e^{5 i\pi /4}}{2}(\tilde{\tau }_1-i\tilde{\tau }_2)\,, \end{aligned}$$

so that the line element reads

$$\begin{aligned} ds^2 =&(S_x + S_y)\bigg [e^{2x q_1} d\tilde{\tau }_1(x d\tilde{\tau }_1+d\tilde{\tau }_2) + e^{2x q_2}d\tau _3^2 \nonumber \\&+\frac{dx^2}{\Delta _x^2} + \frac{dy^2}{\Delta _y^2} \bigg ] \,. \end{aligned}$$
(48)

As usual, the functions \(\Delta _x\), \(\Delta _y\), \(S_x\) and \(S_y\) should be the ones obtained through the integration process of Einstein’s equation, see Sect. 3. Moreover, \(q_1\) and \(q_2\) are related to each other through Eqs. (15) or (25). In spite of the fact that this solution has not been described in the literature yet (as far as the authors know), it can be seen as a simple extension of the solution for the case \(n=2\), which have been recently found in Ref. [7]. Differently, the possibility (III) of the case \(n=3\), namely when the canonical form of \(\varvec{Q_0}\) is a single \(3\times 3\) block, leads to a solution that has a new algebraic structure and, therefore, cannot be seen as a simple generalization of the former examples. Now, let us consider such possibility.

When \(\varvec{M}^t \varvec{Q_0 M}=\varvec{Q_1}\) is a single \(3\times 3\) block with eigenvalue q, we have that

$$\begin{aligned} e^{2x\varvec{Q_1}}&= e^{2x q} \sum _{p=0}^{2}\frac{(2x)^p}{p!}\varvec{P_{3,p-1}} \nonumber \\&=e^{2x q}(\varvec{P_{3,-1}}+2x\varvec{P_{3,0}}+2x^2\varvec{P_{3,1}})\,, \end{aligned}$$
(49)

where \(\varvec{P_{3,-1}}\) is the identity matrix, whereas \(\varvec{P_{3,0}}\) and \(\varvec{P_{3,1}}\) are given by

$$\begin{aligned} \varvec{P_{3,0}}= \frac{1}{2}\! \left[ \! \begin{array}{ccc} 0 &{} 1+i &{} 0 \\ 1+i &{} 0 &{} 1-i \\ 0 &{} 1-i &{} 0 \\ \end{array} \!\!\right] \!,\, \varvec{P_{3,1}}= \frac{1}{2}\! \left[ \begin{array}{ccc} i &{} 0 &{} 1 \\ 0 &{} 0 &{} 0 \\ 1 &{} 0 &{} -i \\ \end{array} \right] \!. \end{aligned}$$

Thus, inserting these into Eq. (49) we are led to

$$\begin{aligned} \varvec{d\tau _1^t} \,e^{2x\varvec{Q_1}}\, \varvec{d\tau _1} =&\, e^{2x q}\bigg [ (1+ix^2)d\tau _1^2+d\tau _2^2 \\&+(1-ix^2)d\tau _3^2 +2(1+i)x d\tau _1 d\tau _2 \\&+2x^2 d\tau _1 d\tau _3+2(1-i)x d\tau _2 d\tau _3 \bigg ]\,. \end{aligned}$$

In order to get rid of the complex dependence in the line element one can perform the coordinate transformation \((x,\tau _3)\rightarrow (\tilde{x},\tilde{\tau }_3)\) defined by

$$\begin{aligned} x=-(1-i)\tilde{x}\quad \text {and} \quad \tau _3=i \tilde{\tau }_3\,, \end{aligned}$$

along with a redefinition of the constant parameter q, \(q \rightarrow \tilde{q} =-(1-i)q\), which easily leads to

$$\begin{aligned} \varvec{d\tau _1^t} \,e^{2x\varvec{Q_1}}\, \varvec{d\tau _1} =&e^{2\tilde{x} \tilde{q}}\bigg [ (1+2\tilde{x}^2)d\tau _1^2+d\tau _2^2 \nonumber \\&-(1-2\tilde{x}^2)d\tilde{\tau }_3^2 \,\nonumber \\&-4\tilde{x}d\tau _1 (d\tau _2-\tilde{x}d\tilde{\tau }_3)-4\tilde{x} d\tau _2 d\tilde{\tau }_3\bigg ]\,. \end{aligned}$$
(50)

Since we have incorporated a complex factor into the coordinate x, it may seem that we have spoiled the expressions for \(S_x\) and \(\Delta _x\) with complex numbers. But this is not the case. Indeed, in the expressions for these functions, see Eqs. (12), (14), and (24), the coordinate x appears in the combinations \(a_1 x\) and \(\sqrt{a_2 - a_1^2} x\). But, since

$$\begin{aligned} a_1= & {} \text {tr}\left( \varvec{Q_0}\right) = \text {tr}\left( \varvec{Q_1}\right) = 3q \,, \text { and} \nonumber \\ a_2= & {} 4\,\text {tr}\left( \varvec{Q_0}^2\right) = 4\,\text {tr}\left( \varvec{Q_1}^2\right) = 12 q^2\,, \end{aligned}$$
(51)

it follows that

$$\begin{aligned} a_1 \, x = 3 \tilde{q} \tilde{x} \, , \;\;\text { and }\;\; \sqrt{a_2 - a_1^2}\,x = \sqrt{3} \tilde{q} \tilde{x} \,, \end{aligned}$$

so that, at the end of the day, no complex factor shows up. Regarding the complex factor coming from the term \(dx^2\), it can be trivially absorbed into the integration constant \(c_1\).

Thus, using these results along with Eqs. (12), (14), (15), and (19), it follows that, for the case (A) of the integration process, when \(S_y'=0\), the final solution reads

$$\begin{aligned} ds^2= & {} S_{\tilde{x}}\left\{ e^{2\tilde{x} \tilde{q}}\bigg [ (1+2\tilde{x}^2)d\tau _1^2+d\tau _2^2 -(1-2\tilde{x}^2)d\tilde{\tau }_3^2 \right. \\&-4\tilde{x}d\tau _1 (d\tau _2-\tilde{x}d\tilde{\tau }_3)-4\tilde{x} d\tau _2 d\tilde{\tau }_3\bigg ] \\&\left. + \frac{\tilde{q}^2 e^{6 \tilde{q}\, \tilde{x}}}{4 s_1^4 \Lambda }\,S_{\tilde{x}}^3 d\tilde{x}^2+ dy^2 \right\} \,, \end{aligned}$$

where the function \(S_{\tilde{x}}\) is defined by

$$\begin{aligned} S_{\tilde{x}} = s_1\,\left\{ e^{3 \tilde{q} \tilde{x}}\cosh \!\left[ \, \tilde{q} (\tilde{x}-\tilde{x}_0) \,\right] \right\} ^{-1/2}\,. \end{aligned}$$

The constants \(s_1\) and \(\tilde{x}_0\) are arbitrary, but they are both nonphysical, as we can set them to 1 and 0 respectively by means of a coordinate transformation. Actually, in all solutions presented in this article, for arbitrary n, we can set \(s_1=1\) and \(x_0=0\) without changing the geometry of the spacetime. Likewise, we can also set \(\tilde{q}=1\) in the latter line element, which just amounts to a coordinate transformation. Thus, the only important parameter in this metric is the cosmological constant, \(\Lambda \). As far as the authors know, this solution has not been described before in the literature.

In order to get a hint on the possible existence of singularities on the class exact solutions found here, let us look for singularities on the spacetime of the later example, namely when \(n=3\) and \(S_y=0\). In this case, we can easily note that if \(\tilde{q}>0\), the above line element becomes problematic for \(\tilde{x}\rightarrow -\infty \), since the coefficients in front of the differentials \(d\tau _id\tau _j\) and \(d\tilde{x}^2\) goes to zero, while the one in front of \(dy^2\) diverges in this limit. However, it could just be a coordinate singularity. Nevertheless, computing the Kretschmann curvature scalar we find

$$\begin{aligned} R^{abcd}R_{abcd} = \frac{\Lambda ^2}{2}\left( 14 + 18 e^{-2\tilde{q}\tilde{x}} + 9 e^{-4\tilde{q}\tilde{x}} \right) \,, \end{aligned}$$

which diverges at the limit \(\tilde{x}\rightarrow -\infty \), where in the latter calculation it was assumed \(\tilde{x}_0=0\). Thus, we can say that such spacetimes are singular at \(\tilde{x}\rightarrow -\infty \) if \(\tilde{q}>0\). Analogously, if \(\tilde{q}>0\) and \(\tilde{x}\rightarrow \infty \) the latter line element also becomes singular, this time because the coefficient of \(d\tilde{x}^2\) and \(dy^2\) vanish, while those in front of \(d\tilde{\tau }_1\) and \(d\tilde{\tau }_3\) diverge. But, in this case, we see from the above expression that the curvature scalar is well-behaved at this limit. Indeed, one can make the coordinate changes \(\tilde{\tau }_1\rightarrow \hat{\tau }_1 = \tilde{x}\tilde{\tau }_1 \), \(\tilde{\tau }_3\rightarrow \hat{\tau }_3 = \tilde{x}\tilde{\tau }_3 \), and \(y\rightarrow \hat{y} = e^{-\tilde{q}\tilde{x}} y \) and see that, in these coordinates, the limit \(\tilde{x}\rightarrow \infty \) is well-defined. Actually, one can check that \(\partial _{\tilde{x}}\) is a geodesic vector field and that in the limit \(\tilde{x}\rightarrow \infty \) the affine parameter of the geodesic becomes \(s\sim e^{-\tilde{q}\tilde{x}}\), which is finite in this limit. Conversely, if the constant parameter \(\tilde{q}\) is negative, the singularity will be at \(\tilde{x}\rightarrow \infty \), while the limit \(\tilde{x}\rightarrow -\infty \) is regular.

Concerning the case (B) for \(n=3\), when \(S_x'=0\) and \(S_y'\ne 0\), we should have \(a_2 = 4 a_1^2\), as a consequence of Eq. (25). However, generally this restriction is compatible with Eq. (51) only if we set \(\tilde{q}=0\). Actually, this conclusion of vanishing eigenvalue is valid for arbitrary values of n, whenever the canonical form of \(\varvec{Q_0}\) is a single block. Thus, for the case \(n=3\) with \(S_x'=0\) we eventually arrive at the following solution:

$$\begin{aligned} ds^2= & {} - \frac{4}{\Lambda \,y^2}\left\{ \bigg [ (1+2\tilde{x}^2)d\tau _1^2+d\tau _2^2\right. \\&-(1-2\tilde{x}^2)d\tilde{\tau }_3^2 \,-4\tilde{x}d\tau _1 (d\tau _2-\tilde{x}d\tilde{\tau }_3)\\&\left. -4\tilde{x} d\tau _2 d\tilde{\tau }_3\bigg ] + \tilde{c}_1\, d\tilde{x}^2+ dy^2 \right\} \,. \end{aligned}$$

7 Cosmological models with perfect fluid

From the physical point of view, a particularly interesting case of the class of metrics considered here, see Eq. (1), is when we assume that the function \(\Delta _x\) is imaginary, in which case the vector field \(\partial _x\) becomes time-like and x can be seen as a global time coordinate. Note that this possibility can be easily implemented in the above solutions by means of complexifying the integration constant \(c_1\), which appears as a multiplicative global factor in the function \(\Delta _x\). Indeed, assuming that \(c_1 = i \,\tilde{c}_1\), with \(\tilde{c}_1\) being a real constant, it follows that the sign of \(dx^2/\Delta _x^2\) becomes negative. Note also that no problem appears in the definition of the other integrated functions, since they do not depend on \(c_1\). The only other place in which \(c_1\) appears is in the constraint (15), but in this expression \(c_1\) appears squared, so that the constraint keeps its real character. In the present section, we shall assume exactly this, namely x will be a global time coordinate.

Particularly appealing is the case in which \(S_y=0\), which makes \(\Delta _y\partial _y\) a Killing vector field, so that the \((n+2)\)-dimensional spacetime allows \(n+1\) space-like commuting Killing vectors and, therefore, the space slices are homogenous, which is an usual assumption in cosmological models. With this motivation in mind, in the present section the attention will be focused on spacetimes whose line elements can be written as:

$$\begin{aligned} ds^2 = S_t\left[ H^{ij}_t d\sigma _i d\sigma _j + dy^2 - \frac{dt^2}{\Delta _t^2} \right] \,, \end{aligned}$$
(52)

where, in comparison with Eq. (1), we have made the change of notation \(x\rightarrow t\), \(H_x^{ij} \rightarrow H_t^{ij} \) , \(S_x \rightarrow S_t\), \(\Delta _x \rightarrow i\Delta _t\), and have assumed \(S_y=0\) and \(\Delta _y=1\), with the latter being just a gauge choice, as explained in the previous sections.

Now, instead of considering vacuum, let us assume that a perfect fluid permeates the spacetime. In this case, Einstein’s equation reads

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

where \(T_{ab}\) is the energy-momentum tensor of the perfect fluid, which is given by

$$\begin{aligned} T_{ab} = (\rho + p ) U_aU_b + p \,g_{ab}\,, \end{aligned}$$

with \(\rho \) and p standing respectively for the energy density and the pressure fields of the fluid, whereas \(U^a\) is the normalized velocity field of the fluid. Here we will assume that \(U^a\) is orthogonal to the space-like hyper-surfaces generated by \(\partial _{\sigma _i}\) and \(\partial _y\), so that

$$\begin{aligned} \varvec{U} = \frac{\Delta _t}{\sqrt{S_t}} \,\partial _t \,. \end{aligned}$$

In order to integrate Einstein’s equation we need to assume an equation of state for the fluid, which here will be

$$\begin{aligned} p = \omega \, \rho \,, \end{aligned}$$

where \(\omega \) is some constant. For instance, when \(\omega =0\) the fluid behaves like dust, while for \(\omega =1/(n+1)\) it behaves like electromagnetic radiation. In this case, Einstein’s equation reads:

$$\begin{aligned} R_{ab} = (1+\omega )\,\rho \,U_a U_b + \frac{\rho }{n}(1-\omega ) \, g_{ab}\,. \end{aligned}$$
(53)

Assuming the strong energy condition to hold, we must have \(\rho > 0\) and \(\omega \ge -1/(n+1)\). The nice thing about writing Einstein’s equation as Eq. (53) is that we can take advantage of the already computed components of the Ricci tensor displayed in Eq. (7). However, we should perform the changes \(x\rightarrow t\), \(\varvec{A_x}\rightarrow \varvec{A_t}\), \(S_x \rightarrow S_t\), and \(\Delta _x \rightarrow i\Delta _t\), which were assumed in this section. In particular, note that the vielbein also gets changed accordingly:

$$\begin{aligned} e_{\hat{x}} = \frac{\Delta _x}{\sqrt{S_x}} \,\partial _x \; \rightarrow \; i\,\frac{\Delta _t}{\sqrt{S_t}} \,\partial _t = i\,\varvec{U} \equiv i\, e_{\hat{t}} \,, \end{aligned}$$

so that

$$\begin{aligned} R_{\hat{x}\hat{x}} = (e_{\hat{x}})^a (e_{\hat{x}})^b R_{ab} = -\,(e_{\hat{t}})^a (e_{\hat{t}})^b R_{ab} = -\,R_{\hat{t}\hat{t}}\,. \end{aligned}$$

Now, in order to perform the integration of Einstein’s equation (53), it is helpful to display the nonzero components of the Ricci tensor which, in terms of the orthonormal vielbein \(\{e_a\}\), are given by

$$\begin{aligned} R_{ij}=&\frac{\Delta _t^2}{2S_t} \left[ \left( tr(\varvec{A_t}) + \frac{n S_t'}{2S_t} + \frac{\Delta _t'}{\Delta _t}\right) (\varvec{A_t}+\varvec{A_t}^t)\right. \nonumber \\&\left. -\varvec{A_tA_t}^t+\varvec{A_t}^t \varvec{A_t} + \varvec{A_t}' +\varvec{A_t}'^{\,t} \,\right] _{ij}+\delta _{ij}R_{\hat{y}\hat{y}}\,,\nonumber \\ R_{\hat{t}\hat{t}}=&\frac{-\Delta _t^2}{2S_t} \left[ \, tr(\varvec{A_t}^2+\varvec{A_tA_t}^t) + \left( \frac{S'_t}{S_t} \right. \right. \nonumber \\&\left. +\frac{2\Delta '_t}{\Delta _t} \right) tr(\varvec{A_t})+ 2tr(\varvec{A_t}')\nonumber \\&\left. +\frac{(n+1)}{S_t}\left( S''_t - \frac{(S'_t)^2}{S_t} + \frac{S'_t\Delta '_t}{\Delta _t} \right) \right] \,, \nonumber \\ R_{\hat{y}\hat{y}}=&\frac{\Delta _t^2}{2S_t^2} \left[ tr(\varvec{A_t})\,S'_t + S''_t + \frac{(n-2)(S'_t)^2}{2S_t} + \frac{S'_t\Delta '_t}{\Delta _t} \right] \,, \end{aligned}$$
(54)

where it is worth stressing that the upper t’s in the expressions, like the one in \(\varvec{A_t}^t\), stands for transposition. Then, taking into account that the above components are the only ones that are nonvanishing, the projection of the Einstein’s equations (53) on the orthonormal frame yields immediately to the following set of equations:

$$\begin{aligned} R_{ij}&=\frac{1}{n}(1-\omega )\,\rho \,\delta _{ij}\,,\nonumber \\ R_{\hat{t}\hat{t}}&=\frac{1}{n}[(n-1)+(n+1)\omega ]\,\rho \,,\\ R_{\hat{y}\hat{y}}&=\frac{1}{n}(1-\omega )\,\rho \,.\nonumber \end{aligned}$$
(55)

In particular, notice that since \(R_{ij}=R_{\hat{y}\hat{y}}\delta _{ij}\), we have the same structure that we had in the integration of Einstein’s equation in Sect. 3.1. Then, following the discussions present there, without any loss of generality, we can make the gauge choice

$$\begin{aligned} \Delta _t=c_1 e^{-a_1 t}(S_t)^{-n/2}\,, \end{aligned}$$
(56)

where \(a_1=tr(\varvec{A_t})\) is a constant. It also follows from the previous discussions that the particular combination \(tr(\varvec{A_t}^2+\varvec{A_t A_t}^t)\) is a constant too, conveniently denoted by

$$\begin{aligned} tr(\varvec{A_t}^2+\varvec{A_t A_t}^t)&=\frac{2}{n+1}a_2\,. \end{aligned}$$

Another consequence of the same equation is that the matrix \(\varvec{H_t}\), whose components are \(H_t^{ij}\) that appear in the line element (52), can be written as the exponential of an arbitrary constant symmetric matrix \(\varvec{Q_0}\), so that

$$\begin{aligned} H^{ij}_t d\sigma _i d\sigma _j=\varvec{d\sigma }^t e^{2 t \varvec{Q_0}} \varvec{d\sigma }\,\,, \end{aligned}$$
(57)

where, again, \(\varvec{d\sigma }^t\) stands for the transpose of \(\varvec{d\sigma }\). In this case, we have the following relations:

$$\begin{aligned} tr(\varvec{Q_0})=a_1\,,\quad \quad tr(\varvec{Q_0}^2)=\frac{1}{n+1}a_2\,. \end{aligned}$$

Thus, we have solved the first equation in (55), remanning only to solve the last two components of Einstein’s equation (55). However, now, it is worth recalling that besides solving the Einstein’s equations we also need to solve simultaneously the fluid equations. These equations stem from the identity \(\nabla _aT^{ab}=0\). Projecting the latter relation onto the direction of the fluid velocity, \(\varvec{U}=e_{\hat{t}}\), and on the hypersurface orthogonal to it, lead us to the following equations respectively:

$$\begin{aligned}&U^a\nabla _a\rho +(1+\omega )\rho \nabla _aU^a=0\,, \nonumber \\&\quad (1+\omega )\rho U^a\nabla _aU^b+(g^{ab}+U^aU^b)\omega \nabla _a \rho =0\,. \end{aligned}$$
(58)

Then, before getting back to the remaining components of Einstein’s equation, namely the equations for \(R_{\hat{t}\hat{t}}\) and \(R_{\hat{y}\hat{y}}\), we will tackle the above equations for the fluid dynamics. At this point, it is handy to have the spin coefficients, so that the covariant derivatives can be evaluated in the orthogonal frame. Once we learned the recipe to obtain the components of the Ricci tensor from the previous sections, we can do the same to obtain the spin coefficients based on the previous knowledge of them in the Euclidean signature. Then, specializing to the case where \(S_y=0\) and \(\Delta _y=1\), the nonzero spin coefficients are given by:

$$\begin{aligned} \omega ^i{}_j&= - \frac{\Delta _t(A^{ij}_t-A^{ji}_t)}{2\sqrt{S_t}} \, e^{\hat{t}}\,, \quad \quad \omega ^{\hat{t}}{}_{\hat{y}}=\frac{\Delta _t S'_t \,e^{\hat{y}}}{2(S_t)^{3/2}}\,, \end{aligned}$$
(59)
$$\begin{aligned} \omega ^i{}_{\hat{t}}&= \Delta _t\Big [\frac{(A^{ij}_t+A^{ji}_t)}{2\sqrt{S_t}}+\frac{S'_t\delta ^i_j}{2(S_t)^{3/2}}\Big ] \,e^j\,. \end{aligned}$$
(60)

Working out the second equation in (58), we obtain that \(\partial _y\rho =0=\partial _i\rho \), conveying that \(\rho \) is at most a function of the time coordinate. In fact, this is the only information we can get from this equation, unless we had \(\omega =0\), in which case such equation is identically satisfied. Then, considering \(\rho =\rho (t)\), the first fluid equation becomes

$$\begin{aligned} \partial _t\rho +(1+\omega )\rho \left[ a_1+\frac{(n+1)S_t'}{2S_t} \right] =0\,. \end{aligned}$$
(61)

This equation can be solved exactly for \(\rho \), leading to

$$\begin{aligned} \rho =\rho _0e^{-a_1(1+\omega )t}S_t^{-\frac{1}{2}(n+1)(1+\omega )}\,. \end{aligned}$$
(62)

Notice that the possibility \(\rho \) being constant should be treated separately, which is done in the end of this section. Now let us get back to the components \(\hat{t}\hat{t}\) and \(\hat{y}\hat{y}\) of Einstein’s equation. In particular, consider the following combination:

$$\begin{aligned} \frac{R_{\hat{t}\hat{t}}}{(n-1)+(n+1)\omega }-\frac{R_{\hat{y}\hat{y}}}{1-\omega }=0\,. \end{aligned}$$

This equation can be solved for the remaining unknown function \(S_t\), leading to the following relation:

$$\begin{aligned} S_t=s_1 e^{-\frac{2a_1 t}{(n+1)}} \left[ \cosh [\beta (t-t_0)]\right] ^\alpha \,, \end{aligned}$$
(63)

where \(t_0\) and \(\rho _0\) are integration constants, while \(\alpha \) and \(\beta \) are defined by

$$\begin{aligned} \alpha = \frac{4}{(n+1)(\omega -1)}\,,\; \; \beta = \frac{\sqrt{a_2-a_1^2}(1-\omega )}{2\sqrt{n}}\,. \end{aligned}$$

Then, plugging \(S_t\) into either \(R_{\hat{t}\hat{t}}\) or \(R_{\hat{y}\hat{y}}\), we obtain that the constant \(\rho _0\) must be given by

$$\begin{aligned} \rho _0 = \frac{(a_1^2-a_2)c_1^2 s_1^{\frac{1}{2}(n+1)(\omega -1)}}{2(n+1)} \,. \end{aligned}$$

Inserting the expression for \(S_t\) into Eq. (62) lead us to the fluid energy density. One can see that the energy density is homogeneous in space but changes with time. If \(\omega >1\), \(\rho \) the energy density has its peak at \(t=t_0\) and goes to zero as \(t\rightarrow \pm \infty \), while if \(\omega <1\) the energy density diverges for \(t\rightarrow \pm \infty \). Thus, for \(t>t_0\), in the regime \(\omega >1\) the fluid looses its energy to the gravitational field as time passes by, while if \(\omega <1\) it is the other way around.

Thus, in conclusion, the solution for the perfect fluid when \(\rho \) is not constant is given by the line element (52) with the matrix \(H_t^{ij}\) given by Eq. (57), while the functions \(\Delta _t\) and \(S_t\) are given by Eqs. (56) and (63) respectively. In its turn, the energy density of the fluid is given by (62).

Concerning the special case in which \(\rho \) is a constant, Eq. (61) leads to

$$\begin{aligned} S_t=s_1 e^{-\frac{2 a_1 t}{(n+1)}}\,. \end{aligned}$$

Then, the equation for \(R_{\hat{y}\hat{y}}\) forces \(\omega =1\), so that the perfect fluid cannot be arbitrary. Finally, the equation for \(R_{\hat{t}\hat{t}}\) gives us

$$\begin{aligned} \rho _0=\frac{(a_1^2-a_2)c_1^2 s_1^{-(n+1)}}{2(n+1)}\,. \end{aligned}$$
(64)

8 Conclusions and perspectives

Starting with the class of \((n+2)\)-dimensional spaces of Eq. (1), we fully integrate Einstein’s vacuum equation with a cosmological constant. The solutions found in Sect. 3 turn out to depend on the exponential of an arbitrary constant symmetric matrix \(\varvec{Q_0}\). By the use of suitable coordinate transformations, this exponential can be explicitly computed and the attained line element can have different algebraic structures depending on the canonical form of \(\varvec{Q_0}\). For example, in the simplest case, when \(\varvec{Q_0}\) is diagonalizable, the solutions are higher-dimensional generalizations of Kasner metric, which represent homogeneous but non-isotropic spacetimes used in cosmological models. However, when \(\varvec{Q_0}\) cannot be diagonalized more interesting solutions are obtained. As argued in the paragraph just below Eq. (47), after thoroughly looking in the literature for solutions with the same geometrical properties of the non-diagonal class of exact solutions presented here, we are confident that these solutions have not been described before in the literature. As a further indication, note that already in the example for \(n=3\) the exponential of a non-diagonal matrix becomes quite messy when written explicitly, even when a particularly simple basis is used, see Eq. (50), let alone cases of higher n. Therefore, it is hard to conceive that these solutions have been found elsewhere without using the structure of the exponential of a matrix, in which case it would not be hard to track it down.

In the general solution obtained here, the part of the line element associated with the cyclic coordinates \(\tau _i\) is generally composed by the sum of smaller blocks, see Eq. (36). Thus, once we have computed the structure of the line element in the cases in which the canonical forms of \(\varvec{Q_0}\) are single \(n\times n\) blocks, for different values of n, we can compose these solution in order to generate Einstein spaces of higher dimensions. For instance, in Eq. (48) we have merged a \(2\times 2\) block with a \(1\times 1\) block in order to create a solution with \(n=3\).

Finally, in Sect. 7, we have also considered cosmological models with perfect fluid and integrated Einstein’s equation analytically. In these solutions the spacetimes are endowed with a global time coordinate and the space-like hyper-surfaces of constant time are homogenous, as usually assumed in cosmology, although not isotropic.

In the present work we have focused exclusively on the integration of Einstein’s equation and simplification of the algebraic structure of the solutions. The physical aspects, as well as the geometrical properties of these solutions, have not been addressed. In the future we intend to fill these gaps in order to attain a full comprehension of such spaces.