1 Introduction

We consider a member of the Duffing-type equation [1,2,3]

$$\begin{aligned} \frac{d^{2} y}{d x^{2}}+y^{2 n+1}+\sum _{j=0}^{2 n} p_{j}(x) y^{j}=0, \quad n \geqslant 1, \end{aligned}$$
(1)

with \(p_{j}(x+1)=p(x)\) and \(p_{j} \in C^{\infty }\). Equation (1) describes a class of Hamiltonian systems with time-dependent potentials. In general, this equation is distinguished in a dynamical system concerning the jump resonance phenomenon. The qualitative aspects of this equation have been studied in [2,3,4].

It is important to note that these equations have numerous applications in physics, engineering, and applied mathematics, including the study of mechanical vibrations, oscillations in electrical systems, and nonlinear dynamics of structures. The Duffing-type equation is one of the simplest nonlinear equations exhibiting chaotic behavior, making it an ideal model for investigating complex phenomena in dynamical systems. Therefore, studying and finding solutions to Eq. (1) is not only of academic interest but also has significant practical implications in a variety of fields.

In line with the foregoing, in the present paper, we study the Eq. [1, 5, 6]:

$$\begin{aligned} y_{xx}+y^{2n+1}+f(x)y-g(x)=0,\,\,\,n\in \,\mathbb {R}, \end{aligned}$$
(2)

which has been studied previously, particularly regarding the boundedness of solutions. In [1], Moser’s twist theorem was employed to establish the boundedness of the solution. The objective of this work is to apply the Lie symmetry method [7,8,9,10,11] to the Eq. (2). Examples of this method can be found in [12,13,14,15].

The theory of Lie groups has emerged as a potent methodology for solving differential equations, leveraging its capacity to reveal inherent symmetries within the equations. The identification of these symmetries enables us to streamline the problem by reducing the number of variables involved, leading to more accessible solutions. Recent research papers [16,17,18,19] showcase the application of Lie symmetry group methods in solving differential equations. These studies highlight the pivotal role of Lie group theory in establishing a framework for comprehending the intrinsic structure of differential equations and identifying their symmetries. This, in turn, facilitates the development of efficient numerical methods for solving such equations. Currently, the theory of Lie groups has evolved into a crucial tool for mathematicians and scientists across diverse fields, spanning physics, engineering, and finance.

To conclude this introductory section, it is imperative to emphasize that, under specific limit regimes, the diffusion equation can be effectively approximated by the Duffing-type equation. The rationale behind this lies in the shared capability of both the diffusion equation and the Duffing-type equation to capture nonlinear phenomena. Through specific limits, the Duffing-type equation can be streamlined into a form closely resembling the diffusion equation. Consequently, leveraging the Duffing-type equation enhances our understanding of diffusion processes within nonlinear systems. Furthermore, its integration with the diffusion equation affords a sophisticated modeling approach for complex dynamical systems in physics and engineering, as highlighted in recent works [20,21,22].

The paper is structured as follows: In Sect. 2, a complete classification of Lie group symmetries is provided. Section 3 introduces the optimal system for (2). The solution obtained using this optimal system is explored in Sect. 4. Moving on, Sect. 5 demonstrates the derivation of a Lagrangian for equation (2) through the Jacobi multiplier method, followed by the classification of the symmetry Lie algebra.

2 Lie point symmetry group

In this section, we will determine the Lie symmetry group for Equation (2). Our primary objective is to identify a set of transformations that maintain the equation invariant under infinitesimal variations. The pivotal outcome of this section can be succinctly summarized as follows:

Table 1 Infinitesimal generators of Eq. (2)

Proposition 1

Equation (2), with arbitrary functions f and g and constant n, does not possess a Lie point symmetry group. Complementary cases are presented in Table 1.

Proof

The one-parameter Lie group generating operators associated with Eq. (2) are:

$$\begin{aligned} y\longrightarrow y+\epsilon \omega (x,y)+O\left( \epsilon ^{2}\right) \,\,\,\,\,\,\,\,\text {;}\,\,\,\,\,\,\,\,\,\,\,x\longrightarrow x+\epsilon \psi (x,y)+O\left( \epsilon ^{2}\right) , \end{aligned}$$

