Lagrangians, Gauge Functions, and Lie Groups for Semigroup of Second-Order Differential Equations

A set of linear second-order differential equations is converted into a semigroup, whose algebraic structure is used to generate novel equations. The Lagrangian formalism based on standard, null, and nonstandard Lagrangians is established for all members of the semigroup. For the null Lagrangians, their corresponding gauge functions are derived. The obtained Lagrangians are either new or generalization of those previously known. The previously developed Lie group approach to derive some equations of the semigroup is also described. It is shown that certain equations of the semigroup cannot be factorized, and therefore, their Lie groups cannot be determined. A possible solution of this problem is proposed, and the relationship between the Lagrangian formalism and the Lie group approach is discussed.


Introduction
Let Q be a set of all linear second-order differential equations (ODEs) of the formDyðxÞ = 0, whereD ≡ d 2 /dx 2 + BðxÞd/d x + CðxÞ, and BðxÞ and CðxÞ are smooth (C ∞ ) and ordinary (B : R → R and C : R → R) functions to be determined. In general, Q contains a wide variety of ODEs that can be separated into two subsets, one with known solutions and the other with unknown solutions. According to Murphy [1], there are more than five hundred ODEs in Q whose solutions are known, and many of those solutions are given by the special functions (SF) of mathematical physics as defined in [1,2].
An algebraic structure can be added to Q, and as a result, the set becomes a semigroup. Let S be a semigroup and let "+" be the binary operation of addition, such that ∀s 1 , s 2 ∈ S : ðs 1 + s 2 Þ ∈ S. Moreover, the associativity axiom requires that ∀s 1 , s 2 , s 3 ∈ S : s 1 + ðs 2 + s 3 Þ = ðs 1 + s 2 Þ + s 3 . With the above conditions being obeyed by all elements of S, the semigroup also preserves the commutative rule ∀s 1 , s 2 ∈ S : ðs 1 + s 2 = s 2 + s 1 Þ ∈ S, which means that S is a commutative semigroup. It must be pointed out that the algebraic structure imposed on the commutative semigroup allows generating both new and known ODEs (see Section 2) that are also elements of S.
Let us also point out that an identity element may also be formally introduced into the semigroup S by taking BðxÞ = CðxÞ = 0 and finding the solution yðxÞ = a 0 x + b 0 with a 0 and b 0 being constants. Having defined this identity element, the semigroup S becomes a monoid M, and since the original S is commutative, M is also commutative. The monoid structure of the considered ODEs is an interesting property that may be studied further in future papers; however, in this paper, only the commutative semigroup of ODEs is investigated.
The first main objective of this paper is to establish the Lagrangian formalism for all ODEs of S by using standard and nonstandard Lagrangians. The standard Lagrangians (SLs) are typically expressed as the difference between terms that can be identified as the kinetic and potential energy [3]. On the other hand, for nonstandard Lagrangians (NSLs), originally introduced by Arnold [4] who referred to them as nonnatural Lagrangians, identification of kinetic and potential energy terms may not be obvious. Among different applications, Alekseev and Arbuzov [5] used the NSLs to formulate the Yang-Mills field theory. Extensive discussions of methods to derive NSLs can be found in some previous [6][7][8] and more recent work [9,10]. Other important methods to obtain NSLs were developed by El-Nabulsi [10], Nucci [11][12][13][14], Cariñena et al. [15][16][17], and Saha and Talukdar [18].
Lagrangians are not unique, which means that some extra terms may be added to them and they give the same original equation. These are null (NLs) or trivial Lagrangians (TLs) as they make the Euler-Lagrange (E-L) equation to vanish identically [19,20]. In other words, the NLs can be added to any Lagrangian without changing the derivation of the original equation. It is also required that the NLs can be expressed as the total derivative of a scalar function, which is called a gauge function [19,21,22]. The null Lagrangians have been extensively studied in mathematics [23][24][25][26][27][28] but only with a couple of applications in physics [29,30].
In theoretical physics, the Lagrangian formalism is central to any classical or quantum theory of particles, waves, or fields, and the fundamental equations of modern physics are typically derived from given Lagrangians [3]. If the original equations are given but their Lagrangians are not known, then the inverse (or Helmholtz) problem of the calculus of variations must be solved [31]. In this paper, the inverse problem for all ODEs of S is solved, and their SLs, NLs, and NSLs are derived; the existence of the obtained Lagrangians is verified by using the Helmholtz conditions [32], and it is demonstrated that the derived NSLs violate the Helmholtz conditions.
As the second main objective of this paper, the Lie group approach is applied to the ODEs of S. A Lie group for a given ODE of S must be known in advance, so its irreducible representations (irreps) can be determined and used to obtain the corresponding solutions of this ODE. Moreover, operators of the Lie algebra of the selected Lie group can be used to obtain the original ODE. This work has been done so far for the ODEs whose solutions are the SF of mathematical physics [33][34][35][36][37] (called here the SF ODEs), and its limitations are explored in this paper. Now, if the original equation is given but its Lie group is not known, then the original equation must be factorized [38,39], and the resulting lowerorder ODE must be related to the Lie algebra, from which the corresponding Lie group is determined. In this paper, we establish the validity of the Lie group approach to ODEs of S (beyond the SF ODEs) and demonstrate the existence of limits on the factorization for some ODEs of S.
Finally, the Lagrangian formalism and the Lie group approach, the two independent methods of obtaining the ODEs of S, are compared. The advantages and disadvantages of each method are discussed, and it is shown that the Lagrangian formalism can be established for all considered ODEs; however, the Lie group approach is only limited to some ODEs that form a subsemigroup of S. Applications of the obtained results to selected problems in mathematical physics are also discussed.
The outline of the paper is as follows: a procedure of generating new ODEs in S is described and applied to some ODEs in Section 2; the Lagrangian formulation for all ODEs of S is established by using standard and nonstandard Lagrangians and applied to selected ODEs in Section 3; the Lie group approach and factorization methods are presented in Section 4; comparison between the two methods is discussed in Section 5; and conclusions are given in Section 6.

