1 Introduction

Nowadays, one of the most important challenges in physics is try to understand the current acceleration of the Universe. In 1998, using observations from Supernovae type Ia, it was shown that the Universe is facing an accelerating expansion, changing the way that we understand how our Universe is evolving [1]. Later, other cosmological observations such as CMB observations [2,3,4,5], baryon acoustic oscillations [6] or galaxy clustering [7] also confirmed this behaviour of the Universe. The responsible of this late-time acceleration of the Universe is still not well understood and for that reason it was labelled as the dark energy problem. In general, there are two different approaches which try to deal with this issue. First, one can assume that general relativity (GR) is always valid at all scales and introduce a new kind of matter which mimics this acceleration. This kind of matter known as “exotic matter” needs to violate the standard energy conditions to describe the evolution of the Universe. Up to now, this kind of matter has not been discovered in the laboratory. One can say that this approach lies on the idea of changing the right hand side of the Einstein field equations. An alternative approach to understand and study the dark energy is to assume that GR is only valid at certain scales and therefore it needs to be modified. In this approach, the left hand side of the Einstein field equations is modified and there is no need to introduce exotic matter. Different kind of modified theories of gravity have been proposed in the literature to understand the dark energy problem (see the reviews [8,9,10]).

One very interesting and alternative theory of gravity is the teleparallel equivalent of general relativity (TEGR) or “teleparallel gravity”. In this theory, the manifold is endorsed with torsion but assumes a zero curvature. The connection which satisfies this kind of geometry is the so-called “Weitzenböck” connection, which was first introduced in 1922 [11]. It was then showed that this theory is equivalent to GR in the field equations but the geometrical interpretation of gravity is different. In TEGR, there is not geodesic equation as in GR. Instead, forces equations describe the movement of particles under the influence of gravity. Additionally, the dynamical variable is the tetrad instead of the metric as in GR. For more details about TEGR, see [12,13,14,15,16,17] and also the book [18]. Similarly as in GR, there are also modified theories starting from the teleparallel approach. The most famous teleparallel modified theory is f(T) gravity (where T is the scalar torsion) which can describe very well the current acceleration of the Universe and also other cosmological observations (see [19,20,21,22,23,24,25,26,27,28,29,30,31,32,33] and also the review [34]). The TEGR action contains the term T so f(T) gravity is a straightforward generalisation of it. This theory is analogous to the well-known f(R) gravity, where instead of having the scalar curvature R in the action, a more general theory with an arbitrary function which depends on R is introduced. These two theories are analogous but mathematically they are very different. As we pointed out before, the TEGR field equations are equivalent to the Einstein field equations. However, their generalisations f(R) and f(T) gravity have different field equations. Further, f(R) gravity is a 4th order theory and f(T) gravity is a 2nd order theory. This characteristic can be understood using the fact that \(R=-T+B\), where B is a boundary term. Hence, a linear combination of R or T in the action will produce the same field equations since B will not contribute to it. However, when one modifies the action as an arbitrary function f(T) or f(R), there will be a difference in their field equations due to the fact that now the boundary term B contributes. This was fully studied in [35] where the authors introduced a new theory, the so-called f(TB) gravity, which can recover either f(T) gravity or \(f(T,B)=f(-T+B)=f(R)\) as special cases. Flat FLRW cosmology of this theory was studied in [36, 37].

Other kinds of modified theories of gravity have been considered in the literature. Some interesting ones are theories with non-minimally coupling between matter and gravity. In standard metric approach, some alternatives models have been proposed such as \(f(R,\mathcal {T})\) [38], where \(\mathcal {T}\) is the trace of the energy-momentum tensor or non-minimally coupled theories between the curvature scalar and the matter Lagrangian \(f_1(R)+f_2(R)L_m\) [39]. Further, another more general theory is the so-called \(f(R,L_m)\) where now an arbitrary function of R and \(L_m\) is considered in the action [38]. Along the lines of those theories, modified teleparallel theories of gravity where couplings between matter and the torsion scalar have been also considered. Some important theories are for example: \(f(T,\mathcal {T})\) gravity [40] and also non-minimally couplings between the torsion scalar and the matter Lagrangian theory \(f_1(T)+f_2(T)L_m\) [41]. Along this line, in this paper, we present a new modified teleparallel theory of gravity based on an arbitrary function \(f(T,B,L_m)\) where \(L_m\) is the matter Lagrangian. In this theory, we have the possibility of for example recover \(f(-T+B,L_m)=f(R,L_m)\) or a new generalisation of [41] in the teleparallel framework with a function \(f(T,L_m)\) depending on T and \(L_m\). The later new theory is the analogous theory as \(f(R,L_m)\) gravity. We will explicitly discuss about how those models are related, with B being the main ingredient which connects both the metric and tetrad approaches.

After formulating the new \(f(T,B,L_m)\) theory, the conservation equation is obtained and exactly as in \(f(R,L_m)\), we will see that the conservation equation in \(f(T,B,L_m)\) theory is not always valid. It will be proved that for the flat FLRW case and assuming \(L_m=-2\rho \), the conservation equation is conserved exactly as happens in \(f(R,L_m)\) or in \(f_1(R)+f_2(R)L_m\) (see [42, 43]). The main aim of this paper is to also formulate the dynamical system of this new generalise theory, which is in general a ten-dimensional one. This dynamical system is a generalisation of different models such as the ones studied in [43,44,45]. After formulating the full dynamical system, different special cases are recovered. Some of them have been studied in the past, hence we only mention how our dimensionless variables are related to them and then we show that our dynamical system becomes them for the special case studied. Then, using dynamical system techniques, we will study new cases that can be constructed from our action. Similarly as in \(f(R,L_m)\) (see [43]), a power-law and a exponential kind of coupling between \(L_m\) and T is studied. Additionally, another new kind of couplings between the boundary term B and \(L_m\) are studied. For this theory, we study different power-law models with \(f(T,B,L_m)=C_1T+C_5B^{s}+(C_4+C_4 B^{q})L_m\). This model depends highly on the power-law parameters s and q. The critical points and their stability are then studied for different models. For the readers interested on dynamical systems in cosmology, see the review [46] and also see [47, 48] for further applications to dynamical systems in modified teleparallel models with the boundary term B.

The notation of this paper is the following: the natural units are used so that \(\kappa =1\) and the signature of the metric is \(\eta _{ab}=(+ \ 1,- \ 1,- \ 1,- \ 1)\). The tetrad and the inverse of the tetrad are labelled as \(e^{a}_{\mu }\) and \(E_a^{\mu }\) respectively where Latin and Greek indices represent tangent space and space-time coordinates respectively.

This paper is organized as follows: Sect. 2 is devoted to present a very brief review of teleparallel theories of gravity and some interesting modified theories than can be constructed from this approach. In Sect. 3 is presented the new generalised gravity-matter coupled theory of gravity known as \(f(T,B,L_m)\) where TB and \(L_m\) are the scalar torsion, the boundary term and the matter Lagrangian respectively. The corresponding field equations of the theory and the flat FLRW cosmological equations are also derived in this section. In Sect. 4 is presented the dynamical system of the full model and for some specific theories, the corresponding dynamical analysis of them is performed. Finally, Sect. 5 concludes the main results of this paper.

2 Teleparallel gravity and its modifications

Let us briefly introduce the teleparallel equivalent of general relativity (TEGR) and some important modifications under this theory. Basically, this theory is based on the idea of having a globally flat manifold (zero curvature) but with a non-trivial geometry for having a non-zero torsion tensor. Hence, the concept of paralellism is globally defined in TEGR. The dynamical variable of this theory is the tetrad which defines orthonormal vectors at each point of the manifold and they are directly related with the metric as follows

$$\begin{aligned} g_{\mu \nu } = \eta _{ab} e^a_{\mu } e^b_{\nu }, \end{aligned}$$
(1)

where \(\eta _{ab}\) is the Minkowski metric. The connection which defines a globally flat curvature with a non-vanishing torsion is the so-called Weitzenböck connection \(W_{\mu }{}^{a}{}_{\nu }\), which defines the torsion tensor as taking its anti-symmetric part, namely

$$\begin{aligned} T^{a}{}_{\mu \nu }&= W_{\mu }{}^{a}{}_{\nu } - W_{\nu }{}^{a}{}_{\mu } = \partial _{\mu } e_{\nu }^{a} - \partial _{\nu }e_{\mu }^{a} . \end{aligned}$$
(2)

Let us clarify here that the above definition is not the most general form of the torsion tensor. The most general definition also contains the spin-connection which needs to be pure gauge in order to fulfil the condition of teleparallelism (zero curvature). In this paper is assumed that the spin-connection is identically zero.

The TEGR action is defined with the so-called torsion scalar T as follows

$$\begin{aligned} S_{\mathrm{TEGR}} = \int e\,T \, d^4x+ S_{\mathrm{m}} , \end{aligned}$$
(3)

where \(e=\text {det}(e_{\mu }^{a})\) and \(S_{\mathrm{m}}\) is the matter action. The torsion scalar is defined as the contraction of the super-potential

$$\begin{aligned} S^{abc} = \frac{1}{4}(T^{abc}-T^{bac}-T^{cab})+\frac{1}{2}(\eta ^{ac}T^b-\eta ^{ab}T^c) \end{aligned}$$
(4)

with the torsion tensor as \(T=T_{abc}S^{abc}\). Here, \(T_{\mu }=T^{\lambda }{}_{\lambda \mu }\) is the so-called torsion vector. The definition of T comes directly from the condition of zero-curvature where one arrives that the Ricci scalar is directly linked with it via

$$\begin{aligned} R=-S^{abc}T_{abc}+\frac{2}{e}\partial _{\mu }(eT^{\mu })=-T+B , \end{aligned}$$
(5)

where B refers to the boundary term which connects the Ricci scalar with the torsion scalar. From (3) and the above relationship, one can directly notice that the TEGR is equivalent to the Einstein–Hilbert action up to a boundary term. Hence, TEGR is an alternative formulation of gravity which reproduces the same field equations as GR. Although, the geometrical interpretation of these theories are different. GR lies in a manifold with a non-zero curvature (in general) with a zero torsion tensor whereas TEGR is the opposite. Moreover, geodesic equations are replaced by forces equations in TEGR (see [18] for more details about this theory).