where \(\epsilon \) represents the group parameter. The vector field associated with this group of transformations is \( \Gamma =\psi (x,y)\frac{\partial }{\partial x}+\omega (x,y)\frac{\partial }{\partial y}, \) with \(\psi ,\omega \) differentiable functions in \(\mathbb {R}^2\). To determine the infinitesimals \(\omega (x, y)\) and \(\psi (x, y)\), we employed the second extension operator

$$\begin{aligned} \Gamma ^{(2)}= & {} \omega _{[xx]}\frac{\partial }{\partial {y_{xx}}}+\omega _{[x]}\frac{\partial }{\partial {y_x}}+\Gamma , \end{aligned}$$
(3)

to the Eq. (2), we obtained the corresponding symmetry requirement

$$\begin{aligned} \psi (f_xy-g_x)+ \omega \left[ (2n+1)y^{2n}+f\right] +\omega _{[xx]}=0, \end{aligned}$$
(4)

where the coefficients in \(\Gamma ^{(2)}\) are \(\omega _{[x]}\) and \(\omega _{[xx]}\), respectively:

$$\begin{aligned} \omega _{[x]}= & {} D_x[\omega ]-(D_x[\psi ])y_x=\omega _x +(\omega _y-\psi _x)y_x-\psi _yy_x^2, \nonumber \\ \omega _{[xx]}= & {} D_x[\omega _{[x]}]-(D_x[\psi ])y_{xx},\nonumber \\= & {} \omega _{xx}+(2\omega _{xy}-{\psi }_{xx})y_x+(\omega _{yy}-2{\psi }_{xy})y_x^2-{\psi }_{yy}y_x^3\\{} & {} +(\omega _y-2\psi _x)y_{xx}-3{\psi }_yy_xy_{xx}.\nonumber \end{aligned}$$
(5)

where \(D_{x}=\partial _{x}+y_{x}\partial _{y}+y_{xx}\partial _{y_{x}}+\cdots \) is the total differential (see [12]).

After applying (5) in (4) and substituting in the resulting expression \(y_{xx}\) by (2), we get:

$$\begin{aligned}{} & {} \psi \left[ f_xy-g_x)\right] + \omega \left[ (2n+1)y^{2n}+f\right] +\omega _{xx}+(2\omega _{xy}-{\psi }_{xx})y_x\nonumber \\{} & {} \qquad \quad + (\omega _{yy}-2{\psi }_{xy})y_x^2-{\psi }_{yy}y_x^3+(\omega _y-2\psi _x)\left( -y^{2n+1}-f(x)y+g(x)\right) \\{} & {} \qquad \quad - 3{\psi }_yy_x\left( -y^{2n+1}-f(x)y+g(x)\right) =0. \end{aligned}$$

Analyzing the coefficients with respect to the independent variables \(y_{x}^3, y_{x}^2, y_{x}\), and 1, we obtain the following system of determining equations:

$$\begin{aligned}&\psi _{yy}=0, \end{aligned}$$
(6a)
$$\begin{aligned}&\omega _{yy}-2\psi _{xy}=0,&\end{aligned}$$
(6b)
$$\begin{aligned}&\psi _{y}\left( 3y^{2n+1}+3yf-3g\right) +2\omega _{xy}-\psi _{xx}=0,&\end{aligned}$$
(6c)
$$\begin{aligned}{} & {} \omega \left( y^{2n}+2ny^{2n}+f\right) +\psi \left( yf_x-g_x\right) +\omega _{y}\left( -y^{2n+1}-yf+g\right) \nonumber \\{} & {} \quad + \psi _{x}\left( 2y^{2n+1}+2yf-2g\right) +\omega _{xx}=0. \end{aligned}$$
(7)

It is evident from (7) that if f and g are arbitrary, we have \(\psi =0\) and \(\omega =0\), implying the non-existence of the group of symmetries. By solving (6a), we have:

$$\begin{aligned} \psi (x)=yc_1(x)+c_2(x), \end{aligned}$$
(8)

here, \(c_1\) and \(c_2\) are arbitrary functions. Substituting (8) into (6b), we obtain:

$$\begin{aligned} \omega (x,y)=y^{2}c_{1,x}+yc_3(x)+c_4(x). \end{aligned}$$
(9)