Commutative Semigroup of Differential Equations
An interesting property of S is that its algebraic operation can be used to generate novel ODEs by simply adding two different elements of the semigroup. Since any two elements (two chosen ODEs) of S can be added up, the results may be rather surprising as shown by a couple of examples below. Let where B 1 ðxÞ, B 2 ðxÞ, C 1 ðxÞ and C 2 ðxÞ are smooth and arbitrary functions, be two operators, and letD 1 yðxÞ = 0 andD 2 yðxÞ = 0 be two ODEs of S. Then, the binary operation of S allows writinĝ where BðxÞ = ½B 1 ðxÞ + B 2 ðxÞ/2 and CðxÞ = ½C 1 ðxÞ + C 2 ðxÞ/2.
Here are some interesting examples. All Bessel (regular, modified, spherical, and modified spherical) equations are elements of S. To add the regular and modified Bessel equations, we have B 1 ðxÞ = B 2 ðxÞ = 1/x, C 1 ðxÞ = 1 − μ 2 /x 2 and C 2 ðxÞ = −ð1 + μ 2 /x 2 Þ, where μ is either real or integer constant, which gives Since the eigenvalue of this equation is λ = 0 (see Section 4), the resulting ODE is neither regular nor modified Bessel equation, but instead, it is known as the Euler equation [1]. Addition of other Bessel equations gives novel Bessel and Euler equations.
To show these novel equations, let a general form of Bessel equation be where BðxÞ = α/x and CðxÞ = βð1 + γμ 2 /x 2 Þ. In addition, α and β are constants, whose values correspond to four Bessel equations and the Euler equation (see Table 1). In addition, μ is either integer or real. Note that the form of Eq. (3) considered here is more general than that used in [10] as it allows reducing the general Bessel equation to the Euler equations (see Table 1). Note that for α = 3/2, a new name "semispherical" was introduced for both Bessel and Euler equations. Additions of Bessel equations required to obtain the Euler equation and the novel equations (see Table 1) are presented in Table 2. It must be pointed out that further additions of the Bessel equations and the derived equations are also possible but not considered here.
Another interesting result is obtained when the regular Legendre equation with B 1 ðxÞ = −2x/ð1 − x 2 Þ and C 1 ðxÞ = lðl + 1Þ/ð1 − x 2 Þ is added up together with the associated where m 2 = m 2 /2. This shows that only the constant m is affected by the addition, but the form of the resulting ODE does not change.
The considered simple examples show that numerous novel ODEs can be generated by using the algebraic operation of the semigroup S. Since the process of adding the elements of S to each other can be carried on ad infinitum, there are infinite different resulting ODEs, and all of them are the elements of S.