A straightforward generalisation of the action (3) is to replace T by an arbitrary function of f which depends on T, namely

$$\begin{aligned} S_{f(T)} = \int e\,f(T) \, d^4x+ S_{\mathrm{m}} . \end{aligned}$$
(6)

The former theory is the most popular modification of TEGR and it was firstly introduced in [20] with the aim to study inflation in cosmology. In some sense, this generalisation is analogous as the famous modification of GR, the so-called f(R) gravity, where instead of having R in the Einstein–Hilbert action, an arbitrary function of R is introduced in the action. The formulation described here for f(T) gravity where the spin-connection is identically zero is not invariant under Lorentz transformations. This is due to the fact that T itself is not invariant under local Lorentz transformations so f(T) gravity will also have this property [49, 50]. In standard TEGR where T is in the action, this problem is not important since the action only differs by a boundary term with respect to the Einstein–Hilbert action so one can say that this theory is quasi-invariant under local Lorentz transformation. The problem of the loose of the Lorentz invariant produces that two different tetrads could give rise different field equations so it depends on the frame used. For example, the flat FLRW in spherical coordinates give rise to different field equations as in Cartesian coordinates. At the level of the field equations, this problem can be alleviated by choosing “good tetrads” as it was introduced in [51]. In this approach, one needs to rotate the tetrad fields and fix it accordingly depending on the geometry studied. In [52], it was proposed a new approach of teleparallel theories of gravity where a non-zero spin-connection is assumed giving rise to a covariant version of f(T) gravity. Both approaches should arrive at the same field equations and since almost all the works based on f(T) gravity used the approach presented above, we will continue using this approach.

It is also possible to create other kind of modifications of teleparallel theories of gravity. A very interesting modification theory is given by the following action [35]

$$\begin{aligned} S_{f(T,B)} = \int e\,f(T,B) \, d^4x+ S_{\mathrm{m}} , \end{aligned}$$
(7)

where now the function also depends on the boundary term B. Under this theory, it is possible to recover either \(f(-T+B)=f(R)\) gravity or f(T) gravity. Moreover, the theory \(f(T,B)=C_1T+f_1(B)\) can also be obtained from this action. From this theory one can directly see how f(R) and f(T) are connected by this boundary term. Since \(R=-T+B\), only if a linear combination of R and T is assumed in the action (TEGR or GR), we will have equivalent theories at the level of the field equations. It is known that f(R) gravity is a 4th order theory whereas f(T) gravity is a 2nd order theory. Hence, f(TB) gravity is also a 4th order theory. f(T) and f(R) gravity have different field equation orders since the difference comes from integrating by parts twice the boundary term B.

3 \(f(T,B,L_m)\) gravity

3.1 General equations

Inspired by the theories described in [53] in the curvature approach and also from f(TB) gravity, let us now consider the following gravity model

$$\begin{aligned} S_{f(T,B,L_m)}=\int e f(T,B,L_m)\,d^{4}x , \end{aligned}$$
(8)

where the function f depends on the scalar curvature T, the boundary term B and the matter Lagrangian \(L_m\). The energy-momentum tensor of matter \(\mathcal {T}^{\beta }_{a}\) is defined as

$$\begin{aligned} \mathcal {T}^{\beta }_{a}=-\frac{1}{2e} \frac{\delta (eL_{m})}{\delta e^{a}_{\beta }} . \end{aligned}$$
(9)

Now, we will assume that the matter Lagrangian depends only on the components of the tetrad (or metric) and not on its derivatives, giving us

$$\begin{aligned} 2\mathcal {T}^{\beta }_{a}=-L_{m}E_{a}^{\beta }-\frac{\partial L_m}{\partial e_{\beta }^{a}} . \end{aligned}$$
(10)

Now, by a variation of action (8) with respect to the tetrad, we obtain

$$\begin{aligned} \delta S_{f(T,B,L_m)}= & {} \int \bigg [ef_{T}\delta T{+}ef_{B}\delta B{+}ef_{L}\frac{\delta L_m}{\delta e_{\beta }^{a}}\delta e_{\beta }^{a}{+}f \delta e\bigg ]d^{4}x ,\nonumber \\ \end{aligned}$$
(11)
$$\begin{aligned}= & {} \int e [f_{T}\delta T{+}f_{B}\delta B-f_{L} (2\mathcal {T}_{a}^{\beta }{+}L_{m}E_{a}^{\beta } )\delta e_{\beta }^{a}\nonumber \\&+\, fE_{a}^{\beta }\delta e_{\beta }^{a} ]d^{4}x , \end{aligned}$$
(12)

where we have used Eq. (10) and \(f_T=\partial f/\partial T,f_B=\partial f/\partial B\) and \(f_L=\partial f/\partial L_{m}\). Variations with respect to the torsion scalar and the boundary term are given by [35]

$$\begin{aligned} e f_{T} \delta T= & {} -4e\bigg [ \frac{1}{e}\partial _{\mu }( eS_{a}\,^{\mu \beta })f_{T}-f_{T}T^{\sigma }\,_{\mu a}S_{\sigma }\,^{\beta \mu }\nonumber \\&+\, (\partial _{\mu }f_{T})S_{a}\,^{\mu \beta } \bigg ]\delta e^{a}_{\beta } , \end{aligned}$$
(13)
$$\begin{aligned} ef_{B}\delta B= & {} e [2E_{a}^{\sigma }\nabla ^{\beta }\nabla _{\sigma }f_{B}-2E_{a}^{\beta }\Box f_{B}-Bf_{B}E_{a}^{\beta }\nonumber \\&-\, 4(\partial _{\mu }f_{B})S_{a}\,^{\mu \beta } ]\delta e_{\beta }^{a} , \end{aligned}$$
(14)

so that by imposing \(\delta S_{f(T,B,L_m)}=0\), we obtain the \(f(T,B,L_m)\) field equations given by

$$\begin{aligned}&2E_{a}^{\sigma }\nabla ^{\beta }\nabla _{\sigma }f_{B}-2E_{a}^{\beta }\Box f_{B}-Bf_{B}E_{a}^{\beta }\nonumber \\&\quad -\, 4 [(\partial _{\mu }f_{T}) +(\partial _{\mu }f_{B}) ]S_{a}\,^{\mu \beta }\nonumber \\&\quad -\, 4f_{T} (e^{-1}\partial _{\mu }(e S_{a}\,^{\mu \beta })-T^{\sigma }\,_{\mu a}S_{\sigma }\,^{\beta \mu } )\nonumber \\&\quad +\, f E_{a}^{\beta }-f_{L}L_{m}E_{a}^{\beta }=2 f_{L}\mathcal {T}_{a}^{\beta } . \end{aligned}$$
(15)

The above field equations can be also written only in space-time indices by contracting it by \(e^{a}_{\lambda }\) giving us

$$\begin{aligned}&2\nabla ^{\beta }\nabla _{\lambda }f_{B}-2\delta _{\lambda }^{\beta }\Box f_{B}-Bf_{B}\delta _{\lambda }^{\beta }\nonumber \\&\quad -\, 4 [(\partial _{\mu }f_{T}) +(\partial _{\mu }f_{B}) ]S_{\lambda }\,^{\mu \beta }\nonumber \\&\quad -\, 4f_{T}e^{a}_{\lambda } (e^{-1}\partial _{\mu }(e S_{a}\,^{\mu \beta })-T^{\sigma }\,_{\mu a}S_{\sigma }\,^{\beta \mu } )\nonumber \\&\quad +\, f \delta ^{\beta }_{\lambda }-f_{L}L_{m}\delta ^{\beta }_{\lambda } =2 f_{L}\mathcal {T}_{\lambda }^{\beta } . \end{aligned}$$
(16)

From these field equations, one can directly recover teleparallel gravity by choosing \(f(T,L_m)=T+L_m\) which gives us the same action as (3). Moreover if we choose \(f(T,L_m)=T+f_1(T)+ (1+\lambda f_2(T))L_m\) we recover the non-minimal torsion-matter coupling extension of f(T) gravity presented in [41]. Note that in our case, we have assumed that the matter Lagrangian does not depend on the derivatives of the tetrads, which according to [41] is equivalent as having

$$\begin{aligned} \frac{\partial L_m}{\partial (\partial _{\mu }e_{\rho }^a)}=0 . \end{aligned}$$
(17)

Let us now study the conservation equation for this theory. First, we will use that \(R^{\beta }_{\lambda }=G_{\lambda }^{\beta }+\frac{1}{2}(B-T)\delta _{\lambda }^{\beta } \), where \(G_{\lambda }^{\beta }\) is the Einstein tensor. Using this relationship, we can rewrite the field equation (16) as follows

$$\begin{aligned} H_{\lambda \beta }:= & {} f_T G_{\lambda \beta }+\nabla _{\lambda }\nabla _{\beta }f_{B}-g_{\lambda \beta }\square f_{B}\nonumber \\&-\frac{1}{2} (Tf_{T}+Bf_B+L_m f_L-f )g_{\lambda \beta }-2X_{\nu }S_{\lambda }{}^{\nu }{}_{\beta }\nonumber \\= & {} f_{L}\mathcal {T}_{\lambda \beta }, \end{aligned}$$
(18)

where for simplicity we have also introduced the quantity

$$\begin{aligned} X_{\nu }= & {} (f_{BT}+f_{BB}+f_{BT})\nabla _{\nu }B+(f_{TT}\nonumber \\&+f_{TB}+f_{TL})\nabla _{\nu }T+(f_{TL}+f_{BL}+f_{LL})\nabla _{\nu }L_{m} .\nonumber \\ \end{aligned}$$
(19)

By taking covariant derivative of \(H_{\lambda \beta }\) and after some simplifications, we find that