where \(c_3\) and \(c_4\) are arbitrary functions. From (8) and (9) into (6c) we get \(y^{2n+1}\left( 3c_{1}\right) +y\left( 3fc_{1}+3c_{1,xx}\right) -3gc_{1}+2c_{3,x}-c_{2,xx}=0, \) implying \(c_{1}=0\) and \(c_{3}(x)= \frac{c_{2,x}}{2}+k_1,\) then using this in (8) and (9), we will obtain:

$$\begin{aligned}&\psi (x)=c_2(x), \quad \omega (x,y)=y\left( \frac{c_{2,x}}{2}+k_1\right) +c_4(x). \end{aligned}$$
(10)

From (10) into (7):

$$\begin{aligned}{} & {} y^{2n+1}\left( c_{2,x}(n-1)-k_1\right) +y\left( c_2f_x+2c_{2,x}f+\frac{c_{2,xxx}}{2}\right) \\{} & {} \qquad +y^{2n}\left( (2n+1)(c_4+k_1)\right) +c_4f-c_2g_x+g\left( \frac{-3c_{2,x}}{2}+k_1\right) +c_{4,xx}=0.\nonumber \end{aligned}$$
(11)

Given that \(y^{2n+1},y^{2n},y\), and 1 are linearly independent, the coefficients in the expression (11) for these terms must be zero. This leads to the following system of equations:

$$\begin{aligned}&c_{2,x}(n-1)-k_1=0,\end{aligned}$$
(12a)
$$\begin{aligned}&(c_4+k_1)(2n+1)=0,\end{aligned}$$
(12b)
$$\begin{aligned}&c_2f_x+2c_{2,x}f+\frac{c_{2,xxx}}{2}=0,\end{aligned}$$
(12c)
$$\begin{aligned}&c_4f-c_2g_x+g\left( \frac{-3c_{2,x}+2k_1}{2}\right) +c_{4,xx}=0, \end{aligned}$$
(12d)

In reference to (12a), we need to consider two cases: \(n=1\) and \(n\ne 1.\)

Case I. Suppose that (12a) leads to \(n=1,\) which implies \(k_1=0\). From (12b) we get \(c_4(x)=0.\) From (12d) we have

$$\begin{aligned} c_{2,x}g+\frac{2c_2g_x}{3}=0. \end{aligned}$$
(13)

Regarding (13), two cases must be considered \(g=0\) and \(g\ne 0.\)

Case I.1 Suppose that (13) leads to \(g=0.\) From (12c) we have

$$\begin{aligned} c_2f_x+2c_{2,x}f+\frac{c_{2,xxx}}{2}=0. \end{aligned}$$
(14)

In reference to (14), we need to consider two cases: \(c_2=0\) and \(c_2\ne 0.\)

Case I.1.1 Suppose that (14) leads to \(c_2=0.\) From (10) we obtain \(\psi (x)=0\) and \(\omega (x,y)=0.\) Hence the group of symmetries is trivial, then \(g=0\) and f is arbitrary function.

Case I.1.2 Suppose that (14) leads to \(c_2\ne 0.\) This means that

$$\begin{aligned} f(x)=-\frac{c_{2}^{-2}}{2}\int \left( c_{2,xxx}c_{2}\right) dx+\left( k_2c_{2}^{-2}\right) . \end{aligned}$$

Where \(k_2\) is an arbitrary constant. From (10) we obtain \(\psi (x)=c_2(x)\) and \(\omega (x,y)=\frac{yc_2(x)}{2}.\) Consequently, the generator of the group of symmetries is \(\Gamma =c_2(x)\partial _x+\frac{y}{2}c_2(x)\partial _y\), with \(g=0.\)

Case I.2 Suppose that (13) leads to \(g\ne 0,\) then \(c_{2,x}+\frac{2c_2g_x}{3g}=0.\) Solving for \(c_2(x)\), we have \(c_2(x)=k_3(g(x))^{-\frac{2}{3}}\), where \(k_3\) is another arbitrary constant. From (12c) we get

$$\begin{aligned} f_x-\frac{4g_x}{3g}f=-\frac{c_{2,xxx}}{2k_3}g^{\frac{2}{3}}. \end{aligned}$$
(15)

Solving in (15) for f, we have

$$\begin{aligned} f(x)=-\frac{g^{4/3}}{2k_3}\int \left( c_{2,xxx}g^{-2/3}\right) dx+\left( k_4g^{4/3}\right) . \end{aligned}$$