Lagrangian Formalism and Its Lagrangians
Let J ½yðxÞ be a functional that depends on an ordinary and smooth function yðxÞ, and let J ½yðxÞ be defined by an integral over a smooth function L, which is called Lagrangian, and depends on y′ðxÞ = dy/dx, y and on x, so Lðy′, y, xÞ. The principle of least action or Hamilton's principle [3] requires that δJ = 0, where δ is the variation defined as the Fréchet derivative of J ½yðxÞ with respect to yðxÞ. Using the condition δJ = 0, the E-L equations are obtained and their solutions give yðxÞ that makes the action stationary. The described procedure is the basis of the classical calculus of variations, and it works well when the Lagrangian Lðy ′ , y , xÞ is either already given or it can be determined for a given physical system.
The basis for the Lagrange formalism is the jet-bundle theory [25,26]. Let X and Y be differentiable manifolds of dimensions m and M + m, respectively, and let π : Y → X be a fibred bundle structure, with π being the canonical projection of the fibration. Let J r m ðYÞ → X be the rth jet bundle, with x ∈ X, y ∈ Y, and r ∈ IN. Then, an ODE of order q is called locally variational (or the E-L type) if, and only if, there exists a local real function L constrainted by the condition q ≤ r. For the ODEs of S, q = 2 and Lðy ′ , y, xÞ is a local Lagrangian. Such local Lagrangians are not unique as other Lagrangians may also exist and they would give the same original equations when substituted into the E-L equations. Now, if Lagrangians are not known, then the problem of finding them is the inverse (or Helmholtz) variational problem [31,32,40]. One of the main goals of this paper is to solve this problem for all ODEs of S.

Standard Lagrangians.
In the previous work [6,7], special forms of standard Lagrangians L s ½y′ðxÞ, yðxÞ, x were derived forDyðxÞ = 0. These results are generalized in Proposition 1 by allowing the Lagrangians to depend on smooth and ordinary functions that are to be determined.

Proposition 1.
Let L s ½y ′ ðxÞ, yðxÞ, x be the standard Lagrangian given by Proof. Substitution of L s ½y′ðxÞ, yðxÞ, x into the E-L equation gives or if f 1 ðxÞ > 0. This E-L equation can be converted into the orig-   For a given physical problem with specified intitial conditions, more constraints on the functions f 2 ðxÞ and f 3 ðxÞ can be imposed. However, in this paper, we keep our analysis general and do not consider any specific physical problem with given initial conditions.
We may use the result of Corollary 3 to define three Lagrangians that play special roles in this paper. In general, many different Lagrangians can be obtained but considering all of them is out of the scope of this paper. Let us begin with the choice of f 2 ðxÞ = 0, which sets f 3 ðxÞ = −CðxÞ. The result is a Lagrangian that is called here the minimal Lagrangian L s,min ½y ′ ðxÞ, yðxÞ, x, and it is defined as It is easy to verify that this Lagrangian is the simplest standard Lagrangian that allows obtaining the original equa-tionDyðxÞ = 0 directly from the E-L equations (6). Let us also point out that the same Lagrangian is obtained when f 2 ðxÞy ′ ðxÞ + f 2 ′ ðxÞyðxÞ/2 = 0, which requires that f 2 ðxÞ depends on yðxÞ and that their relationship is f 2 ðxÞ = ½ a 1 /y 2 ðxÞ 2 , where a 1 is another integration constant.
It is easy to verify that even if the obtained Lagrangians are different they lead to the same original equationDyðxÞ = 0.