$$\begin{aligned} \nabla ^{\lambda }H_{\lambda \beta }= & {} 2S^{\sigma \rho }{}_{\lambda } K_{\beta \sigma \rho }X^{\lambda }-\frac{1}{2}g_{\lambda \beta } \nabla ^{\lambda }(L_mf_L)\nonumber \\= & {} -\frac{1}{2}g_{\lambda \beta }\nabla ^{\lambda }(L_mf_L) , \end{aligned}$$
(20)

where we have used the fact that the energy-momentum tensor is symmetric and hence \(S^{\sigma \rho }{}_{\lambda }K_{\beta \sigma \rho }X^{\lambda }=0\). The latter comes from the fact that field equations are symmetric, and hence the energy-momentum tensor is also symmetric. Now, we will find the condition that f needs to satisfy in order to have the standard conservation equation for the energy momentum tensor, i.e., \(\nabla _\mu \mathcal {T}^{\mu \nu }=0\). By taking covariant derivative in (18) and assuming \(\nabla _\mu \mathcal {T}^{\mu \nu }=0\), one gets that the standard conservation equation for the energy-momentum tensor is satisfied if the function f satisfy the following form

$$\begin{aligned} (2\mathcal {T}_{\mu \nu }+g_{\mu \nu }L_m )\nabla ^{\mu }f_L=-e^{a}_{\mu }g_{\beta \nu }\frac{\partial L_m}{\partial e^{a}_{\beta }}\nabla ^{\mu }f_L=0 , \end{aligned}$$
(21)

which matches with the conservation equation presented in [53]. Note that in our case, we have defined the energy-momentum tensor in a different way so that there is a minus sign of difference between Eq. (13) presented in [53] and the above equation. Thus, in general, \(f(T,B,L_m)\) is not covariantly conserved and depending on the metric, the model and the energy-momentum tensor, this theory may or may not be conserved. Hereafter, we will consider that the matter is described by a perfect fluid whose energy-momentum tensor is given by

$$\begin{aligned} \mathcal {T}_{\mu \nu }= & {} (\rho +p)u_{\mu }u_{\nu }-pg_{\mu \nu } . \end{aligned}$$
(22)

Here, \(\rho \) and p are the energy density and the pressure of the fluid respectively and \(u_{\mu }\) is the 4-velocity measured by a co-moving observer with the expansion so that it satisfies \(u_{\mu }u^{\mu }=1\). For a perfect fluid, if one assumes that in the proper frame where the particle is static, the matter Lagrangian is invariant under arbitrary rescaling of time coordinate [54]. Therefore, from (10), one gets \(T_{00}=\rho =-(1/2)L_m\) which is equivalent as having \(L_m=-2\rho \). This is a “natural choice” for a perfect fluid (see [41, 42, 54] for more details). Hence, from Eq. (21) we can directly conclude that the conservation law will be always satisfied when flat FLRW and a perfect fluid are chosen without depending on the model for the function \(f(T,B,L_m)\). This statement was also mentioned in [53], which is a special case of our theory, explicitly when \(f(T,B,L_m)=f(-T+B,L_m)=f(R,L_m)\).

3.2 Flat FLRW cosmology

In this section we will briefly find the corresponding modified flat FLRW cosmology of our theory. Consider a spatially flat FLRW cosmology whose metric is represented by

$$\begin{aligned} ds^2= & {} dt^2-a(t)^2(dx^2+dy^2+dz^2) , \end{aligned}$$
(23)

where a(t) is the scale factor of the universe. The tetrad corresponding to this space-time in Cartesian coordinates reads

$$\begin{aligned} e_{\beta }^{a}={\text {diag}}(1,a(t),a(t),a(t)) . \end{aligned}$$
(24)

For the space-time given by (23), the modified FLRW equations become

$$\begin{aligned}&3H^2 (3f_{B}+2 f_{T})-3 H \dot{f}_{B}+3 f_{B}\dot{H}+\frac{1}{2} f=0 , \end{aligned}$$
(25)
$$\begin{aligned}&(3 f_{B}+2f_{T}) (3H^2+\dot{H})+2 H \dot{f}_{T}-\ddot{f}_{B}\nonumber \\&\quad +\, \frac{1}{2} f=-f_{L} (p+\rho ) , \end{aligned}$$
(26)

where \(H=\dot{a}/a\) is the Hubble parameter and dots represent derivation with respect to the cosmic time. Note that the terms \(\dot{f}_{B}=f_{BB}\dot{B}+f_{BT}\dot{T}+f_{BL}\dot{L}_m\) and \(\dot{f}_{T}=f_{BT}\dot{B}+f_{TT}\dot{T}+f_{TL}\dot{L}_m\). It is clear that when \(f(T,B,L_m)=T+L_m=T-2\rho \), one recovers standard TEGR (or GR) plus matter. The energy density of matter does not appear in (25) explicitly since it is implicitly considered in the term f / 2. When \(f(T,B,L_m)=f(-T+B,L_m)=f(R,L_m)\), the above equations are the same as the ones reported in [43]. Note that in the latter paper, the authors used another signature notation \(\eta _{ab}=(-+++)\), so that one needs to change \(R\rightarrow -R\) to match those equations.

As a consequence of the conservation law holds when considering a perfect fluid as a matter content of the universe, we also know that the standard continuity equation is valid in our case. Hence, we have that the fluid satisfies

$$\begin{aligned} \dot{\rho }+3H(\rho +p)=0 . \end{aligned}$$
(27)

Let us now assume a barotropic equation of state \(p=w \rho \), so that we can directly find that the energy density of the fluid behaves as

$$\begin{aligned} \rho (t)= & {} \rho _0 a(t)^{-3(1+w)} , \end{aligned}$$
(28)

where \(\rho _0\) is an integration constant. It is also useful to note that the scalar torsion and the boundary term in this space-time satisfy the relationship (5), namely

$$\begin{aligned}&T\,{=}\,-6H^2\,,\quad B\,{=}\,-6 (\dot{H}\,{+}\,3 H^2)\,, \nonumber \\&\quad \rightarrow R\,{=}\,-T\,{+}\,B\,{=}\,-6 (\dot{H}\,{+}\,2 H^2)\,. \end{aligned}$$
(29)

4 Dynamical systems

4.1 Dynamical system for the full theory

In this section we will explore the dynamical system of different theories of gravity coupled with matter. To do this, we will first study the dynamical system of the general modified FLRW by using the conservation equation given by (27) and also the first modified FLRW equation (25). By replacing the boundary term given by Eq. (29) in (25) and expanding the derivatives of f we get

$$\begin{aligned}&6H^2f_{T}-3H (f_{BB}\dot{B}+f_{BT}\dot{T}+6H(1+w)\rho f_{BL} )\nonumber \\&\quad -\frac{1}{2}Bf_{B}+\frac{1}{2}f=0 , \end{aligned}$$
(30)

where we have used the conservation equation (27) to replace \(\dot{L}_{m}=-2\dot{\rho }=6H\rho (1+w)\). Let us now introduce the following dimensionless variables

$$\begin{aligned} x_1= & {} \frac{\dot{T} f_{TB}}{2 H f_{T}} ,\quad x_2=\frac{\dot{B} f_{BB}}{2 H f_{T}} ,\quad x_3=\frac{\dot{B}f_{BT}}{2Hf_{T}} ,\nonumber \\ x_{4}= & {} \frac{\dot{T} f_{TT}}{2 H f_{T}} ,\quad y_1=\frac{B f_{B}}{12 H^2 f_{T}} ,\quad y_2=\frac{Tf_B}{12 H^2 f_{T}}=-\frac{f_B}{2 f_{T}} ,\nonumber \\ \end{aligned}$$
(31)
$$\begin{aligned} z= & {} -\frac{f}{12 f_{T} H^2} ,\quad \phi =\frac{3 (w+1) \rho f_{BL}}{f_{T}} , \nonumber \\ \alpha= & {} \frac{3 (w+1) \rho f_{TL}}{f_{T}} ,\quad \theta =\frac{(w+1) \rho f_{L}}{2 f_{T}H^2} . \end{aligned}$$
(32)

These dimensionless variables were chosen with the aim of having a similar variables as the ones presented in [43]. Further, using these variables will help us to compare both theories in the limit case where \(f(T,B,L_m)= f(-T+B,L_m)=f(R,L_m)\). Using these variables, the Friedmann constraint given by (30) becomes

$$\begin{aligned} x_1+x_2+y_1+z+\phi =1 . \end{aligned}$$
(33)

Moreover, using the dimensionless variables, we can find the following useful relations

$$\begin{aligned} \frac{\dot{f}_{T}}{2 Hf_{T}}= & {} x_3+x_4+\alpha , \end{aligned}$$
(34)
$$\begin{aligned} \frac{\dot{f}_{B}}{2Hf_{T}}= & {} x_1+x_2+\phi ,\end{aligned}$$
(35)
$$\begin{aligned} \frac{\ddot{f}_{B}}{2 H^2f_{T}}= & {} (x_1+x_2+\phi ) \bigg [\frac{y_1}{y_2}-3+2 (\alpha +x_3+x_4)\bigg ]\nonumber \\&+\frac{dx_1}{dN}+\frac{dx_2}{dN}+\frac{d\phi }{dN} ,\end{aligned}$$
(36)
$$\begin{aligned} \frac{\dot{H}}{H^2}= & {} \frac{y_1}{y_2}-3 , \end{aligned}$$
(37)

where we have defined \(N=\ln a\) as the number of e-folding so that \(d/dt=H d/dN\). The effective state matter and the deceleration parameter can be written in terms of these dimensionless parameters as follows

$$\begin{aligned} w_{\mathrm{eff}}= & {} \frac{p_{\mathrm{total}}}{\rho _{\mathrm{total}}}=-\bigg (\frac{2\dot{H}}{3H^2}+1\bigg )=1-\frac{2}{3}\frac{ y_1}{ y_2} , \end{aligned}$$
(38)
$$\begin{aligned} \tilde{q}= & {} -\frac{\dot{H}}{H^2}-1=2-\frac{y_1}{y_2} . \end{aligned}$$
(39)

For acceleration universes, one needs that \(\tilde{q}<0\) or equivalently \(w_{\mathrm{eff}}<-1/3\).