Where \(k_4\) is arbitrary constant. From (10) we obtain \(\psi (x)=k_3(g(x))^{-\frac{2}{3}}\) and \(\omega (x,y)=-\frac{yk_3}{3}\left( g^{-5/3}g_x\right) .\) Therefore the generator of the group of symmetries is \(\Gamma =k_3(g(x))^{-\frac{2}{3}}\partial _x-\frac{yk_3}{3}(g(x))^{-\frac{5}{3}}g_x\partial _y\), with \(g\ne 0.\)

Case II. Suppose in (12a) that \(n\ne 1.\) Then \(c_2=\frac{k_1}{n-1}x+k_2.\) Where \(k_2\) is arbitrary constant. From (12b):

$$\begin{aligned} (c_4+k_1)(2n+1)=0. \end{aligned}$$
(16)

Considering (16), we need to examine two cases: \(n=-\frac{1}{2}\) and \(n\ne -\frac{1}{2}.\)

Case II.1:

Suppose in (12b) that \(n=-\frac{1}{2}\) then \(c_2(x)=-\frac{2k_1x}{3}+k_2.\) From (12c) we get \( f_x+\left( \frac{4k_1}{2k_1x-k_2}\right) f=0,\) and solving for f, we obtain \(f(x)=p_1(k_2-2k_1x)^{-2}.\) Where \(p_1\) is abitrary constant. From (12d)

$$\begin{aligned} g_x+g\left( \frac{6k_1}{2k_1x-3k_2}\right) =-\frac{3c_{4,xx}}{2k_1x-3k_2}-\frac{3p_1c_4(k_2-2k_1x)^{-2}}{(2k_1x-3k_2)}. \end{aligned}$$

Solving for g, we get

$$\begin{aligned} g(x)= & {} (2k_1x-3k_2)^{-3}\left( \int \frac{-3c_{4,xx}dx}{(2k_1x-3k_2)^{-2}}-\frac{3p_1c_4(2k_1x-3k_2)^{2}dx}{(k_2-2k_1x)^{2}}\right) \nonumber \\+ & {} k_4(2k_1x-3k_2)^{-3}. \end{aligned}$$

Where \(k_4\) is arbitrary constant. From (10) we obtain \(\psi (x)=-\frac{2k_1x}{3}+k_2\) and \(\omega (x,y)=\frac{2yk_1}{3}+c_4(x).\) Hence the group of symmetries is \(\Pi _1=-x\partial _x+y\partial _y,\) \(\Pi _2=\partial _x\) and \(\Pi _3=c_4(x)\partial _y.\)

Case II.2:

Suppose in (16) that \(n\ne -\frac{1}{2},\) then \(c_4(x)=-k_1.\) From (12c):

$$\begin{aligned} f_x+\frac{2c_{2,x}}{c_2}f=0. \end{aligned}$$
(17)

Solving in (17) for f, we obtain \(f=k_4(n-1)^2(k_1x+k_2(n-1))^{-2}.\) Where \(k_4\) is arbitrary constant. From (12d):

$$\begin{aligned} g_x+g\left( \frac{k_1(5-2n)}{(k_1x+k_2(n-1))}\right) =-\frac{k_1k_4(n-1)^3}{(k_1x+k_2(n-1))^3}. \end{aligned}$$
(18)