Null Lagrangians.
A well-known result is that the difference between two Lagrangians that give the same equation can be written as the total derivative of scalar function Φðy, xÞ [20]. This means that we may write where the functions Φ 1 ðy, xÞ, Φ 2 ðy, xÞ, and Φ 3 ðy, xÞ exist on the configuration manifold M (see Section 2); however, it may not always be possible to find a single-value function on the entire M [20]. Since the null Lagrangians can be added to any Lagrangian without modifying the resulting original equations, we may call them "gauge transformations" in reference to the gauge transformation of electromagnetism. Moreover, the above results demonstrate that the functions Φ 1 ðy, xÞ, Φ 2 ðy, xÞ, and Φ 3 ðy, xÞ are the gauge functions and that they exist [20]. It is easy to find Φ 1 ðyÞ = a 2 y 2 /4 + a 3 , where a 3 is an integration constant; however, the other two functions require BðxÞ to be specified, which will not be done here to keep our approach as general as possible. Important consequences of the fact that the null Lagrangians allow finding the gauge functions are now summarized in the following corollaries.  Journal of Applied Mathematics Finally, let us point out that both L o,mid ½y ′ ðxÞ, yðxÞ, x and L o,max ½y ′ ðxÞ, yðxÞ, x depend on BðxÞ and yðxÞ but are independent of CðxÞ. Since the first-derivative term with its BðxÞ coefficient can be removed fromDyðxÞ = 0 by using the integral transformation given by Proposition 10 (see Section 3.2), the null Lagrangians for such transformed ODEs would be zero. Our results show that with L o,mid ½y′ðxÞ, yðxÞ, x = 0 and L o,mid ½y′ðxÞ, yðxÞ, x = 0, the minimal Lagrangian is the simplest and most fundamental standard Lagrangian for all ODEs of S.

Nonstandard Lagrangians.
We consider nonstandard Lagrangians to be given in the following general form [9,10].
where g 1 ðxÞ, g 2 ðxÞ and g 3 ðxÞ are smooth functions to be determined. Comparing L ns ½y ′ ðxÞ, yðxÞ, x to L s ½y ′ ðxÞ, yðxÞ, x given by Eq. (5), it is seen that both Lagrangians have three arbitrary functions; however, the forms of these Lagrangians are significantly different. Studies of the Lagrangian L ns ½y′ðxÞ, yðxÞ, x previously performed [8] were limited to only a few special cases that allowed uniquely determine the functions g 1 ðxÞ, g 2 ðxÞ, and g 3 ðxÞ. These functions were determined by substituting L ns ½y ′ ðxÞ, yðxÞ, x into the E-L equations. First, it was shown that g 3 ðxÞ separates from the other two functions, and as a result, it can be evaluated independently. Second, the evaluation of g 1 ðxÞ and g 2 ðxÞ is connected, and they can only be obtained if a Riccati equation is solved but neither [7] nor [8] gives the required solutions. Therefore, here, we solve the resulting Riccati equation (9) in the following proposition.

Proposition 6. Let
be the Riccati equation, and let uðxÞ = g 1 ′ðxÞ/g 1 ðxÞ, where g 1 ðxÞ is an arbitrary function of the nonstandard Lagrangian given by Eq. (12). The solution of this Riccati equation is if, and only if, the function vðxÞ satisfiesD vðxÞ = 0.
Having obtained the solution of the Riccati equation, we may use it to calculate the functions g 1 ðxÞ and g 2 ðxÞ and find the following nonstandard Lagrangian where E ns ðxÞ = exp ½−2 Ð BðxÞdx. It is seen that the derived Lagrangian depends explicitly on vðxÞ, which is a solution toD vðxÞ = 0 that becomes an auxiliary condition for the developed Lagrangian formalism based on non-standard Lagrangians.
The obtained nonstandard Lagrangians were previously derived but only for some ODEs whose solutions are special functions of mathematical physics [6,8,10]. Those previous results are here generalized to all ODEs of S. Both standard and nonstandard Lagrangians allow obtaining the original equations; however, the nonstandard Lagrangians lead to a new phenomenon in calculus of variations, which is the requirement of the auxiliary condition in order to obtain DyðxÞ = 0: 3.4. Applications to Bessel and Euler Equations. We now derive Lagrangians for the general Bessel equation given by Eq. (3). More specifically, we find the minimal, middle, and maximal standard Lagrangians using Eqs. (8), (9), and (10), respectively, as well as the nonstandard Lagrangian given by Eq. (18).
The minimal (basic) standard Lagrangian is given by where a 1 = 1 in Eq. (8).
The middle Lagrangian can be written as with a 2 = 1 and L o,mid ½y ′ ðxÞ, yðxÞ, x being a null Lagrangian that does not depend on either α or β.
The maximal Lagrangian is where is another null Lagrangian that depends on α but is independent of β, which is only present in the basic Lagrangian. According to Eq. (18), the nonstandard Lagrangian becomes with the auxiliary conditionD vðxÞ = 0. It is seen that L ns ½y ′ ðxÞ, yðxÞ, x depends on α but does not depend explicitly on β; the β-dependence is only through the solution for vðxÞ. The obtained Lagrangians are expressed in terms of two parameters α and β that uniquely determine whether the considered equation is the Bessel or Euler equation (see Table 1). In other words, the standard and nonstandard Lagrangians for each equation can be obtained from Eqs. (19) through (24) by using the values of α and β given in Table 1.