By replacing the identities (34)–(37) and the dimensionless variables defined as (32) into the second modified Friedmann equation (26), we get

$$\begin{aligned}&\frac{dx_1}{dN}+\frac{dx_2}{dN}+\frac{d\phi }{dN}\nonumber \\&\quad =-(x_1+x_2+\phi ) \left( 2( \alpha +x_3+x_4)+\frac{y_1}{y_2}-3\right) \nonumber \\&\qquad +\, 2(\alpha +x_3+x_4)+\frac{y_1}{y_2}+3 y_1-3 z+\theta . \end{aligned}$$
(40)

The conservation equation (27) can be also written in terms of the dimensionless variables, which yields

$$\begin{aligned} \frac{d\phi }{dN}= & {} \phi [ 3 (w+1) (2 \beta _{BLL}-1)+2x_3(\beta _{BBL}-1)\nonumber \\&+\,2x_4( \beta _{TBL}-1)-2 \alpha ] , \end{aligned}$$
(41)

where we have defined

$$\begin{aligned} \beta _{LL}= & {} \frac{\rho f_{LL}}{f_{L}} ,\quad \beta _{BLL}=\frac{\rho f_{BLL}}{f_{BL}} ,\nonumber \\ \beta _{BBL}= & {} \frac{f_{T}f_{BBL}}{f_{BL}f_{TB}} ,\quad \beta _{TBL}=\frac{f_{T}f_{TBL}}{f_{BL}f_{TT}} , \end{aligned}$$
(42)
$$\begin{aligned} \beta _{TLL}= & {} \frac{f_{T}f_{TLL}}{f_{BL}^2} ,\quad \beta _{TTL}= \frac{f_{T}f_{TTL}}{f_{BL}f_{TB}} , \nonumber \\ \alpha _{TB}= & {} \frac{Bf_{TB}}{2f_{T}} ,\quad \alpha _{TTT}=\frac{f_{T}f_{TTT}}{f_{TT}^2} ,\end{aligned}$$
(43)
$$\begin{aligned} \alpha _{BBB}= & {} \frac{f_{T}f_{BBB}}{f_{BB}f_{TB}} ,\quad \alpha _{TTB}= \frac{f_{T}f_{TTB}}{f_{TB}^2} ,\nonumber \\ \alpha _{TBB}= & {} \frac{f_{T}f_{TBB}}{f_{TB}^2} ,\quad \alpha _{TBL}= \frac{f_{T}f_{TBL}}{f_{BL}f_{TB}} . \end{aligned}$$
(44)

The other quantities defined above will be useful in the full dynamical system equations. Using the dimensionless variables, the identities mentioned before and the above definitions, one can find the dynamical system. This procedure is very involved since the dynamical system is a ten dimensional one. After all of those computations, the system can be summarized with the following equations:

$$\begin{aligned} \frac{dx_1}{dN}= & {} 2 (\alpha _{TTB} x_{1}^2+\alpha _{TBB} x_{1} x_{3}+x_{3} )+y_{1} \left( \frac{4 \alpha _{TB}}{y_{2}}-\frac{2 x_{1}}{y_{2}}\right) \nonumber \\&-\,4 \alpha _{TB} (\alpha +x_{3}+x_{4}+6)+\frac{12 \alpha _{TB} y_{2} (\alpha +x_{3}+x_{4}+3)}{y_{1}}\nonumber \\&+\,2 \beta _{TBL} x_{4} \phi , \end{aligned}$$
(45)
$$\begin{aligned}&\frac{dx_2}{dN}=\theta +\phi \left( 3 (w+2)-6 (w+1) \beta _{BLL}-2 \beta _{BBL} x_{3}\right. \nonumber \\&\left. \quad -\, 4 \beta _{TBL} x_{4}-\frac{y_{1}}{y_{2}}\right) \nonumber \\&\quad -\, 2\alpha _{TTB} x_{1}^2+\alpha (4 \alpha _{TB}-2 x_{1}-2 x_{2}+2)\nonumber \\&\quad +\, y_{1} \left( \frac{x_{1}}{y_{2}}-\frac{x_{2}}{y_{2}}-\frac{4 \alpha _{TB}}{y_{2}}+\frac{1}{y_{2}}-3\right) \nonumber \\&\quad +\, x_{1} (-2 (\alpha _{TBB}+1) x_{3}-2 x_{4}+3)+x_{2} (-2 x_{3}-2 x_{4}+3)\nonumber \\&\quad +\, 4 \alpha _{TB} (x_{3}+x_{4}+6){-}\frac{12\alpha _{TB}y_2 (\alpha +x_3+x_4+3)}{y_1}{+}2 x_{4}-3 z ,\nonumber \\ \end{aligned}$$
(46)
$$\begin{aligned}&\frac{dx_3}{dN}=-\frac{x_3}{x_2} \bigg [-2 \alpha -\theta +6 (w+1) \beta _{BLL} \phi -3 (w+2) \phi \nonumber \\&\quad +\,2 \alpha _{TTB} x_{1}^2-\frac{2 \alpha _{TBB} x_{1}^2 y_{1} \left( y_{1} \left( \frac{x_{1}}{\alpha _{TB}}-2\right) +y_{2} \left( 6-\frac{x_{3}}{\alpha _{TB}}\right) \right) }{y_{2} (y_{1}-3 y_{2})}\nonumber \\&\quad +\,4 \beta _{BBL} x_{3} \phi -2 x_{3}+4 \beta _{TBL} x_{4} \phi -2 x_{4}\nonumber \\&\quad +\,\frac{y_{1} (3 y_{2}+\phi -1)}{y_{2}}+3 z\bigg ]\nonumber \\&\quad +\,\frac{x_{1} x_{3} (x_{1} y_{1}^2-x_{3} y_{1} y_{2}-3 \alpha _{TB} (y_{1}-3 y_{2})^2 )}{\alpha _{TB} x_{2} y_{2} (y_{1}-3 y_{2})}\nonumber \\&\quad +\,2 \alpha _{TTB} x_{1} x_{3}-\frac{2 \alpha _{BBB} x_{3} (-x_{1} y_{1}+x_{3} y_{2}+2 \alpha _{TB} (y_{1}-3 y_{2}))}{y_{2}}\nonumber \\&\quad -\,2 \alpha x_{3}+2 (\alpha _{TBB}-1) x_{3}^2\nonumber \\&\quad +\,2 \alpha _{TBL} x_{3} \phi -2 x_{3} x_{4}-\frac{x_{3} y_{1}}{y_{2}}+3 x_{3} , \end{aligned}$$
(47)
$$\begin{aligned}&\frac{dx_4}{dN}=2 \beta _{TTL}x_{1} \phi +2 \alpha _{TTB} x_{1} x_{3}\nonumber \\&\quad +\,x_{4} \left( \frac{y_{1} (x_{3} y_{2}-x_{1} y_{1})}{\alpha _{TB} y_{2} (y_{1}-3 y_{2})}-2 x_{3}+\frac{2 y_{1}}{y_{2}}-6\right) \nonumber \\&\quad -\,2 \alpha x_{4}+2 (\alpha _{TTT}-1) x_{4}^2 , \end{aligned}$$
(48)
$$\begin{aligned}&\frac{dy_1}{dN}{=}-\frac{y_1 (x_1+x_2+2 y_1{+}\phi )}{y_2}-2 y_1 (\alpha +x_3{+}x_4-3)+\frac{x_{3} y_{1}}{\alpha _{TB}} ,\nonumber \\ \end{aligned}$$
(49)
$$\begin{aligned}&\quad \frac{dy_2}{dN}=\frac{x_{1} y_{1}}{\alpha _{TB}}-x_{1}-x_{2}-2 (y_{2} (\alpha +x_{3}+x_{4}-3)+y_{1})-\phi ,\nonumber \\\end{aligned}$$
(50)
$$\begin{aligned}&\frac{dz}{dN}=-\theta +\frac{x_{1} y_{1}}{2 \alpha _{TB} y_{2}}-2 z (\alpha +x_3+x_4-3)-\frac{2 y_1 z}{y_2}-\frac{x_{3} y_{1}}{\alpha _{TB}} ,\nonumber \\ \end{aligned}$$
(51)
$$\begin{aligned}&\frac{d\phi }{dN}=\phi [3 (w+1) (2 \beta _{BLL}-1)+2 (\beta _{BBL}-1) x_{3}\nonumber \\&\qquad \quad +\, 2 (\beta _{TBL}-1) x_{4}-2 \alpha ] ,\end{aligned}$$
(52)
$$\begin{aligned}&\frac{d\alpha }{dN}=2 \beta _{TLL}\phi ^2-\alpha (2 \alpha +2 x_{3}+2 x_{4}+3 w+3)\nonumber \\&\qquad \quad +\, 2 \beta _{TTL}x_{1} \phi +\frac{2 \beta _{TBL} x_{3} x_{4} \phi }{x_{1}} ,\end{aligned}$$
(53)
$$\begin{aligned}&\frac{d\theta }{dN}=-\theta \left( 3 (w-1)-6 (w+1) \beta _{LL}+2 x_{3}+2 x_{4}+\frac{2 y_{1}}{y_{2}}\right) \nonumber \\&\qquad \quad -\, \frac{x_{3} y_{1} \phi }{\alpha _{TB} y_{2}}-2 \alpha \left( \theta +\frac{y_{1}}{y_{2}}-3\right) . \end{aligned}$$
(54)

Additionally, one can use the Friedmann constraint (33) to reduce the above system to a nine-dimensional one. In the following sections we will explore the dynamical system of different kind of matter coupled theories of gravity which can be obtained from our approach.

4.2 Specific model: \(f(T,B,L_m)=\tilde{f}(-T+B,L_m)=\tilde{f}(R,L_m)\) gravity

From our action it is possible to recover a very interesting model which comes from the curvature approach. As we discussed before, this is possible due to the fact that the function also depends on the boundary term B so that it is always possible to reconstruct theories which contains the scalar curvature R. In this sense, one can construct a non-minimally coupled theory between the Lagrangian matter and the scalar curvature, explicitly by taking the function being