From (18) we have to consider two cases: \(n=\frac{5}{2}\) and \(n\ne \frac{5}{2}.\) Case II.2.1 Suppose at (18), that \(n=\frac{5}{2}\) then \(f=9k_4(2k_1x+3k_2)^{-2}\) and \(g_x=-\frac{27k_1k_4}{(2k_1x+3k_2)^3}.\) Solving the above expression for g, we get \(g(x)=\frac{k_4}{2}(2k_1x+3k_2)^{-2}+k_5.\) Where \(k_5\) is arbitrary constant. From (10), we get \(\psi (x)=\frac{2k_1x}{3}+k_2\) and \(\omega (x,y)=y\left( \frac{4k_1}{3}\right) -k_1.\) Hence the group of symmetries is \(\Pi _1=x\partial _x+(2y-6)\partial _y\) and \(\Pi _2=\partial _x\) Case II.2.2 Suppose at (18), that \(n\ne \frac{5}{2}.\) Thus, if we want to solve (18) we have to consider two cases: \(n=\frac{3}{2}\) and \(n\ne \frac{3}{2}.\) Case II.2.2.1 Suppose at (18), that \(n=\frac{3}{2}\), so \(f=k_4(2k_1x+k_2)^{-2}\) and \(g=-k_1k_4(2k_1x+k_2)^{-2}\ln {(2k_1x+k_2)^{-2}}+k_5(2k_1x+k_2)^{-2}.\) Where \(k_5\) is arbitrary constant. From (10), we get \(\psi (x)=2k_1x+k_2\) and \(\omega (x,y)=2k_1y-k_1.\) Hence the group of symmetries is \(\Pi _1=x\partial _x+(2y-1)\partial _y\) and \(\Pi _2=\partial _x\) Case II.2.2.2 Suppose at (18), that \(n\ne \frac{3}{2},\) then solving for g we get \(g=-\frac{k_1k_4(n-1)^3}{(3-2n)(k_1x+k_2(n-1))^{2}}+\frac{k_5}{(k_1x+k_2(n-1))^{-5+2n}}\) and \(f=k_4(n-1)^2(k_1x+k_2(n-1))^{-2}.\) From (10): \(\psi (x)=\frac{k_1x}{n-1}+k_2\) and \(\omega (x,y)=y\left( \frac{k_1}{2(n-1)}+k_1\right) -k_1.\) Hence the group of symmetries is \(\Pi _1=\frac{x}{(n-1)}\partial _x+\left( \frac{y(2n-1)}{2(n-1)}-1\right) \partial _y\) and \(\Pi _2=\partial _x.\)

We have completed the proof of Proposition 1 by analyzing all the cases.

3 Optimal system

In the context of Lie symmetries, an optimal system is a set of generators that allow the identification of all symmetries and invariant solutions of a differential equation, which is invariant under a given Lie group. An optimal system is also the minimum set of generators needed to generate all symmetries and invariant solutions of the differential equation.

In other words, an optimal system allows for obtaining complete information about the symmetries and invariant solutions of a differential equation and is fundamental in the investigation of differential equations possessing Lie point symmetries. By using an optimal system, invariant solutions can be obtained more efficiently, which is particularly important in scientific and engineering applications where solving differential equations is a common task [8, 9].

Taking into account [23, 24], in this section, we are going to the optimal system from the previous continuous group of Lie symmetries for (2), using II.2.2.2) of the Table 1, a possible way to obtain invariant solutions is presented.

Initially, we compute the corresponding commutator table, which can be derived from the operator:

$$\begin{aligned}{}[\Pi _{\alpha },\Pi _{\beta }]=\sum _{i=1}^n\left( \Pi _\alpha (\psi _{\beta }^i)-\Pi _\beta (\psi _{\alpha }^i) \right) \frac{\partial }{\partial x^i}, \end{aligned}$$
(19)

where \(\alpha , \beta =1,2\), with \(i=1,2\), and the coefficients relate to the infinitesimal operators \(\Pi _{\alpha },\Pi _{\beta }\) are \(\psi _{\alpha }^i,\psi _{\beta }^i\). Now using the operator (19) in the Lie symmetry group of (2), (see II.2.2.2 in Table  1), we obtain the commutator table for operators, namely:

Table 2 Commutators table of (2)

Now, we will use the next self-adjoint operator by the continuous group of Lie symmetries of (2), and for this proposal, we will use the commutators table (see Table 2):.

$$\begin{aligned} {\text {Ad}}( e^{( \lambda \Pi )})G=\sum _{n=0}^{\infty } \frac{\lambda ^i}{i!}({\text {Ad}}(\Pi ))^iG, \end{aligned}$$

where \(\Pi \) represents a symmetry, and G is a generic linear combination of symmetries.

Now, using the previous operator, we calculate Table 3, which presents the self-adjoint representation for the symmetries.

Table 3 Self-adjoint representation of (2)

Proposition 2

The following set of field vectors constitutes the optimal system associated with equation (2)

$$\begin{aligned} \Pi _1,\,\Pi _1+b_2\Pi _2 \,,\,\text {with}\,\,b_2\ne 0. \end{aligned}$$

Proof

Consider the following linear combination of symmetries:

$$\begin{aligned} G=a_{1} \Pi _{1}+a_{2} \Pi _{2}, \end{aligned}$$
(20)