Helmholtz Conditions.
Our results show that the Lagrangian formalism may be established for all ODEs of S by using either the standard or nonstandard Lagrangians. The existence of the obtained Lagrangians must be validated by the Helmholtz conditions [32]. There are three original Helmholtz conditions and two of them are trivially satisfied. The third condition requires a lot of caution, because its original version shows that no Lagrangian can be constructed for the general form of the ODEs used in this paper, namely, DyðxÞ = 0. It is easy to demonstrate thatDyðxÞ = 0 is inconsistent with the third Helmholtz condition [19].
To fix the problem of validity of the third Helmholtz condition, we substitute either the minimal, middle, or maximal Lagrangian into the E-L equation, and as expected, all three Lagrangians give the same original equation. The resulting ODE is ½DyðxÞE s ðxÞ = 0, and this equation is consistent with the third Helmholtz condition. The problem arises when one more step is performed, namely, dividing the equation by E s ðxÞ, which gives the original ODE, but the resulting ODE violates the third Helmholtz condition; note that in principle, the division can be performed because in general E s ðxÞ ≠ 0. In other words, the third Helmholtz condition tells us that Lagrangian exists for ½DyðxÞE s ðxÞ = 0, but it does not exist forDyðxÞ = 0; however, it is the latter that we want to derive as it is our original equation. Thus, the origin of the inconsistency is clearly demonstrated.
The problem with the nonstandard Lagrangians is more profound because they do allow obtaining the original equation, but the resulting ODE does not obey the third Helmholtz condition. There are a few special cases that may lead to a result that is consistent with this condition. However, for the original equationDyðxÞ = 0, which is derived from the nonstandard Lagrangians, the results remain inconsistent with the third Helmholtz condition. This violation of the third Helmholtz condition is a known phenomenon in the calculus of variations [10].