$$\begin{aligned} f(T,B,L_m)=\tilde{f}(-T+B,L_m)=\tilde{f}(R,L_m) . \end{aligned}$$
(55)

This kind of models was first proposed in [53] where the authors suggested that in general, this theory has some extra terms in the geodesic equation. The complete analysis of the dynamical system for flat FLRW for this model was studied in [43]. From our full dynamical system, it is possible to recover the same dynamical system equations reported in the former paper. Let us recall here again that in general, the signature of the metric for curvature theories as f(R) gravity is usually taken as the opposite as in teleparallel theories of gravity and hence the paper [43] is written in another signature notation compared to our notation. The important of this notation issue is that the scalar curvature, scalar torsion and also the boundary term will have a minus sign of difference with respect to our case. Hence, in their notation Eqs. (45)–(54) will have a minus of difference in all those quantities. Therefore, to recover the same dynamical systems found in [43] we need to change \(R\rightarrow -R\) (and of course \(T\rightarrow -T\) and \(B\rightarrow -B\)) which makes that the important derivatives appearing in the dimensionless variables become

$$\begin{aligned} f_{B}=-f_{R} ,\quad f_{T}=f_{R} ,\quad f_{BB}=f_{TT}=-f_{TB}=f_{RR}.\nonumber \\ \end{aligned}$$
(56)

In this case, some dimensionless variables can be reduced. It is possible to connect our dimensionless variables to the dimensionless variables used in the mentioned paper by working with the variables

$$\begin{aligned}&y=2 y_1-1\,,\quad y_2=\frac{1}{2}\,,\quad x=2(x_1+x_2)=-2(x_3+x_4)\,,\nonumber \\&\quad \tilde{z}=2z\,,\quad \tilde{\phi }=2\phi =-2\alpha \,,\quad \tilde{\theta }=2\theta \,, \end{aligned}$$
(57)

where tildes represent the variables chosen in [43]. By replacing (56) and (32) in our dynamical system we directly find that the corresponding dynamical system becomes a five-dimensional one explicitly given by

$$\begin{aligned} \frac{dx}{dN}= & {} x [x-y+\tilde{\phi } (1+\beta _{BBL} ) ] -1 -y -3\tilde{z} + \tilde{\theta } \nonumber \\&+ \ \tilde{\phi }\left[ 3(1+w) (2\beta _{BLL}+1 )-y\right] , \end{aligned}$$
(58)
$$\begin{aligned} \frac{dy}{dN}= & {} -\frac{x}{2 \alpha _{TB}}-y \left( \frac{x}{2 \alpha _{TB}}+2 y-4\right) , \end{aligned}$$
(59)
$$\begin{aligned} d\tilde{z} \over dN= & {} \tilde{z}(x+\tilde{\phi }+2(2-y))-\tilde{\theta }-\frac{x}{2\alpha _{TB}}(1+y)\,, \end{aligned}$$
(60)
$$\begin{aligned} \frac{d\tilde{\phi }}{dN}= & {} \tilde{\phi } [x (1-\beta _{BBL} )- 3(1+w) (2\beta _{BLL}+1 )+\tilde{\phi } ] ,\nonumber \\ \end{aligned}$$
(61)
$$\begin{aligned} d\tilde{\theta } \over dN= & {} \tilde{\theta } \left( (6 (w+1) \beta _{LL}+x-2 y-3 w+1)+\tilde{\phi }\right) \nonumber \\&+\frac{x (y+1) \tilde{\phi }}{2 \alpha _{TB}} . \end{aligned}$$
(62)

The above equations are the same reported in [43] for \(f(R,L_m)\) gravity if one changes the variables \(\beta _{BBL},\beta _{BLL},\alpha _{TB}\) and \(\beta _{LL}\) accordingly. In this theory, it is possible to reconstruct different interesting gravity-matter coupled models as for example standard non-minimally curvature-matter coupled models where \(f(R,L_m)=f_1(R)+f_2(R)L_m\) which has been studied in the literature (see [39]). In [44], it was studied the dynamical system for some of those models. To find all the most important details regarding the above dynamical system for the former model and also for other more general models in \(f(R,L_m)\) gravity, see [43].

4.3 Specific model: \(f(T,B,L_m)=\tilde{f}(T,L_m)\) gravity

Let us now introduce a new theory of gravity based on an arbitrary function f which depends on T and \(L_m\) only. As f(T) was motivated by f(R) gravity, \(f(T,L_m)\) gravity is somehow, the teleparallel version of \(f(R,L_m)\) discussed in the previous section. Different particular cases of this theory have been studied in the past. Let us first derive the full dynamical system for the \(f(T,L_m)\) gravity and then study some particular theories. The Friedmann equation (33) for this model reads

$$\begin{aligned} z=1 . \end{aligned}$$
(63)

In this case, \(y_1=y_2=x_{1}=x_{2}=x_{3}=\phi \equiv 0\), so one needs to be very careful with the general dynamical system (45)–(54) since some of these equation will be also identically zero. Let us clarify here the way that one needs to proceed to find the correct dynamical system. There are two ways to find out the correct dynamical system for an specific model. Let us discuss how to proceed with the model that we are interested here, i.e., where \(f=f(T,L_m)\). The first way to proceed is using the full dynamical system described by (45)–(54). If one directly replaces \(f=f(T,L_m)\) in the full dynamical system, there will be some expressions that are indeterminate or directly zero, for example terms like \(y_1/y_2\) or terms divided by \(x_2\). Hence, one first needs to replace back all the original definitions of the dimensionless variables and after doing that, one can restrict \(f=f(T,L_m)\). By doing that, several equations are directly satisfied. Indeed, one can verify that Eqs. (45), (47), (49), (50) and (52) are identically zero, as expected. Then, for all the remaining equations, one needs to introduce again the dimensionless variables needed (in this case \(x_4, \alpha \) and \(\theta \)). A second approach is to directly assume \(f=f(T,L_m)\) in the Friedmann equations (30)–(26) and then introduce the same dimensionless variables that we defined. By doing that, we arrive of course at the same dynamical system as the first approach. We will implement the first procedure in this work. Eq. (46) gives us a constraint for the variables, namely

$$\begin{aligned} \frac{y_1}{y_2}= -2 \alpha -\theta -2 x_4+3 z . \end{aligned}$$
(64)

Let us here clarify again that even though \(y_1=y_2\equiv 0\), the quotient \(y=y_1/y_2=B/T=3+\dot{H}/H^2\) is clearly non-zero. If we replace the above equation and also use the Friedmann constraint (63), the remaining three Eqs. (48), (53) and (54) gives us the following set of equations,

$$\begin{aligned} \frac{dx_4}{dN}= & {} -\frac{1}{2 \alpha +\theta } [2 \alpha \tilde{\beta }_{TTL} (2 \alpha +\theta )^2\nonumber \\&+\, x_{4} (4 \alpha ^2 (6 \tilde{\beta }_{TTL}-\tilde{\beta }_{TLL}+3) \nonumber \\&+\, 6 \alpha (2 \tilde{\beta }_{TTL} \theta {+}\theta +w+1){-}3 (w+1) (2 \gamma _{LL}-1) \theta )\nonumber \\&+\, x_{4}^2 (-4 \alpha (\alpha _{TTT}-4 \tilde{\beta }_{TTL}-6)-2 (\alpha _{TTT}-4) \theta )\nonumber \\&-\, 4 (\alpha _{TTT}-3) x_{4}^3 ] , \end{aligned}$$
(65)
$$\begin{aligned} \frac{d\alpha }{dN}= & {} \alpha [2 \alpha (\tilde{\beta }_{TLL}-2 \tilde{\beta }_{TTL}-1)-2 \tilde{\beta }_{TTL} \theta \nonumber \\&-\, 2 (2\tilde{\beta }_{TTL}+1) x_{4}-3 w-3 ] , \end{aligned}$$
(66)
$$\begin{aligned} \frac{d\theta }{dN}= & {} 4 \alpha \theta +4 \alpha ^2+\theta (2 \theta +6 (w+1) \gamma _{LL}-3 w-3)\nonumber \\&+\, 2 x_{4} (2 \alpha +\theta ) , \end{aligned}$$
(67)

where for convenience we have introduced the following quantities

$$\begin{aligned} \tilde{\beta }_{TLL}=\frac{f_{BL}^2}{f_{TL}^2}\beta _{TLL}= \frac{f_{T}f_{TLL}}{f_{TL}^2} ,\quad \tilde{\beta }_{TTL}= \frac{T f_{TTL}}{f_{TL}} . \end{aligned}$$
(68)

In the following section we will study some interesting cases that can be constructed from this theory.

4.3.1 Nonminimal torsion-matter coupling \(f(T,L_m)=f_1(T)+f_2(T)L_m\)

In this section we assume that the function takes the following form,

$$\begin{aligned} f(T,L_m)=f_1(T)+f_2(T)L_m , \end{aligned}$$
(69)

where \(f_1(T)\) and \(f_2(T)\) are arbitrary functions of the torsion scalar. This model is an extension of f(T) gravity, where an additional nonminimal coupling between the torsion and the matter Lagrangian is considered [41]. In this model we have that \(\gamma _{LL}=\tilde{\beta }_{TLL}\equiv 0\). In [45], the dynamical system of this model was carefully studied. The authors used other dimensionless variables but one can verify that our dynamical system (65)–(67) give rise to the the same dynamics. In that paper, the authors used a different energy density which is related to our as \(\rho _{\mathrm{new}}=-2\rho \). The dimensionless variables used in [45] are given by

$$\begin{aligned} Y=\frac{f_{2}(T)}{12H^2 f_{2}'(T)} ,\quad X=\frac{f_{1}(T)}{12H^2 f_{1}'(T)} , \quad \Omega =-\frac{\rho }{3 H^2} .\nonumber \\ \end{aligned}$$
(70)

It is possible to show that our variables are related to them as follows

$$\begin{aligned} Y=\frac{\theta }{2 \alpha } , \quad X=\frac{\theta -3 (w+1)}{2 \alpha +3 (w+1)} , \end{aligned}$$
(71)

which gives us the following set of equations,