it generator was shown in II.2.2.2), and our goal is to simplify the \(a_i\) coefficients as much as we can by utilizing adjoint maps to G and referring to Table 3.

  1. (1)

    Supposing \(a_2 = 1\) in (20), we get \(G = a_{1} \Pi _{1}+ \Pi _{2}\). Now, applying the self-adjoint operator to \((\Pi _2,G)\) we obtain

    $$\begin{aligned} G_{1}={\text {Ad}}\left( e^{\left( \lambda _{1} \Pi _{2}\right) }\right) G=a_1\Pi _1+\left( 1-\frac{\lambda _1}{n-1}\right) \Pi _2. \end{aligned}$$

    Since \(n\ne 0, 1, -\frac{1}{2},\frac{5}{2},\frac{3}{2}\), we can use \(\lambda _1=n-1\), consequently, \(\Pi _2\) is eliminated, therefore \(G_1 =a_1\Pi _1\). Finally, applying the adjoint operator to \((\Pi _1, G_1)\) does not lead to any reduction, thus we obtain the first element of the optimal system:

    $$\begin{aligned} G_1=a_1\Pi _1. \end{aligned}$$

    This results in a simplification of the general element (20).

  2. (2)

    Supposing \(a_2 = 0\), \(a_1=1\) in (20), we get \(G = \Pi _{1}\). Using the adjoint operator again on \((\Pi _1, G)\), we don’t have any reduction, but using the adjoint operator on \((\Pi _2, G)\) we finally obtain

    $$\begin{aligned} G_{2}={\text {Ad}}\left( e^{\left( \lambda _{2} \Pi _{2}\right) }\right) G=\Pi _1-\frac{\lambda }{n-1}\Pi _2. \end{aligned}$$

    It is evident that this does not result in any reduction. Then, by utilizing \(b_2=\frac{-1}{(n-1)\lambda _2}\), with \(\lambda _2 \ne 0\), we obtain another element of the optimal system

    $$\begin{aligned} G_2=\Pi _1+b_2\Pi _2\,, \,\,\text {where}\,\,b_2\ne 0. \end{aligned}$$

    This marks the conclusion of another simplification of the general element (20).

4 Invariant solutions by generators of the optimal system

In this section, we delineate the properties of all invariant solutions by considering certain operators that generate the optimal system outlined in Proposition 2. To achieve this objective, we employ the method of invariant curve condition [9] (as presented in section 4.3, p. \(68-71\)). This method is mathematically expressed by the following equation:

$$\begin{aligned} 0=-y_x\psi +\omega = Q (x,y,y_x). \end{aligned}$$
(21)

Utilizing the component \(\Pi _1\) from Proposition 2 and II.2.2.2 of the Table 1, and applying the condition (21), we obtain the following result \( Q =\omega _{1}-y_x\psi _{1}=0\). This leads to the equation \(\left( \frac{y(2n-1)}{2(n-1)}-1\right) -y_x \left( \frac{x}{n-1}\right) =0\). Solving this ordinary differential equation yields an implicit solution as shown in Table 4. A similar procedure with the element \(\pi _1+b_2\Pi _2\), using \(b_2=1\), provides another solution also presented in Table 4.

Table 4 Solutions for (2)

5 The Lagrangian and classification of Lie algebra

Now, we will determine the Lagrangian using Jacobi’s Last Multiplier method, as presented by Nucci in [25]. For this purpose, we will calculate the inverse of the determinant, denoted as \(\Delta ^{-1}\):

$$\begin{aligned} \Delta = \begin{vmatrix} x&y_x&y_{xx}\\ \Pi _{1,x}&\Pi _{1,y}&\Pi _{1}^{(1)}\\ \Pi _{2,x}&\Pi _{2,y}&\Pi _{2}^{(1)} \end{vmatrix}= \begin{vmatrix} x&y_x&y_{xx}\\ \frac{x}{(n-1)}&\frac{y(2n-1)}{2(n-1)}-1&\frac{2n-3}{2(n-1)}y_x\\ 1&0&0 \end{vmatrix}, \end{aligned}$$