Special Function Equations.
Linear second-order ODEs whose solutions are special functions (SFs) of mathematical physics are called here the special function equations (SFEs). All SFEs are elements of S and they form a subsemigroup denoted S sf , with S sf ∈ S. There are many applications of SFEs and SFs in applied mathematics, physics, and engineering [2,34]. The Lie group approach provides a unifying perspective of all SFs and their SFEs. Therefore, it is surprising that the approach is not commonly known and that its descriptions can only be found in a very few advanced textbooks of mathematical methods (e.g., [34]) or monographs [35,36] and reviews [37] devoted to this topic.
Using the previously obtained results [21][22][23][24], we find that Bessel and spherical Bessel functions are obtained, respectively, from the Euclidean groups Eð2Þ and Eð3Þ, also known as the ISO(2) and ISO(3) groups. In addition, it was shown that Legendre polynomials and functions are derived, respectively, from unitary groups SUð2Þ and unimodular quasi-unitary groups QUð2Þ. As long as Hermite polynomials and functions are concerned, they can be obtained from Heisenberg H 3 and H 4 groups, respectively.
Let us now demonstrate how the procedure of finding special functions works by selecting the Eð2Þ group, which consists a subgroup of all translations Tð2Þ in R 2 , and a subgroup of all rotations Rð2Þ in R 2 ; thus, the group structure is Eð2Þ = Rð2Þ ⊗ s Tð2Þ, where Tð2Þ is an invariant subgroup. The procedure requires finding a function that transform as one of irreps of a given group; in the previous work [41], such function was found for the Galilean group of the metric; however, here, it is obtained for the Euclidean group Eð2Þ in the following proposition and corollary.
where k ! labels the irreps.
Proof. The action ofT a ! on ϕð r ! Þ is given bŷ where a ! is a translation and r ! = ðx, yÞ. Making the Taylor series expansion of ϕð r ! + a ! Þ, we find Comparing Eq. (27) to Eq. (26), we obtain the following eigenvalue equations which represent the necessary conditions that ϕð r ! Þ transforms as the irreps of Tð2Þ [40]. This concludes the proof. By performing the Fourier-sine and Fourier-cosine expansions of the plane waves of Corollary 8, one finds that each expansion has only two nonzero coefficients, and that one of these coefficients is proportional to J μ ðxÞ, and the other to J −μ ðxÞ, with μ being the label of the coefficients and the resulting SFs being Bessel functions [2,34]. Moreover, the Lie algebra of the Eð2Þ group allows finding the raisingÂ + ðx, μÞJ μ ðxÞ = ½d/dx − ðμ − 1/2Þ/xJ μ ðxÞ = J μ+1 ðxÞ and loweringÂ − ðx, μÞJ μ ðxÞ = ½−d/dx − ðμ − 1/2Þ/xJ μ ðxÞ = J μ−1 ðxÞ operators. Using these operators, the power series expansions for J μ ðxÞ and J −μ ðxÞ, their recurrence relationships, generating functions, and other properties may be obtained, without making any reference to the Bessel equation [35][36][37]. To derive the Bessel equation,Â +Â− J μ ðxÞ = A −Â+ J μ ðxÞ = J μ ðxÞ may be used; however, it must be noted that the resulting ODE is the Bessel equation written in its second canonical form (see Proposition 9).
As described above, the remarkable relationships between Lie groups and the SFs of the ODEs of S sf have been found. The relationships are important as they unified the well-known and commonly used SFs with simple Lie groups used in physics and applied mathematics. To the best of our knowledge, the Lie group approach has only been applied to the ODEs of S sf , and Lie groups for these equations have been identified. However, the semigroup S contains also many other ODEs, which we denote here as S re , with the subscript standing for the remaining ODEs. In general, the solutions of S re are either known, but not given in terms of the SFs, or unknown. In the following, we determine whether the Lie group approach can also be applied to all ODEs of S re , or not.

Remaining
Equations. Now, if a Lie group for a given ODE is not known, then one may factorize the ODE, obtain the eigenvalue equations and the raising and lowering operators [20] that are related to a Lie algebra of infinitesimal group generators from which the corresponding Lie group can be determined [35][36][37]. Using the obtained Lie algebra, the SFs naturally appear as the basis functions of differential operator representations of the algebra. Moreover, once the Lie group is known, its irreps can be found, and if Γ is the matrix of such irreps, then their matrix element γ ij ðgÞ, where g is a group element, becomes proportional to one of the SFs, or to a product of SFs. This shows that the Lie group approach is established only for those ODEs that are factorized. There are many factorization methods (e.g., [38] and references therein); however, only the Infeld and Hull (IH) factorization [39] shows clear relationships to Lie algebra [35][36][37]; therefore, only the IH method will be used in this paper.
We now want to determine whether there are any ODEs of S re that cannot be factorized by using the IH method. Our main results are presented in the following proposition.