$$\begin{aligned} \frac{dX}{dN}= & {} -\frac{3 (w+1) Q (X+1) (Y+1) (2 (W+1) X+1)}{P (X+1)-Q (2 W (Y+1)-X+Y)} , \nonumber \\ \end{aligned}$$
(72)
$$\begin{aligned} \frac{dY}{dN}= & {} -\frac{3 (w+1) (X+1) (Y+1) (P Y+2 Q Y+Q)}{P (X+1)-Q (2 W (Y+1)-X+Y)} ,\nonumber \\ \end{aligned}$$
(73)
$$\begin{aligned} X= & {} -\, 1-2\Omega Q (Y+1) , \end{aligned}$$
(74)

where

$$\begin{aligned} P=-\frac{T^2f_2''(T)}{f_1'(T)} ,\quad Q=-\frac{Tf_2'(T)}{2f_1'(T)} , \quad W=\frac{Tf_1''(T)}{f_1'(T)} .\nonumber \\ \end{aligned}$$
(75)

It can be shown that the Eqs. (72)–(74) are equivalent to our equations (65)–(67) if the corresponding (71) is used properly. This for sure is a good consistency check that our equations are correct. The full study of the dynamical system (72)–(74) was carried out in [45] where 6 different kind of functions \(f_1(T)\) and \(f_2(T)\) were assumed. For some of those models, they found some critical points representing accelerating or decelerating solutions and also scaling solutions. For more details about all of this models and their dynamical analysis, see [45].

4.3.2 Exponential couplings for \(f(T,L_m)\) gravity

Now, let us study a new model where the function takes the following form

$$\begin{aligned} f(T,L_m)=-\Lambda \exp \bigg [-\frac{1}{\Lambda } (T+L_m )\bigg ] , \end{aligned}$$
(76)

where \(\Lambda \) is a positive cosmological constant. Let us take a look at this model further. In the limit where the argument is much less than one (\(\frac{1}{\Lambda }(T+L_m)\ll 1\)), if one expands up to first order in the argument, the function becomes

$$\begin{aligned} f(T,L_m)\approx -\Lambda + T+L_m+\cdots , \end{aligned}$$
(77)

hence in that limit, one recovers the TEGR plus matter case with a cosmological constant. Therefore, the function (76) is an interesting model to take into account. An analogous model was proposed in [53], where instead of having T, the authors considered the scalar curvature R. The dynamical system of the former model was investigated in full detail in [43].

Under this theory, we directly find that \(\tilde{\beta }_{TLL}=\alpha _{TTT}=1\) and by manipulating the definitions of the other quantities, \(\beta _{LL}\) and \(\tilde{\beta }_{TTL}\) can be written as

$$\begin{aligned} \beta _{LL}=\frac{\alpha }{3(1+w)} ,\quad \tilde{\beta }_{TTL}=-\frac{\alpha }{\theta } . \end{aligned}$$
(78)

From the Friedmann constraint (63), \(L_m=-2\rho \) and by using Eqs. (28) and (29) we directly find that for this model, the universe is always expanding as a De-Sitter one with a scalar factor being equal to

$$\begin{aligned} a(t)\propto e^{\pm \frac{t}{2}\sqrt{\frac{\Lambda }{3}}} . \end{aligned}$$
(79)

It is interesting to see that actually this model is very different to its analogous in \(f(R,L_m)\). In the model \(f(R,L_m)=-\Lambda \exp [-(R+L_m)/\Lambda ]\), it is not possible to directly find an unique scale factor which rules out the whole dynamic for the model. Hence, in that case, the dynamical system technique is very useful to check how the dynamics evolves on time. In our case, since the dynamics is always the same (described by the above equation) it is not important to study its dynamical properties since the solution is the standard De-Sitter universe. Therefore, the model described by an exponential coupling between \(L_m\) and T as it is given by (76) mimics a De-Sitter universe.

4.3.3 Power-law couplings \(f(T,L_m)\) gravity

Let us consider another interesting new model that one can consider from our approach where the function takes the following form

$$\begin{aligned} f(T,L_m)=M^{-\epsilon }( T+L_m)^{1+\epsilon } , \end{aligned}$$
(80)

where \(\epsilon \) is a constant and M is another constant which represents a mass characteristic scale. In this case, up to first order in \(\epsilon \), the expansion of the above function becomes

$$\begin{aligned} f(T,L_m)\approx T+L_m+\epsilon (T+L_m) \log \bigg [\frac{T+ L_m}{M}\bigg ] , \end{aligned}$$
(81)

so that since \(\epsilon \) is assumed to be very small (comparable with T and \(L_m\)), the above model could represents a small deviation of the standard TEGR plus matter case. For this model we find that

$$\begin{aligned} \tilde{\beta }_{TLL}= & {} \alpha _{TTT}=1-\epsilon ^{-1} ,\quad \tilde{\beta }_{TTL}=-\frac{(\epsilon -1) \alpha }{\epsilon \theta } ,\nonumber \\ \beta _{LL}= & {} \frac{\alpha }{3(1+w)} . \end{aligned}$$
(82)

Similarly as we did in the previous section, from the Friedmann constraint (63), by replacing \(L_m=-2\rho \) and by using Eqs. (28) and (29) we find the following equation for the scale factor,

$$\begin{aligned} (\rho _0+3a^{3 w+1} \dot{a}^2 )^{\epsilon } (\rho _0-3 (2 \epsilon +1) a^{3 w+1} \dot{a}^2 )= & {} 0 , \end{aligned}$$
(83)

which gives us two different types of scale factors. One can directly check that if \(\epsilon =0\), the above equation is reduced to the standard TEGR plus matter case, namely \(3H^2=\rho \). For the specific case where \(\epsilon =-1/2\), we must need \(\rho =0\), so that this special case is not a reliable model. There is no point on going further with the dynamical system of this model since the equation can be directly solved for the scale factor. The above equation depends on the power-law parameter \(\epsilon \). For negatives values of \(\epsilon \), the only possibility is that the second bracket is zero whereas for positives values of \(\epsilon \), there will be two kind of possible scale factor. This is again different as the case \(f(R)=M^{-\epsilon }(R+L_m)^{-\epsilon +1}\) studied in [43]. Our model seems to be simpler than the former one due to the fact that T only contains derivatives of a(t) and not second derivatives as R.

Let us know explore what kind of solutions we have from our power-law model. The first type can be obtained by assuming that the first bracket is zero, which is only valid for \(\epsilon >0\) giving us the following scale factor,

$$\begin{aligned} a_{\pm }(t)= & {} \left( \frac{3}{4}\right) ^{\frac{1}{3 w+3}} \left( \pm i\sqrt{\rho _0} t (w+1)\right) ^{\frac{2}{3 (w+1)}} , \quad \text {where} \ \epsilon >0 ,\nonumber \\ \end{aligned}$$
(84)

where for simplicity we have chosen that the integration constant is zero. Let us clarify here that this scale factor will rule out the dynamic only for \(\epsilon >0\). The scale factor must be real and positive so we must ensure that the imaginary term disappears. This is possible for some values of w. If one assumes that \(w>-1\), for the solution \(a_{+}(t)\), the state parameter must satisfy \(w_{+}=\frac{1}{6 k}-1\) for any positive integer number k whereas for the solution \(a_{-}\), the state parameter must be \(w_{-}=\frac{11}{6 k}-1\) to ensure a positive real value of \(a_{\pm }(t)\). Moreover, for these two solutions, \(\dot{a}_{\pm }>0\) and \(\ddot{a}_{\pm }>0\) for both \(w_{\pm }\), so this solution could describe an accelerating expanding universe for those specific values of \(w_{\pm }\). However, only the solution \(a_{-}\) with \(w_{-}=11/6\approx 1.8\) represents power-law expanding accelerating universes without evoking exotic matter.

Additionally, Eq. (83) can be solved by letting the second bracket equal to zero, which is valid for all \(\epsilon \ne -1/2\), yielding

$$\begin{aligned} a(t)= \left( \frac{3 \rho _0}{4 (2 \epsilon +1)}\right) ^{\frac{1}{3 (w+1)}}t^{\frac{2}{3 (w+1)}} , \end{aligned}$$
(85)

where again for simplicity we have assumed that the integration constant is zero. This solution is very similar to (84) but now the parameter \(\epsilon \) plays a role in the dynamics of the universe. Let us again consider the case where \(w>-1\) for studying this solution. For \(\epsilon >-1/2\), the scale factor and its derivatives are always positive so that the scale factor will mimic a power-law accelerating universe. For \(\epsilon <-1/2\), we need to impose that

$$\begin{aligned} w=-1+\frac{1}{6k} , \quad \text {where } \ k\in \mathbb {Z}^{+} , \end{aligned}$$
(86)

otherwise the scale factor would be negative. Moreover, all the derivatives of the scale factor would be also positive if w satisfy the above condition .Hence, only special cases of w will give rise to viable models when \(\epsilon <-1/2\). Further, all those models are in the regime \(-1<w<0\) which represents exotic kind of matter. Thus, cases with \(\epsilon <-1/2\) needs exotic matter to represent accelerating expanding universes. Additionally, we can conclude that for \(\epsilon >1/2\), the power-law \(f(T,L_m)\) will mimic power-law accelerating universes without evoking exotic matter.

4.4 Specific model: \(C_1 T+f(B,L_m)\) gravity

In this section we will study the case where the function takes the following form

$$\begin{aligned} f(T,B,L_m)=C_1 T+\tilde{f}(B,L_m) , \end{aligned}$$
(87)

where \(C_1\) is a constant and the function \(\tilde{f}(B,L_m)\) depends on both the boundary term and the matter Lagrangian. The first term represents the possibility of having TEGR (or GR) in the background when we set \(C_1=1\). If this term does not appear in the function, it is not possible to recover GR since one cannot construct GR from \(\tilde{f}(B,L_m)\) gravity. This kind of theories have not been considered in the past, but there are some studies for the specific case \(\tilde{f}(B,L_m)=f(B)+L_m\), which is known as f(B) gravity [36, 37, 55]. The full dynamical system (45)–(54) is simplified since \(x_1=x_3=x_4=\alpha \equiv 0\) which implies that Eqs. (45), (47), (48) and (53) are also automatically zero. Hence, in our variables, this theory is a five-dimensional dynamical system given by