where \(\Pi _{1,x},\Pi _{1,y},\Pi _{2,x},\) and \(\Pi _{2,y}\) are the components of the symmetries \(\Pi _1,\Pi _2\) shown in the Proposition 1 case II.2.2.2 Table 1 and \(\Pi _{1}^{(1)},\Pi _{2}^{(1)}\) as its first prolongations. Then we get \(\Delta =By_x^2+H(x,y),\) where \(B=\frac{2n-3}{2(n-1)}\) and \(H(x,y)=\left( 1-\frac{y(2n-1)}{2(n-1)}\right) \left( -y^{2n+1}-f(x)y+g(x)\right) ,\) which implies that \(M=\frac{1}{\Delta }=\frac{1}{By_x^2+H}\).

Based on [25], it has been established that M can be expressed as \(M=L_{y_xy_x}\), which in turn implies \(L_{y_xy_x}=\frac{1}{By_x^2+H}\). By performing double integration with respect to \(y_x\), the Lagrangian can be derived as follows:

$$\begin{aligned} L(x,y,y_x)=\frac{y_x\tan ^{-1}(Cy_x)}{D}-\frac{\ln (C^2y_x^2-1)}{2CD}+y_xf_1(x,y) + f_2(x,y), \end{aligned}$$
(22)

where \(C=\frac{\sqrt{B}}{\sqrt{H}},\,\,\,D=\sqrt{BH}\) and \(f_1,f_2\) are arbitrary functions.

The study of Lie algebras serves various purposes. For example, in geometry, the classification of Lie algebras gives rise to several models, including the contact Lie algebra, quadratic Lie algebra, and others. In the Lie symmetry method, the group of transformations is determined by the infinitesimal generators, which constitute the Lie algebra. Thus, knowing the type of Lie algebra we are dealing with enables us to draw additional conclusions about the equation under consideration [26, 27].

The classification of finite-dimensional Lie algebras relies on Levi’s theorem, which draws upon two fundamental classes of Lie algebras: solvable and semisimple. These classes encompass specific subclasses, such as the nilpotent Lie algebra within the solvable class. Understanding these classes is crucial for precisely classifying Lie algebras..

The definitions and propositions presented below can be found in [28,29,30,31].

Definition 1

Let \(\mathfrak {g}\) be a finite-dimensional Lie algebra and k an arbitrary field for \(\mathfrak {g}\). The coefficients \(C_{ij}^{k}\) are called structure constants if a base is chosen \({e_{j}}\), \(1\le i \le n\), in \(\mathfrak {g}\) where \(n= \text {dim } \mathfrak {g}\) and \([e_i,e_j]=C_{ij}^{k}e_{k}\).

Proposition 3

Suppose \(\mathfrak {g}_{1}\) and \(\mathfrak {g}_{2}\) are two n-dimensional Lie algebras with bases such that their structure constants are identical. Under this condition, \(\mathfrak {g}_{1}\) and \(\mathfrak {g}_{2}\) are isomorphic.

We denote \(\mathfrak {aff}(2)\) as the solvable 2-dimensional Lie algebra with the basis \({e_1,e_2}\), where the commutator of \(e_1\) and \(e_2\) is given by \([e_1,e_2]=e_1\).

Proposition 4

The Lie algebra associated with the continuous group of Lie symmetries for Eq. (2) is two-dimensional and isomorphic to the solvable Lie algebra \(\mathfrak {aff}(\mathbb {R})\).

Proof

Consider the following assignments: \(e_{1}:=\Pi _1\) and \(e_{2}:=-(n-1) \Pi _2\). Verifying that \([e_1,e_2]=e_1\), we can then use Proposition 3 to conclude that the statement is proven.

6 Conclusion

By applying the Lie symmetry group (see Proposition 1 case II.2.2.2), we computed the optimal system presented in Proposition 2. With the assistance of these operators, we derived two solutions (see Table 4), notably, these solutions have not yet been documented in the literature. Additionally, we obtained a Lagrangian for the Eq. (2) using the Jacobi multiplier method. This Lagrangian holds significance for exploring the dynamics of this equation from a variational standpoint.

The Lie algebra associated with the Eq. (2) is isomorphic to the Lie algebra \(\mathfrak {aff}(\mathbb {R})\). Thus, we have successfully achieved the original objective. In future studies, it is worthwhile to consider the theory of equivalence groups for obtaining preliminary classifications associated with a complete classification of the Eq. (2). Additionally, future investigations could explore nonclassical symmetries.