Proposition 9.
Not all ODEs of S re can be factorized by using the Infeld and Hull factorization method [39].
Proof. The semigroup S re contains the ODEs of the formD yðxÞ = ½d 2 /dx 2 + BðxÞd/dx + CðxÞyðxÞ = 0. However, in general, the functions BðxÞ, CðxÞ, and yðxÞ may depend on a parameter m that can be either integer or real; thus, we may write the above ODEs asD m yðx, mÞ = ½d 2 /dx 2 + B m ðxÞd/dx + C m ðxÞyðx, mÞ = 0. Let λ be an eigenvalue of the operator D m , so that the corresponding eigenvalue equation becomeŝ D m yðx, mÞ = λyðx, mÞ, or in its explicit form is Following the IH factorization method [39], Eq. (29) is converted into a Sturm-Liouville equation and then cast into its first canonical form, which can be written as The procedure of converting the first canonical form into the second canonical form involves two transformations 7 Journal of Applied Mathematics [39]. Then, the second canonical form of Eq. (30) becomeŝ where zðx, mÞ is the transformed dependent variable yðx, mÞ, rðx, mÞ is given in terms of p m ðxÞ, q m ðxÞ, and w m ðxÞ (see [42] for details). Expressing p m ðxÞ and w m ðxÞ by E s,m ðxÞ and q m ðxÞ in terms of C m ðxÞ and E s,m ðxÞ, we get Having obtained rðx, mÞ, it is shown that Eq. (31) can be factorized if it can be replaced by each of the following equations [42] A andÂ where χðmÞ is a function to be determined from rðx, mÞ [42], andÂ are the raising,Â + , and lowering,Â − , operators that give and if zðλ, mÞ is a solution of Eq. (31). According to IH [39], there are six types of factorization denoted as A, B, C, D, E, and F. For each type, the functions rðx, mÞ, kðx, mÞ, and χðmÞ are given in Table 17 of [39], which shows that the x-dependence of the functions rðx, mÞ and kðx, mÞ is different for each type of factorization; nevertheless, it remains fixed within the same type. Similarly for χðmÞ whose m-dependence is also fixed. However, all three functions depend on some parameters that may change their values from one ODE to another. There are examples of ODEs in Table 17 of [39] that correspond to many known ODEs of S sf and also other examples of ODEs that we would classify as elements of S re . Now, using Eq. (32), the function rðx, mÞ can be obtained for any ODEs of S re . However, since B m ðxÞ and C m ðxÞ are arbitrary functions of x, the function rðx, mÞ may have in principle any form, not necessary one of the forms of rðx, mÞ established by IH for their factorization types [39]; note that rðx, mÞ for each factorization type has its x-dependence fixed. This shows that there are some ODEs of S re that cannot be factorized by the IH method. This concludes the proof.
The detailed calculations of casting the ODEs in their first and second canonical forms are lengthly and involve transformations that lead to a complicated form of rðx, mÞ [42]. We show in the following proposition how these calculations can be significantly simplified.
Proof. Applying the transformation given by Eq. (39) to Eq. (38), we obtain which is the second canonical form of Eq. (38), with Note that the obtained result neither requires casting Eq. (38) into its first canonical form nor using the original IH transformations [39]. This concludes the proof.
The results of Proposition 10 can be used to formulate the following corollaries. It must also be noted that the null Lagrangians are zero for some ODEs of S sf , such as Airy, Hill, Mathieu, Weber, Wittaker, and other similar ODEs.
We also want to point out that the IH factorization of the considered ODEs and the Lie group approach are closely related as shown by the following corollary.
Corollary 13. The Lie group approach can only be established for those ODEs that can be factorized using the IH factorization method [39]. The results of Proposition 9 show that there are some ODEs of S re that cannot be factorized, which means that the Lie group approach cannot be established for these ODEs.
Our description of the Lie group approach showed that only ODEs of S sf can be factorized, and therefore, the Lie group approach can be established for them. We also established that all ODEs of S re can be converted into their second canonical forms, and that the general form of rðx, mÞ for these ODEs can be obtained. Despite the fact that rðx, mÞ can be derived, our results showed that there are some ODEs of S re that cannot be factorized using the IH method [39].