$$\begin{aligned} \frac{dx_2}{dN}= & {} -6 (w+1)\beta _{BLL} \phi +\theta +3 (w+3) \phi \nonumber \\&+x_2 (6-2 \tilde{\beta }_{BBL} \phi ) -3-\frac{y_1 (x_2+\phi -1)}{y_2} , \end{aligned}$$
(88)
$$\begin{aligned} \frac{dy_1}{dN}= & {} -\frac{ x_2 (y_1+\beta _{BB} y_2)+y_1 (2 y_1-6 y_2+\phi )}{y_2} , \end{aligned}$$
(89)
$$\begin{aligned} \frac{dy_2}{dN}= & {} -(x_2+\phi ) , \end{aligned}$$
(90)
$$\begin{aligned} \frac{d\phi }{dN}= & {} 2(3 \beta _{BLL}-1)\phi (w+1)+2 \tilde{\beta }_{BBL} x_2 \phi , \end{aligned}$$
(91)
$$\begin{aligned} \frac{d\theta }{dN}= & {} 3 \theta (2 (w+1) \beta _{LL}-w+1 )+\frac{ \beta _{BB} x_2 \phi -2 \theta y_1}{y_2} ,\nonumber \\ \end{aligned}$$
(92)

where for simplicity we have introduced the following quantities

$$\begin{aligned} \tilde{\beta }_{BBL}=\beta _{BBL}\frac{f_{TB}}{f_{BB}}=\frac{f_{T} f_{BBL}}{f_{BL}f_{BB}} ,\quad \beta _{BB}=\frac{f_{B}}{T f_{BB}} . \end{aligned}$$
(93)

Let us now concentrate on a specific model based on the boundary term non-minimally coupled with the the matter Lagrangian where the function takes the following form

$$\begin{aligned} f(T,B,L_m)=C_1 T+f_1(B)+f_2(B)L_m , \end{aligned}$$
(94)

where \(C_1\) is a constant and \(f_1(B)\) and \(f_2(B)\) are functions which depends on the boundary term B. This case is analogous to the one studied in Sect. 4.3.1, but the dynamical system is more complicated to deal since it is a five dimensional one. The aim of this section is to study some specific cases that can be constructed from the above model.

Let us further study the case where the functions are a power-law type given by

$$\begin{aligned} f_1(B)=C_5 B^{s} , \quad f_2(B)=(C_4+C_3 B^{q})L_m , \end{aligned}$$
(95)

where \(C_3,C_4,C_5,q\) and s are constants. Since we are interested on studying non-trivial couplings between B and \(L_m\) we will assume that \(C_3\ne 0\). We directly find that \(\beta _{LL}=\beta _{BBL}=0\). It can be proved that for this model, the dynamical system can be reduced from five dimensional to a four dimensional one. For this case, the dynamical system is difficult to study. However, if one assumes that the exponents are related as

$$\begin{aligned} q=1-s , \end{aligned}$$
(96)

the system becomes easier to work since it becomes a three dimensional dynamical system. Then, we will split the study depending on different cases which depends on the constants.

4.4.1 \(f(T,B,L_m)=C_1 T+C_5 B^{s}+(C_4+C_3 B)L_m\)

Let us first study a very special case where \(q=1\) in (95) giving us a linear coupling between the boundary term B and the matter Lagrangian \(L_m\). This model will depend on the power-law parameter s and also on the constants \(C_3,C_4\) and \(C_5\). In this model, one can relate two dynamical dimensionless variables with the other ones making it a three dimensional one. In our case, we will replace \(\theta \) and \(y_1\) as follows

$$\begin{aligned} \theta= & {} -\frac{3 C_{1} (w+1) \phi (2 \phi +2 x_{2}-1) \left[ C_{3} \left( \frac{2C_{1} (\phi -3 (w+1) y_{2})}{3C_{5} s (w+1)}\right) ^{\frac{1}{s-1}}+C_{4}\right] }{C_{3} C_{5} (s-1) (w+1) \left( \frac{2\cdot 3^{1/s}C_{1} (\phi -3 (w+1) y_{2})}{C_{5} s (w+1)}\right) ^{\frac{s}{s-1}}+2 C_{1} C_{4} \phi } , \end{aligned}$$
(97)
$$\begin{aligned} y_1= & {} \frac{C_{3} (2 \phi +2 x_{2}-1) \left[ C_{1} \phi \left( \frac{C_{1} 2^s (\phi -3 (w+1) y_{2})}{C_{5} s (w+1)}\right) ^{\frac{1}{s-1}}-C_{5} s (w+1) \left( \frac{2C_{1} (\phi -3 (w+1) y_{2})}{C_{5} s (w+1)}\right) ^{\frac{s}{s-1}}\right] }{2C_{3} C_{5} (s-1) (w+1) \left( \frac{2C_{1} (\phi -3 (w+1) y_{2})}{C_{5} s (w+1)}\right) ^{\frac{s}{s-1}}+4 C_{1} C_{4} 3^{\frac{1}{s-1}} \phi } . \end{aligned}$$
(98)

Thus, it is possible to replace the above equations into Eqs. (90), (91) in order to reduce the dimensionality of the dynamical system for this model. By doing that, we find that the model only has one critical point given by

$$\begin{aligned} P: (x_2,y_2,\phi )=\bigg (0,\frac{s}{6 (s-1)},0\bigg ) , \end{aligned}$$
(99)

which depends on the power-law parameter s. The case \(s=1\) can be discarded since a linear combination of the boundary term does not affect the field equations. It is easily to see that the effective state parameter for this critical point is always \(-1\), hence this critical point always represents acceleration. To find out about the stability of this point, one needs to check the eigenvalues evaluated at P. There are three different eigenvalues given by

$$\begin{aligned} \bigg \{-3(1+w) , -\frac{3}{2}\pm \frac{3 \sqrt{(8-7 s) s}}{2 s}\bigg \} . \end{aligned}$$
(100)

One can directly see that when \(1<s\le 8/7\) and \(w>-1\), the critical point P is stable.

4.4.2 \(f(T,B,L_m)=C_1 T+(C_4+C_3 B^{q})L_m\)

Let us now consider the case where \(C_5=0\) in (95). This model represents the case where \(f_1(B)=0\). Let us also assume that \(q\ne 1\) to do not have the same model as the previous case. For this case, it is possible to relate the terms \(\tilde{\beta }_{BBL}\) and \(\beta _{BB}\) with the dynamical variables as follows

$$\begin{aligned} \tilde{\beta }_{BBL}= & {} -\frac{3 (w+1)}{2 \phi } ,\nonumber \\ \beta _{BB}= & {} -\frac{2 \theta +3 (w+1) (2 \phi -1)+6 (w+1) x_{2}}{2 (q-1) \phi } . \end{aligned}$$
(101)

Moreover, the dynamical system can be reduced from 5D to 3D since some of the variables are directly related, namely

$$\begin{aligned} y_1=-\phi -\frac{\theta }{3 (w+1)}-x_2+\frac{1}{2} ,\quad y_2=\frac{\phi }{3 (w+1)} . \end{aligned}$$
(102)

By replacing (101) and (102) in the dynamical system (88)-(92) we find that this system is reduced as follows

$$\begin{aligned} \frac{dx_2}{dN}= & {} \frac{\theta (4\phi -2)+3 (4 (w+2)\phi ^2-(3 w+5)\phi +w+1 )+x_{2} (2 \theta +6 (3 w+5)\phi -9 (w+1))+6 (w+1) x_{2}^2}{2\phi } , \end{aligned}$$
(103)
$$\begin{aligned} \frac{d\phi }{dN}= & {} -3 (w+1) (\phi +x_{2}) , \end{aligned}$$
(104)
$$\begin{aligned} \frac{d\theta }{dN}= & {} \frac{3 (w+1)}{\phi } \left( \frac{3 (w+1) x_{2}}{q-1}-2 \theta \right) \left( -\phi -\frac{\theta }{3 (w+1)}-x_{2}+\frac{1}{2}\right) -3 (w-1) \theta . \end{aligned}$$
(105)

This dynamical system has only one critical point given by

$$\begin{aligned} (x_2{}_{*},\phi _{*},\theta _{*})=\bigg (-\frac{q (w+1)}{2 q+w-1}, \frac{q (w+1)}{2 q+w-1},\frac{3 w+3}{2-2 q}\bigg ) ,\nonumber \\ \end{aligned}$$
(106)

where we have assumed that \(q\ne (1-w)/2\). This point of course depends on the parameters q and w. For this point, there is acceleration when

$$\begin{aligned} \frac{q+w}{1-q}<-\frac{1}{3} \Longrightarrow q>\frac{1}{2} (-3 w-1) , \end{aligned}$$
(107)

where we have assumed that \(w>-1\). Further, for the dust case \(w=0\) we can see that this point requires \(q>-1/2\) to represent and accelerating universe. It is also possible to check that there are three Eigenvalues associated with this point. Those Eigenvalues are very long to present here but Fig. 1 represents a region plot where the point is stable. Note that besides of the values of q and w, this point is never unstable.

Fig. 1
figure 1

Region plot for the state parameter w and the power-law parameter q for the model described by (95) with \(C_5=0\). The figure represents the regions where the point (106) is stable. The blank regions represent the regions where the point is a saddle one

Table 1 Acceleration and effective state parameter of the critical points for different models which depend on s. The model studied is described by \(f(T,B,L_m)=C_1T+C_5 B^{s}+(C_4+C_3 B^{1-s})L_m\) and \(\Delta =\sqrt{225 (C_5C_3)^{2} (73 w+53)^2+2940 C_5C_3 (23 w+43)+9604}\)

4.4.3 \(f(T,B,L_m)=C_1 T+C_5 B^{s}+(C_4+C_3 B^{1-s})L_m\)