Lagrange Formalism versus Lie Group Approach
In this paper, we have established the Lagrangian formalism based on standard and nonstandard Lagrangians for all ODEs of S and demonstrated that the previously formulated Lie group approach is applicable to only some ODEs of S. Let S LL be a subsemigroup of all ODEs for which both the Lagrange formalism and the Lie group approach are established, and let S L be another subsemigroup of all remaining ODEs for which only the Lagrange formalism is established, with S = S LL ∪ S L . The ODEs of S sf seem to be special as they all belong to S LL , so it would be interesting to find deeper connections between the Lagrange formalism and the Lie group approach for these equations. Similarly, for other ODEs of S re , which are also elements of S LL . Now, for the ODEs of S L , the underlying Lie groups are not yet known, so it would be interesting to find them. Possible solutions to the above problems involve developing the Lagrange formalism jointly with the Lie group approach, which would require replacing the configuration manifold M by a manifold G associated with a given Lie group, so that L : TG → R. The approach guarantees that the resulting Lagrangian L is G-invariant; however, it may require deriving "new" variational principles and "new" Euler-Lagrange equations [43,44]. The resulting invariance of L is its important property that is strongly related to the Lie group G. Actually, the problem may be reversed, and for every known Lagrangian, its invariance with respect to rotations, translations, and boots may indicate the presence of the underlying Lie groups [45,46]. In other words, the groups may be identified by investigating the Lagrangian invariance. Moreover, the invariance of L guarantees that the original equation derived from this Lagrangian preserved the same invariance [47]. It may be also interesting to explore the relevance of the recently discovered particle-like structure of Lie algebra [48] to both the Lagrange formalism and the Lie group approach.
Let us now point out that the null Lagrangians that were identified in this paper as gauge transformations allow finding the gauge functions, and also likely gauge groups underlying these transformations. The latter is not included in our paper as it will be a subject of future explorations. Specifically, it would be of great interest to discovered relationships between the gauge groups and the Lie groups, whose irreps may be used to obtain the ODEs of mathematical physics with the special function solutions.
The above topics are of great importance in mathematical physics, and their exploration may give new connections between the Lagrange formalism and the gauge groups, and the Lie groups for the ODEs of S LL . It may also help finding Lie groups that underlie the ODEs of S L . However, these topics are out of the scope of the present paper, but they will be investigated in future papers.

Conclusions
A set of general second-order linear ordinary differential equations with nonconstant coefficients was considered, and an algebraic structure (binary addition) was added to this set to form a semigroup. An interesting result is that the operation of the semigroup can be used to produce many new differential equations, which are still elements of the semigroup. Among a few presented examples, novel Bessel equations with their zero eigenvalues were obtained and discussed.
The Lagrangian formalism was established for all ODEs of the semigroup. We solved the inverse variational problem for these equations and derived standard and nonstandard Lagrangians. Among the derived standard Lagrangians, we obtained the minimal, middle, and maximal Lagrangians and demonstrated that they are equivalent Lagrangians. Moreover, we showed that the minimal Lagrangian is the simplest and also the most fundamental, and that the other Lagrangians differ by the so-called null Lagrangians from the minimal one. In our analysis of the null Lagrangians, we found out that these Lagrangians correspond to addition of the total derivative of a scalar function, which is a wellknown result in calculus of variations [3,20], and in this paper, it was identified as gauge transformations. We also used the null Lagrangians to determine the gauge functions for all considered ODEs. As long as nonstandard Lagrangians are concerned, our results showed that these Lagrangians require that calculus of variations is amended by auxiliary conditions that are different for different ODEs. This is a novel phenomenon in calculus of variations that is responsible for violation of the third Helmholtz conditions for these Lagrangians.
A Lie group approach was briefly described and compared to the Lagrange formalism established in this paper. The comparison shows that the Lagrange formalism is more robust as it can be applied to all considered equations, and that the Lie group approach is limited to the equations whose solutions are the special functions of mathematical physics and some other similar equations. We identified a 9 Journal of Applied Mathematics subsemigroup of ODEs that cannot be obtained by the Lie group approach. Moreover, we also suggested alternative approaches to establish deeper connections between the Lagrangian formalism based on the standard and nonstandard Lagrangians, the gauge (still to be determined), and the Lie group approach.

Data Availability
All results presented in our paper are easily reproducible by any mathematician or physicist. All what it takes is to follow the steps outlined in the paper, and it is straightforward to derive the presented results. There is no other data in the paper required to be shared.

Conflicts of Interest
The authors declare that they have no conflicts of interest.