Let us now assume the case where \(q=1-s\) and the constant \(C_5\ne 0\) which is a more generic model which has an additional boundary power-law contribution. As we have studied in the previous section, we can again reduce the dynamical system as a three-dimensional one. However, the models is much more complicated than the previous two models. The dynamics of the model highly depends on the parameter s. We can relate the terms \(\tilde{\beta }_{BBL}\) and \(\beta _{BB}\) with the dimensionless variables but now those quantities are very long for a generic s. Moreover, those terms make the dynamical system very long and difficult to treat for any s. One can also relate two dimensionless variables with the other ones. In this case, we will choose to work with the variables \((y_2,\theta ,\phi )\) since the dynamical system is slightly easier to work with them. The variables \(x_2\) and \(y_1\) are then given by

$$\begin{aligned} x_2= & {} \frac{1}{6 (w+1) \phi (2 C_{1} C_{4} \phi -6 C_{1} C_{4} (w+1) y_{2}+3 C_{3} C_{5} s (w+1))}\nonumber \\&[\phi (-2 \theta (2 C_{1} C_{4} \phi +3 C_{3} C_{5} (2 s-1) (w+1))\nonumber \\&-3 (w+1) (2 \phi -1) (2 C_{1} C_{4} \phi +3 C_{3} C_{5} s (w+1)))\nonumber \\&-6 (w+1) y_{2} (\theta \left( 3 C_{3} C_{5} (s-1)^2 (w+1)-2 C_{1} C_{4} \phi \right) \nonumber \\&-3 C_{1} C_{4} (w+1) \phi (2 \phi -1) ) ] , \end{aligned}$$
(108)
$$\begin{aligned} y_1= & {} -\frac{s y_{2} (2 \theta +3 (w+1) (2 \phi -1)+6 (w+1) x_{2})}{2 (\phi +3 (s-1) (w+1) y_{2})} . \end{aligned}$$
(109)

It is possible to write down the dynamical system for any generic s but it is very long a cumbersome to present it here. Moreover, the critical points highly depend on the parameter s and it is not possible to obtain all the possible critical points for any arbitrary s. Hence, we will only study some particular models. We will concentrate only on models with integer values of s. Table 1 represents various models with their critical points, effective state parameter and their acceleration regime. In general, for all the critical points for those models, it is possible to have acceleration for the dust case \(w=0\).

It is also important to mention that for \(s\ge 2\), all the models have only one critical point with the possibility of describing acceleration depending on the state parameter w. It can be proved that the critical points in the models \(s=3,4,5\) (there is only one critical point for each model) are always saddle points. The model \(s=2\) can be either a saddle point or an unstable point. Hence, for all of positive models of s, the critical points cannot be stable. When negatives values of s are considered, the system becomes more complicated. For \(s\le -3\), the dynamical system becomes highly complicated to analyse. For the case \(s=-1\), the critical point is either a saddle or an unstable point so it cannot be stable. Moreover, for the dust case (\(w=0\)), the critical point for the model \(s=-1\) is always unstable spiral. For the case \(s=-2\), there are two critical points \(P_1\) and \(P_2\) (see Table 1). The critical point \(P_2\) is either a saddle point or stable whereas the point \(P_1\) is always a saddle point. Figure 2 represents the regions where the point \(P_2\) is stable. It is important to mention that only the term \(C=C_3C_5\) appears in the Eigenvalues so that it is possible to make 2D region plots for the model. In this figure, it was considered the case \(C_1=C_4=1\) which is equal to consider the standard General Relativity plus matter model in the background.

Fig. 2
figure 2

Region plot for the critical point \(P_2\) for the model \(s=-2\) for the constants \(C_1=C_4=1\) and \(C=C_5C_3\). The figure is representing the regions where the critical point for that model (see Table 1) is stable. The point is never unstable. All the blank regions represents the regions where the point is a saddle point

5 Conclusions

In this work we have presented a new modified theory of gravity based on an arbitrary function f which depends on the scalar torsion T, the boundary term B and the matter Lagrangian of matter \(L_m\). Different kind of modified theories of gravity can be recovered from this theory. The incorporation of B in this function is with the aim to have the possibility to recover and connect standard metric theories based on the curvature scalar. This is possible since \(R=-T+B\), so that it is possible to recover the generalised curvature-matter Lagrangian coupled theory \(f(R,L_m)\). Figure 3 shows the most important theories that can be constructed from our action. The graph is divided into three main parts. The left part of the figure represents the scalar-curvature or standard metric theories coupled with the matter Lagrangian. Different interesting cases can be recovered from this branch, such as a generalised \(f(R,L_m)\) theory or a non-minimally scalar curvature-matter coupled gravity \(f_1(B)+f_2(B)L_m\) or just standard f(R) gravity. The entries at the middle of the figure represent all the theories based on the boundary term B and the matter Lagrangian \(L_m\). In this branch, new kind of theories are presented based on a general new theory \(C_1T+f(B,L_m)\), where the term \(C_1 T\) is added in the model to have TEGR (or GR) in the background. The right part of the figure is related to teleparallel theories constructed by the torsion scalar and the matter Lagrangian. Under these models, a new general theory \(f=f(T,L_m)\) is highlighted in box, allowing to have new kind of theories with new possible couplings between T and \(L_m\). As example, in this paper we have considered theories with exponential or power-law couplings between T and \(L_m\). Under special limits, these theories can represent a small deviation of standard TEGR with matter with or without a cosmological constant. As special case, this theory can also become a non-minimally torsion-matter coupled gravity theory \(f=f_1(T)+f_2(T)L_m\), presented previously in [53]. Thus, different gravity curvature-matter or torsion-matter coupled theories can be constructed. Some of them have been considered and studied in the past but others are new. The relationship between all of those well-known theories have not been established yet. From the figure, one can directly see the connection between modified teleparallel theories and standard modified theories. The quantity B connects the right and left part of the figure. Hence, the connection between the teleparallel and standard theories is directly related to this boundary term B. Therefore, one can directly see that the mother of all of those gravity theories coupled with the matter Lagrangian is the one presented in this work, the so-called \(f(T,B,L_m)\).

Fig. 3
figure 3

Relationship between different modified gravity models and general relativity

In this work, we have also studied flat FLRW cosmology for the general \(f(T,B,L_m)\) theory of gravity. Explicitly, we have focused our study on the dynamical systems of the full theory. In general, the theory is very complicated to work since it becomes a ten dimensional dynamical system. This is somehow expected since the theory is very general and complicated. Using the full dynamical system found for the full theory, we then study different special interesting theories of gravity. For the case \(f=f(-T+B,L_m)=f(R,L_m)\), it was proved that our full dynamical system becomes a five-dimensional one. Moreover, we have proved how one can relate our dimensionless variables with the ones used in [43] giving us a possibility of checking our calculations. We have found that the dynamics of this model is the same as it was described in [43].

The case \(f=f(T,L_m)\) is also studied, where in general the dynamical system can be reduced to be a three-dimensional one. This theory is analogous to \(f(R,L_m)\) but mathematically speaking, it is different. It is easier to solve analytically the flat modified FLRW for a specific model for the \(f(T,L_m)\) than \(f(R,L_m)\). Further, for the later theory, for the exponential/power-law curvature-matter couplings one needs to study the dynamical system to understand the dynamics. For the \(f(T,L_m)\) case, the exponential/power-law torsion-matter couplings are directly integrated, giving us a scale factor of the universe directly from the modified FLRW equations. Hence, one does not need dynamical system technique to analyse the dynamics of those two examples. Another special interesting case studied was \(f(T,L_m)=f_1(T)+f_2(T)L_m\). The dynamical system for this case is reduced as a two-dimensional one. We have proved that our dimensionless variables can be directly connected to the ones introduced in [45]. This also gives us a good consistency check that our full ten-dimensional dynamical system is correct mathematically, at least for those special cases. Thus, the dynamics of those models are consistent with the study made in [45].

Finally, we have also studied the dynamics of modified FLRW for \(C_1T+f(B,L_m)\) gravity using dynamical system. The dynamical system for this case becomes a five-dimensional one, exactly as the \(f(R,L_m)\) case. The dynamics for this model is more complicated than \(f(T,L_m)\). This is somehow expected since B contains second derivatives of the scale factor and T only contains first derivatives of the scale factor (see Eq. 5). Further, R also contains second derivatives of the scale factor, exactly as B, so it is not so strange to see that the dimensionality of the dynamical system of \(f(R,L_m)\) is the same as \(C_1T+f(B,L_m)\). Under the boundary-matter coupled model, we have studied a specific case where the matter Lagrangian is non-minimally coupled with B as \(f_1(B)+f_2(B)L_m\). By assuming some power-law boundary functions \(f_1(B)=C_5B^{s}\) and \(f_2(B)=(C_4+C_3 B^{q})\), we analysed the dynamics using dynamical system techniques. In general, the dynamical system for this power-law couplings are four dimensional but for the specific case where \(q=1-s\), becomes a three dimensional one. Thus, we have analysed this model depending on three different limit cases: (i) \(q=1\), (ii) \(C_5=0\) and lastly the case (iii) \(C_5\ne 0, q=1-s\). In general, the dynamics of all of these models are similar. As we have seen, mainly only one critical point is obtained for mainly all of them. The stability of those points were also studied, showing the regions where the critical points become stable.

As a future work, it might be interesting to study further other models that can be constructed from the full theory. In principle, one can use the same ten dynamical system that we constructed here, and then simplify it by assuming other new kind of couplings between T, B or \(L_m\). In addition, one can also use the reconstruction technique to find out which model could represent better current cosmological observations. Further, we can also incorporate the teleparallel Gauss–Bonnet terms \(T_G\) and \(B_G\) to have a more general theory \(f(T,B,L_m,T_G,B_G)\) (see [56]) or even a more general new classes of theories based on the squares of the decomposition of torsion \(T_{\mathrm{ax}},T_{\mathrm{vec}}\) and \(T_{\mathrm{ten}}\) (see [57]). Then, one can study the dynamics of the modified FLRW for this general theory. By doing all of this, it will give a powerful tool to determine which models are better describing the current acceleration of the Universe, or other cosmological important questions.