Next Article in Journal
Robust Optimization for the Location Selection of Emergency Life Supplies Distribution Centers Based on Demand Information Uncertainty: A Case Study of Setting Transfer Points
Previous Article in Journal
Autonomous Drifting like Professional Racing Drivers: A Survey
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Modified Lagrange Interpolating Polynomial (MLIP) Method: A Straightforward Procedure to Improve Function Approximation

by
Uriel A. Filobello-Nino
1,
Hector Vazquez-Leal
1,*,
Mario A. Sandoval-Hernandez
2,
Jose A. Dominguez-Chavez
1,
Alejandro Salinas-Castro
3,
Victor M. Jimenez-Fernandez
1,
Jesus Huerta-Chua
4,
Claudio Hoyos-Reyes
1,
Norberto Carrillo-Ramon
1 and
Javier Flores-Mendez
5,6
1
Facultad de Instrumentación Electrónica, Universidad Veracruzana, Cto. Gonzalo Aguirre Beltrán s/n, Zona Universitaria, Xalapa 91000, Veracruz, Mexico
2
Centro de Bachillerato Tecnologico Industrial y de Servicios No. 190, Boca del Río 94297, Veracruz, Mexico
3
Centro de Investigación en Micología Aplicada, Universidad Veracruzana, Médicos 5, U.H. del Bosque, Xalapa 91010, Veracruz, Mexico
4
Instituto Tecnológico Superior de Poza Rica, Calle Luis Donaldo Colosio Murrieta S/N, Col. Arroyo del Maíz, Poza Rica 93230, Veracruz, Mexico
5
División de Estudios de Posgrado e Investigación, I.T. Puebla, Tecnológico Nacional de Mexico, Av. Tecnológico No. 420, Maravillas, Puebla 72220, Puebla, Mexico
6
Faculty of Electronics Science Meritorious, University Autonomous of Puebla, 4 Sur 104 Centro, Puebla 72590, Puebla, Mexico
*
Author to whom correspondence should be addressed.
AppliedMath 2025, 5(2), 34; https://doi.org/10.3390/appliedmath5020034
Submission received: 1 February 2025 / Revised: 18 March 2025 / Accepted: 24 March 2025 / Published: 27 March 2025

Abstract

:
This work presents the modified Lagrange interpolating polynomial (MLIP) method, which aims to provide a straightforward procedure for deriving accurate analytical approximations of a given function. The method introduces an exponential function with several parameters which multiplies one of the terms of a Lagrange interpolating polynomial. These parameters will adjust their values to ensure that the proposed approximation passes through several points of the target function, while also adopting the correct values of its derivative at several points, showing versatility. Lagrange interpolating polynomials (LIPs) present the problem of introducing oscillatory terms and are, therefore, expected to provide poor approximations for the derivative of a given function. We will see that one of the relevant contributions of MLIPs is that their approximations contain fewer oscillatory terms compared to those obtained by LIPs when both approximations pass through the same points of the function to be represented; consequently, better MLIP approximations are expected. A comparison of the results obtained by MLIPs with those from other methods reported in the literature highlights the method’s potential as a useful tool for obtaining accurate analytical approximations when interpolating a set of points. It is expected that this work contributes to break the paradigm that an effective modification of a known method has to be lengthy and complex.

1. Introduction

The method of Lagrange interpolating polynomials originated from the need to approximate functions that include information at various points of the function to be approximated in order to obtain additional information at other points in its domain [1]. However, due to the oscillatory behavior of LIPs, particularly for polynomials of high degree, the resulting curves often provide poor approximations of the given function [1]. Furthermore, this oscillatory nature leads to unreliable expressions for the derivative of the approximated function, which constitutes a significant limitation of the method [1,2].
Lagrange interpolating polynomials are approximation polynomials determined by specifying specific points in the plane that the polynomial must pass through. To construct such a polynomial of maximum degree n, we will consider the polynomial that passes through the n + 1 points ( x 0 , f ( x 0 ) ) , ( x 1 , f ( x 1 ) ) , ⋯, ( x n , f ( x n ) ) .
This polynomial is called the nth Lagrange interpolating polynomial, established in the following theorem [1]:
Theorem 1.
Let x 0 , x 1 , . . . , x n be n + 1 distinct numbers (denoted as nodes) and f a function whose values are evaluated at these nodes. Then, there exists a unique polynomial p of degree n, at most, with the property that f ( x k ) = p ( x k ) for each k = 0 , 1 , 2 , . . . , n . This polynomial is given by
p ( x ) = k = 0 n f ( x k ) L n , k ( x ) ,
where k = 0 , 1 , 2 , . . . , n .
and
L n , k ( x ) = ( x x 0 ) ( x x 1 ) ( x x k 1 ) ( x x k + 1 ) ( x x n ) ( x k x 0 ) ( x k x 1 ) ( x k x k 1 ) ( x k x k + 1 ) ( x k x n ) = i = 0 , i k n ( x x i ) ( x k x i ) .
Next, we provide an error bound when approximating a function using an interpolating polynomial, as given by the following theorem:
Theorem 2.
Suppose that x 0 , x 1 , . . . , x n are distinct numbers defined in the interval [ a , b ] and that we have f, a function such that f C n + 1 [ a , b ] . Then, for each x in [ a , b ] , there exists a number ξ ( x ) ( a , b ) :
f ( x ) = p ( x ) + f ( n + 1 ) ( ξ ( x ) ) ( n + 1 ) ! ( x x 0 ) ( x x 1 ) . . . ( x x n ) ,
where p ( x ) is the polynomial defined in Equation (1).
Despite the classical nature of the LIP method, the subject is widely employed not only in textbooks [1,3,4,5,6,7,8] but also in research articles [9,10,11,12,13,14,15,16,17,18,19,20]. Next, we will present a modification to the aforementioned method by introducing an exponential factor, provided with some parameters to be determined in one of the terms of a Lagrange interpolating polynomial.

2. Description of the Proposed Modified Lagrange Interpolating Polynomial (MLIP) Method

This section introduces the MLIP method, aiming to improve upon the Lagrange interpolating polynomial method. Although the proposed method is a straightforward modification of LIPs, it is capable to obtain accurate expressions of lower degree as well as good approximations for the derivative of the proposed function. To achieve this, we begin by modifying (1) as follows:
To obtain a handy modification derived from (1) which incorporates more information (i.e., which includes more points of the considered interval without introducing powers of x greater than (1)), we propose substituting (1) with the following similar expression:
P ( x ) = k = 0 n 1 f ( x k ) L n , k ( x ) + f ( x n ) L n , n ( x ) exp i = 1 M A i ( x m i x i ) ,
where the values of the parameter A i are determined using M coordinates of the function f, and x m is one of the nodes initially proposed for the problem. For simplicity, we have kept the notation P ( x ) for the Lagrange function, although (4) is no longer a polynomial.
It is worth noting that the Lagrange function (4) is simplified to the corresponding LIP which passes through n nodes when the parameters A i are set to zero. Starting with the general case where A i 0 , let us consider, for instance, that given a Lagrange interpolating polynomial of degree n (1), we would like to add three nodes to our approximation without recalculating the expression (1) from the beginning. Let the corresponding coordinates for the additional nodes be ( x 1 , f 1 ( x 1 ) ) , ( x 2 , f 2 ( x 2 ) ) , ( x 3 , f 3 ( x 3 ) ) . We will then establish a linear system of three equations for the three unknowns, A 1 , A 2 , and A 3 , by substituting the mentioned points into the following expression obtained immediately from (4)
A 1 ( x m x ) + A 2 ( x m 2 x 2 ) + A 3 ( x m 3 x 3 ) = ln P ( x ) k = 0 n 1 f ( x k ) L n , k ( x ) f ( x n ) L n , n ( x ) .
Another option to calculate the parameters mentioned above would be to consider the coordinates ( x 1 , f 1 ( x 1 ) ) , ( x 2 , f 2 ( x 2 ) ) and ( x 3 , f 3 ( x 3 ) ) . Here, f ( x ) is the derivative of the function f ( x ) to be represented by the proposed method in the interval of interest. In this case, we calculate the derivative of (4) as follows:
P ( x ) = k = 0 n 1 f ( x k ) L n , k ( x ) + f ( x n ) L n , n ( x ) e A 1 ( x m x ) + A 2 ( x m 2 x 2 ) + A 3 ( x m 3 x 3 ) f ( x n ) ( A 1 + 2 A 2 x + 3 A 3 x 2 ) L n , n ( x ) e A 1 ( x m x ) + A 2 ( x m 2 x 2 ) + A 3 ( x m 3 x 3 ) .
After substituting ( x 1 , f 1 ( x 1 ) ) , ( x 2 , f 2 ( x 2 ) ) and ( x 3 , f 3 ( x 3 ) ) into (6), we obtain an algebraic nonlinear system of equations for the coefficients.
Finally, it is feasible to obtain an analytical approximation for f ( x ) by adjusting the parameters A i such that (4) is exact when assessed at some additional points. Moreover, its derivative adopts exact values when it is evaluated at the same points or, in general, other different points.
Next, we note from Equations (1) and (4) that
p ( x ) P ( x ) = f ( x n ) L n , n ( x ) 1 exp i = 1 M A i ( x m i x i ) ,
where p ( x ) is the n - t h LIP and P ( x ) denotes the corresponding MLIP approximation.
In the same way, it is possible to extend Theorem 2 to provide an error bound criterion for approximating a function using the MLIP function.
Assuming that the conditions of the theorem mentioned above are satisfied, we obtain the following from (3) and (7):
f ( x ) = P ( x ) + f ( x n ) L n , n ( x ) 1 exp i = 1 M A i ( x m i x i ) + f ( n + 1 ) ( ξ ( x ) ) ( n + 1 ) ! ( x x 0 ) . . . ( x x n ) .
We note that both results for the error bound committed to approximating a function differ only in a term. An interesting result can be obtained by adding and subtracting f ( x ) on the left-hand side of (7) to rewrite this equation as follows:
Δ ( x ) = δ ( x ) + f ( x n ) L n , n ( x ) 1 exp i = 1 M A i ( x m i x i ) ,
where we have defined the error functions Δ ( x ) and δ ( x ) as
Δ ( x ) = f ( x ) P ( x ) ,
δ ( x ) = f ( x ) p ( x ) .
Thus, if we construct a Lagrange function by adding M additional nodes from the LIP of n + 1 nodes, then, from the knowledge of (11), it is possible to infer the error committed using P ( x ) once the values of the parameters A i , i = 1 , 2 , , M are determined.
A systematic approach for constructing a Lagrange function begins by formulating a general expression with parameters to be determined. Suppose we are interested in a function that passes through m-nodes x 1 , . . . , x m and n-additional points in the interval of interest. Then,
P ( x ) = A x x 1 x x 2 x x 3 . . . x x m 3 x x m 2 x x m 1 + B x x 1 x x 2 x x 3 . . . x x m 2 x x m + C x x 1 x x 2 x x 3 . . . x x m 3 x x m 1 x x m + . . . + D x x 1 x x 3 . . . x x m 1 x x m e N x P x 2 . . . ( m t e r m s ) ,
where we have chosen, for example, the term that does not contain the factor ( x x 2 ) to multiply it by the exponential e N x P x 2 . . . proposed by the MLIP method. The substitution of nodes x 1 , . . . , x m into (12) results in the following expression:
P ( x ) = y x m x m x 1 x m x 2 . . . x m x m 1 x x 1 x x 2 . . . x x m 1 + y x m 1 x m 1 x 1 x m 1 x 2 . . . x m 1 x m x x 1 x x 2 . . . x x m + y x m 2 x m 2 x 1 x m 2 x 2 . . . x m 2 x m x x 1 x x 2 . . . x x m + y x 2 x 2 x 1 x 2 x 3 . . . x 2 x m x x 1 x x 3 . . . x x m e N x 2 x + P ( x 2 2 x 2 ) + . . . .
As a concrete example, let us consider the case of four nodes and two additional points. In this case, (13) is simplified as follows:
P ( x ) = y x 4 x 4 x 1 x 4 x 2 x 4 x 3 x x 1 x x 2 x x 3 + y x 3 x 3 x 1 x 3 x 2 x 3 x 4 x x 1 x x 2 x x 4 + y x 1 x 1 x 2 x 1 x 3 x 1 x 4 x x 2 x x 3 x x 4 + y x 2 x 2 x 1 x 2 x 3 x 2 x 4 x x 1 x x 3 x x 4 e N x 2 x + P ( x 2 2 x 2 ) .

3. Applications of Modified Lagrange Interpolating Polynomial (MLIP) Method

3.1. Case Study 1

Next, we will obtain approximate expressions for the function
y ( x ) = ln ( x ) ,
defined in [ 1 , 4 ] .
For this purpose, we propose nodes with coordinates ( 1 , 0 ) , ( 2 , ln 2 ) , and ( 4 , ln 4 ) . Given that y ( 1 ) = 0 , we begin with the following slightly different expression from (12).
y ( x ) = L ( x 1 ) + A ( x 4 ) ( x 1 ) e B x C x 2 .
This expression already accounts for the fact that (16) passes through the point ( 1 , 0 ) , and the coefficients L and A are calculated in order for (16) to satisfy the ( 2 , ln 2 ) , and ( 4 , ln 4 ) coordinates.
From y ( 4 ) = ln ( 4 ) , we immediately deduce that
L = 2 ln ( 2 ) 3 ,
Similarly, the condition y ( 2 ) = ln ( 2 ) yields
A = ln ( 2 ) 6 e 2 B + 4 C .
Thus, after substituting (17) and (18) into (16), we obtain
y ( x ) = 2 3 ln ( 2 ) ( x 1 ) 1 6 ln ( 2 ) ( x 4 ) ( x 1 ) e B ( 2 x ) + C ( 4 x 2 ) .
For the specific case where B = C = 0 , (19) is simplified to
p ( x ) = 2 3 ln ( 2 ) ( x 1 ) 1 6 ln ( 2 ) ( x 4 ) ( x 1 ) .
As (20) is a degree-two polynomial that passes through ( 1 , 0 ) , ( 2 , ln 2 ) and ( 4 , ln 4 ) , it is, by Theorem 1, the unique Lagrange interpolating polynomial satisfying these requirements.
Next, we will obtain an approximate function for y ( x ) = ln ( x ) by providing additional information. To this end, we will incorporate the points ( 1.5 , ln 1.5 ) and ( 2.5 , ln 2.5 ) to calculate the values of Parameters B and C in (19).
According to the proposed method, we deduce the following linear system for these parameters by substituting the above points in (19):
0.5 B + 1.75 C = 0.1888170847 , 0.5 B + 2.25 C = 0.1525978127 .
After solving (21), we obtain the following values:
B = 0.6311690734 , C = 0.0724385440 ,
Therefore, by substituting (22) into (19), we obtain
y ( x ) = 2 ln ( 2 ) 3 ( x 1 ) ln ( 2 ) 6 ( x 1 ) ( x 4 ) e 0.6311690734 ( 2 x ) 0.072438544 ( 4 x 2 ) .
We note from Table 1 that (23) is more accurate than the approximation obtained by the Lagrange interpolating polynomial (20). This result looks reasonable given that (23) includes the additional information on the proposed function at two additional points. Thus, with the end goal being to obtain a polynomial approximation with the same information, we include the results obtained for the Lagrange interpolating polynomial (fourth column) passing through the points ( 1 , 0 ) , ( 1.5 , ln 1.5 ) , ( 2 , ln 2 ) , ( 2.5 , ln 2.5 ) , ( 4 , ln 4 ) in Table 1. We find that the results obtained by the proposed method (23) are also better than those obtained with the LIP method.
Table 1 also compares the results obtained by the proposed method with those obtained using other known approximate methods, such as Thiele interpolation, least squares method, and splines, starting from the same initial set of points used to deduce (23). We noted that the MLIP method obtain better results than the least squares method. Although it was more accurate than splines at the beginning of the proposed interval, the splines method performed better at the end of the interval. On the other hand, although the Thiele interpolation method obtained better results than the MLIP method, it is fair to emphasize that the proposed approximation (23) may be calculated without the support of software, highlighting the practical value of the MLIP method. Thus, the proposed method can potentially generalize LIPs to obtain accurate approximations with moderate calculation effort.
According to the explanation in Section 2, the MLIP method is also potentially helpful in obtaining approximations that provide the derivative of the proposed function at points within the interval of interest. To this end, we propose to include, in addition to the five points mentioned above, the derivatives of y ( x ) = ln ( x ) at these points.
The procedure is as follows: First, we will use the flexibility of our method to propose, for instance, seven parameters to evaluate (the five additional parameters include the above-mentioned values of the derivative). Thus, (19) is substituted with
y ( x ) = 2 3 ln ( 2 ) x 1 1 6 ln ( 2 ) ( x 4 ) ( x 1 ) exp B 2 x + C 4 x 2 + D 8 x 3 + E 16 x 4 + F 32 x 5 + G 64 x 6 + H 128 x 7 .
The derivative of (24) is given by
y ( x ) = 2 3 ln ( 2 ) + exp B 2 x + C 4 x 2 + D 8 x 3 + E 16 x 4 + F 32 x 5 + G 64 x 6 + H 128 x 7 · ln ( 2 ) 2 x 5 6 + ln ( 2 ) x 1 x 4 6 B + 2 C x + 3 D x 2 + 4 E x 3 + 5 F x 4 + 6 G x 5 + 7 H x 6 .
Next, we will establish an algebraic system to calculate the parameters of (24) and (25). The first two equations result from substituting the points ( 1.5 , ln 1.5 ) and ( 2.5 , ln 2.5 ) into (24). Next, we substitute y ( x ) by its value 1 / x in (25). From the resulting expression, we obtain five additional equations by successively substituting the values of x = 1 , x = 1.5 , x = 2 , x = 2.5 , and x = 4 .
The numerical solution of the above 7 × 7 algebraic system results in the following approximation (see (24)):
y ( x ) = 2 3 ln ( 2 ) ( x 1 ) 1 6 ln ( 2 ) ( x 4 ) ( x 1 ) exp 1.838354624 ( 2 x ) 1.289109099 ( 4 x 2 ) + 0.707766481 ( 8 x 3 ) 0.262283658 ( 16 x 4 ) + 0.061411666 ( 32 x 5 ) 0.008173907 ( 64 x 6 ) + 0.000469588 ( 128 x 7 )
From Table 1, we note that (26) is indeed precise. In the same table, we add the approximation obtained by using the Leal polynomial (LP) method [21]. The LP method is a powerful technique used to find approximations of functions and approximate solutions for differential equations; this method also utilizes the values of the derivatives at some points within the interval of interest. However, we notice that the proposed approximation in (26) performs better. In fact, (26) achieved the best result of all the presented methods. Figure 1 shows the absolute error in the logarithmic scale, which visually emphasizes the accuracy of the proposed method.
Finally, the average relative errors of the proposed solutions (23) and (26) were 0.014222 and 0.0008495, respectively, which reflects that (26) takes into account the values of the derivative at points within the interval of interest.

3.2. Case Study 2

The MLIP method is applied to generate an analytical approximate solution for the ordinary differential equation (ODE) describing Bratu’s problem.
As is well known, the numerical solution for an ODE consists of a table of values providing y ( x ) and y ( x ) for a set of predetermined values of x. We propose using the MLIP method to obtain an analytical approximation for the ODE that describes Bratu’s problem using its numerical solution, following a similar procedure to the one used in the previous section.
This problem is described by the following differential equation [21,22]:
y ( x ) + ϕ exp ( y ( x ) ) = 0 , 0 x 1 y ( 0 ) = 0 , y ( 1 ) = 0 , ϕ > 0 .
The prime in the above equation denotes differentiation with respect to x, and ϕ is known as the intrinsic parameter of Bratu’s problem.
We can see that (27) has the exact solution [22], as follows:
y ( x ) = 2 ln cosh α cosh ( α ( 1 2 x ) )
where α satisfies equation
cosh α = 4 2 ϕ α
Bratu’s problem is relevant in virtue of its applications: chemical reaction, nano-technology, radiative heat transfer, the fuel ignition model, and it is even applied in the Chandrasekhar model for the expansion of the universe [21]. The first columns of Table 2 and Table 3 correspond to the numerical solutions of (27) for the value ϕ = 3.4 (see Section 4).
In this work, we employ the Traprich method within the Maple dsolve command as a boundary value problem (BVP) solver, leveraging the trapezoidal rule in conjunction with Richardson extrapolation to improve accuracy [23,24].
According to [22], Bratu’s problem, as defined in Equation (27), exhibits a bifurcated solution structure: for each ϕ in the interval 0 < ϕ < ϕ c , there exist two distinct solutions; at the critical value ϕ c = 3.513830719 , there is a single solution; and for ϕ > ϕ c , no solutions exist. In this study, we employ the modified Lagrange interpolating polynomial (MLIP) method to obtain an approximate solution, given by Equation (37), for Bratu’s problem (27) with ϕ = 3.4 , which is a value less than ϕ c . This approximation targets the solution corresponding to the smaller root α = 1.027078 of Equation (29). Therefore, the MLIP method, being an interpolation-based technique, depends on the numerical data provided and can accurately approximate either of the two solutions depending on the input.
Next, we will find an accurate analytical approximate solution for Bratu’s problem using the numerical information obtained from the first columns of Table 2 and Table 3.
According to our method, we propose the following polynomial:
y ( x ) = L x + A ( x 1 ) x ,
and we note that (30) passes through the origin y ( 0 ) = 0 , in accordance with the initial condition from (27). It is not complicated to show that the other end condition y ( 1 ) = 0 is satisfied by taking L = 0 , so that (30) is simplified to
y ( x ) = A ( x 1 ) x .
Next, from (31), we propose the following expression:
y ( x ) = A ( x 1 ) x e B x C x 2 D x 3 E x 4 F x 5 G x 6 H x 7 .
This expression satisfies the boundary conditions of Bratu’s problem, and the parameters A, B, C, ⋯, and H are calculated to obtain a good approximation for (27).
Given that the interval for the problem is [ 0 , 1 ] , we choose the midpoint corresponding to x = 1 / 2 to express A in terms of the other parameters. By evaluating (32) for x = 1 / 2 , we obtain
y ( 1 / 2 ) = A ( 1 / 4 ) e B ( 1 / 2 ) C ( 1 / 4 ) D ( 1 / 8 ) E ( 1 / 16 ) F ( 1 / 32 ) G ( 1 / 64 ) H ( 1 / 128 ) .
By solving for A, we obtain
A = 4 y ( 1 / 2 ) e B ( 1 / 2 ) + C ( 1 / 4 ) + D ( 1 / 8 ) + E ( 1 / 16 ) + F ( 1 / 32 ) + G ( 1 / 64 ) + H ( 1 / 128 ) .
Thus, after substituting (34) into (32), we obtain
y ( x ) = 4 y ( 1 2 ) x ( x 1 ) e B ( 1 2 x ) + C ( 1 4 x 2 ) + D ( 1 8 x 3 ) + E ( 1 16 x 4 ) + F ( 1 32 x 5 ) + G ( 1 64 x 6 ) + H ( 1 128 x 7 ) .
The derivative of (35) is given by
y ( x ) = y ( 1 / 2 ) x ( x 1 ) e B ( 1 / 2 x ) + C ( 1 / 4 x 2 ) + D ( 1 / 8 x 3 ) + E ( 1 / 16 x 4 ) + F ( 1 / 32 x 5 ) + G ( 1 / 64 x 6 ) + H ( 1 / 128 x 7 ) · 2 x + 1 + x 2 x B 2 C x 3 D x 2 4 E x 3 5 F x 4 6 G x 5 7 H x 7 ,
We note that (35) and (36) contain seven unknown quantities: B, C, D, ⋯, and H. Next, we will substitute into (35) the points ( 0.20 , 0.551220884 ) , and ( 0.80 , 0.551220884 ) taken from the first column of Table 2 to generate two algebraic equations. On the other hand, from the first column of Table 3, we will substitute the following points of the form ( x , y ( x ) ) : ( 0 , 3.174730842 ) , ( 0.2 , 2.253529923 ) , ( 0.5 , 4.263877872 ) , ( 0.8 , 2.253529923 ) and ( 1 , 3.174730842 ) into (36) to generate five additional equations, forming a 7 × 7 algebraic system for the unknowns mentioned above. We note that the above points of the form ( x , y ( x ) ) were chosen in such a way that they correspond to the chosen nodal points. After numerically solving the algebraic system, we obtain the following solution for Bratu’s problem:
y ( x ) = 3.63657706 ( x 1 ) x exp 0.135835125 + 0.46693 x 0.24691 x 2 0.10005 x 3 0.79189 x 4 + 0.99199 x 5 0.30741 x 6 0.012724 x 7
From Table 2 and Table 3, we note the good accuracy of (37) and its derivative in describing the proposed problem. In fact, the average relative error turned out to be 0.000933443 and 0.003487342 , respectively. In the same way, the graph from Figure 2 shows what was mentioned before.
Finally, to demonstrate the accuracy of the proposed solution (37), we will compare it with a nine-order Taylor polynomial approximate solution (38) for (27) as follows:
y ( x ) = 3.160707044 x 1.7 x 2 1.791067325 x 3 0.9335931113 x 4 + 0.3232814713 x 5 + 1.074716871 x 6 + 0.8321653219 x 7 0.09330576803 x 8 0.8729045042 x 9
We note that (38) was obtained from a Taylor series method with a shooting technique in order to incorporate it to the problem’s solution for both boundary conditions. Simultaneously, we also calculated the unknown value of y ( 0 ) [25].
From Table 2 and Table 3, we note that although both approximations perform well, the MLIP method provides a better approximation. Figure 3 and Figure 4 show the comparison of the absolute errors between approximations (37) and (38) and their derivatives on a logarithmic scale. The figures demonstrate that the MLIP method offers better performance.

4. Discussion

This work introduced the modified Lagrange interpolating polynomial (MLIP) method to obtain an analytical approximate expression for functions defined in closed intervals. As established, Lagrange interpolating polynomials (LIPs) play an essential role in the interpolating approximate theory. The LIP method is employed to determine polynomials that pass through a predefined number of points located in the plane. A practical advantage of these polynomials is their ease of application; unfortunately, their oscillatory nature often leads to poor approximations for a given function and even for its derivative.
Therefore, this work proposed the MLIP method, which is designed to improve upon the results obtained by the LIP and other methods. With that purpose, this work substituted (1) with the expression defined by (4), which only differs from Lagrange polynomials (LPs) in only one of the terms, which appears multiplied by an exponential function provided with several parameters to be determined (we choose the last term to exemplify the proposed method). We showed that, besides the information contained in an initial set of nodes, it is also possible to increase this information by calculating the above-mentioned parameters so that (4) passes through other points in the definition interval of the problem being solved. Moreover, unlike the LIP method, the MLIP method is useful for adopting the correct values of derivatives at some inner points of the same interval; hence, it is expected that the proposed method would provide good results.
We note that MLIP approximations contain fewer oscillatory terms than those in the Lagrange interpolating polynomial passing through the same number of nodes. In fact, among the many possibilities arising from the richness of the proposed method, the MLIP method offers a relatively easy-to-follow scheme. For instance, suppose that we want to obtain an approximate function for a given proposed function, ensuring that both pass through five common points. In this case, the corresponding LIP approximation would generally include five oscillatory terms of the form (1), resulting in a fourth-degree polynomial. Conversely, the proposed method would have started (for instance) from three nodes. Moreover, for this reason, it would have required a Lagrange-like polynomial of just three terms. Consequently, it is proposed that one of the terms is multiplied for a factor exp ( A x B x 2 ) (see (4)). In this case, three nodes are employed to evaluate the values of the f ( x k ) L n , k ( x ) factors in accordance with the LIP method, and the other two nodes are used to obtain a simple 2 × 2 linear algebraic system to calculate the A and B coefficients by substituting their coordinates in the MLIP approximation.
The proposed method was employed to find an analytical approximation for the y ( x ) = ln ( x ) function in the [ 1 , 4 ] interval. We started by assuming the nodes of coordinates ( 1 , 0 ) , ( 2 , ln 2 ) , and ( 4 , ln 4 ) to be known; next, we used a simple, slightly different expression from (12), given by (16), which already ensures it passes through the point ( 1 , 0 ) . Coefficients L and A are calculated simply in order that (16) satisfies the ( 2 , ln 2 ) and ( 4 , ln 4 ) coordinates. As a result, we obtained (19), and we noted that for the particular case when B = C = 0 , (19) is reduced to a degree-two polynomial, which passes through ( 1 , 0 ) , ( 2 , ln 2 ) and ( 4 , ln 4 ) . Moreover, by Theorem 1, the latter expression is a Lagrange interpolating polynomial.
Next, we obtained (23) by incorporating the points ( 1.5 , ln 1.5 ) and ( 2.5 , ln 2.5 ) to calculate the values of parameters B and C in (19) using an elementary linear algebraic system. As a result, we found that (23) is more accurate than the approximation obtained by the Lagrange interpolating polynomial (20). This higher accuracy can be attributed to the fact that the MLIP approximation incorporates additional information about the function to be represented at two additional points. Thus, in order to make a fair comparison, we included the results obtained for the Lagrange interpolating polynomial, which passes through the same five points ( 1 , 0 ) , ( 1.5 , ln 1.5 ) , ( 2 , ln 2 ) , ( 2.5 , ln 2.5 ) , ( 4 , ln 4 ) (Table 1). We found that the results obtained by the proposed method (23) are also better.
One of the main advantages of the MLIP method with respect to other reported methods is its versatility to provide accurate approximations for the derivative of a given function. With this purpose, we have included, besides of the points mentioned above, the derivatives of y ( x ) = ln ( x ) in these points to evaluate seven parameters corresponding to a 7 × 7 algebraic system.
The numerical solution of this algebraic system resulted in the approximation (26), which, as shown in Table 1, is indeed precise. In order to compare the proposed approximation (26), we added the approximation obtained by using Leal polynomials (LPs) [21]. The LP method is a technique employed in order to find approximations to functions and uses the values of derivatives in some points in the interval of interest. We notice that the proposed approximation (26) displayed better performance. In fact, (26) obtained the best result of all the presented methods.
On the other hand, the MLIP method was also employed to generate an analytical approximate solution for the ordinary differential equation (ODE) describing Bratu’s problem. We emphasized that the numerical solution for an ODE consists of a table of values providing y ( x ) and y ( x ) for a set of predetermined values of x. This work employed the MLIP method to obtain an analytical approximation for the ODE that describes Bratu’s problem using its numerical solution, following a similar procedure to the one used in our previous case study. According to the proposed method, we obtained a polynomial (31) that passes through the origin, in accordance with the initial condition and the other end condition. Next, we proposed expression (32), which includes an exponential function containing seven parameters calculated to achieve an accurate approximation for (27). We chose the midpoint corresponding to x = 1 / 2 to express A in terms of the other parameters (34). From (35) and its derivative, we proposed an algebraic system for seven unknown quantities, B, C, D, E, F, G and H, by substituting values taken from the first columns of Table 2 and Table 3 into (35) and the derivative function (36).
We noted that the employed points of the form ( x , y ( x ) ) were chosen to correspond to the chosen nodal points, ensuring that our approximation provides not only the correct points but also the correct derivative values at the same points. After numerically solving the aforementioned algebraic system, we provided an analytical approximate solution for Bratu’s problem (37).
Table 2 and Table 3 showed the good accuracy of (37) and its derivative in describing the proposed problem, as well as the potential of the MLIP method to provide analytical approximate solutions to differential equations.

5. Conclusions

This article introduced the modified Lagrange interpolating polynomial (MLIP) method in the search of improving the Lagrange interpolating polynomial (LIP) method. Although this method was proposed as a straightforward modification of the LIP method, we note that unlike other methods in the literature, the MLIP method is able to obtain not only precise analytical expressions for a function but also good approximations for the derivative of a proposed function. Furthermore, given that the proposed method incorporates an exponential function that initially includes unknown parameters, which are evaluated to ensure the MLIP approximation passes through several node points, it is expected to obtain approximations with fewer oscillatory terms. Therefore, it can obtain more accurate results compared to LIP approximations with the same number of nodes.
Future research could explore incorporating two or more exponential factors in (4) or even replacing the exponential function with alternative functions, which could enhance the method’s flexibility and accuracy. Another potential improvement lies in the parameter determination process. As the number of nodes and parameters increases, the computational complexity of the method could become significant. To address this challenge, another approach could be to integrate our work with methods such as the variational iteration method [26] or the ancient Babylonian algorithm and its modern applications [27].

Author Contributions

Conceptualization, U.A.F.-N. and H.V.-L.; formal analysis, U.A.F.-N., H.V.-L., M.A.S.-H., J.A.D.-C., A.S.-C., V.M.J.-F., J.H.-C., C.H.-R., N.C.-R. and J.F.-M.; investigation, U.A.F.-N., H.V.-L., M.A.S.-H., J.A.D.-C., A.S.-C., V.M.J.-F., J.H.-C., C.H.-R., N.C.-R. and J.F.-M.; methodology, U.A.F.-N., H.V.-L., M.A.S.-H., J.A.D.-C., A.S.-C., V.M.J.-F. and J.H.-C.; software, M.A.S.-H., J.A.D.-C. and V.M.J.-F.; supervision, H.V.-L. and A.S.-C.; validation, U.A.F.-N., H.V.-L., M.A.S.-H., J.A.D.-C., A.S.-C., J.H.-C., C.H.-R., N.C.-R. and J.F.-M.; visualization, M.A.S.-H., J.A.D.-C., A.S.-C., V.M.J.-F., J.H.-C., C.H.-R., N.C.-R. and J.F.-M.; writing—original draft preparation, U.A.F.-N., H.V.-L. and V.M.J.-F.; writing—review and editing, U.A.F.-N. and H.V.-L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data are contained within this article.

Acknowledgments

The authors would like to acknowledge Roberto Ruiz Gomez for his technical support.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Faires, J.D.; Burden, R.L. Numerical Methods, 3rd ed.; Brooks Cole: Pacific Grove, CA, USA, 2002. [Google Scholar]
  2. Liu, Y.P.; He, J.H. A fast and accurate estimation of amperometric current response in reaction kinetics. J. Electroanal. Chem. 2025, 978, 118884. [Google Scholar] [CrossRef]
  3. Hurtado, A.N.; Sánchez, F.C.D. Métodos Numéricos: Aplicados a la Ingeniería; Grupo Editorial Patria: Puebla, Mexico, 2014. [Google Scholar]
  4. Chapra, S.C.; Canale, R.P. Numerical Methods For Engineers, 5th ed.; McGraw-Hill: New York, NY, USA, 2006. [Google Scholar]
  5. Hamming, R. Numerical Methods for Scientists and Engineers, 2nd ed.; Courier Corporation: North Chelmsford, MA, USA, 2012. [Google Scholar]
  6. Epperson, J. An Introduction to Numerical Methods and Analysis; John Wiley and Sons: Hoboken, NJ, USA, 2021. [Google Scholar]
  7. Griffiths, D.; Higham, D. Numerical Methods for Ordinary Differential Equations: Initial Value Problems; Springer: Berlin/Heidelberg, Germany, 2010; Volume 5. [Google Scholar] [CrossRef]
  8. Zhao, H.; Sun, J.Z.; Wang, F.; Zhao, L. A finite equivalence of multisecret sharing based on Lagrange interpolating polynomial. In Security and Communication Networks; Wiley Online Library: Hoboken, NJ, USA, 2013. [Google Scholar] [CrossRef]
  9. Roy, S.K. Lagrange’s Interpolating Polynomial Approach to solve multi-choice transportation problem. Int. J. Appl. Comput. Math. 2015, 1, 639–649. [Google Scholar] [CrossRef]
  10. Adams, W.P. Use of Lagrange Interpolating Polynomials in the RLT. In Wiley Encyclopedia of Operations Research and Management Science; Cochran, J.J., Ed.; John Wiley and Sons, Inc.: Hoboken, NJ, USA, 2010. [Google Scholar]
  11. Errrachid, M.; Essanhaji, A.; Messaondi, A. RMVPIA: A new algorithm for computing the Lagrange multivariate polynomial interpolation. Numer. Algorithms 2020, 84, 1507–1534. [Google Scholar] [CrossRef]
  12. Wilson, L.; Vaughn, N.; Krasny, R. A GPU-accelerated fast multipole method based on barycentric Lagrange interpolation and dual tree traversal. Comput. Phys. Commun. 2021, 265, 108017. [Google Scholar] [CrossRef]
  13. Ide, N.A.D. Using Lagrange interpolation for solving nonlinear algebraic equations. Eng. Math. 2016, 1, 39–43. [Google Scholar]
  14. Yadav, O.P.; Sahu, A.K. Electrocardiogram estimation using Lagrange interpolation. Electron. Lett. 2021, 57, 169–172. [Google Scholar] [CrossRef]
  15. Zhou, S.P. Simultaneous Lagrange Interpolating Approximation Need Not Always Be Convergent. Constr. Approx. 1994, 10, 87–93. [Google Scholar] [CrossRef]
  16. Ibrahim, S. Application of Lagrange Interpolation Method to Solve First-Order Differential Equation Using Newton Interpolation Approach. Eurasian J. Sci. Eng. 2023, 9, 89–98. [Google Scholar] [CrossRef]
  17. Wang, M.F.; Au, F. Precise integrations methods based on Lagrange Piecewise Interpolation Polynomials. Int. J. Numer. Methods Eng. 2009, 77, 998–1014. [Google Scholar] [CrossRef]
  18. Marzaban, H.; Hoseini, S.; Razzaghi, M. Solution of Volterra’s populations model via block-pulse functions and Lagrange interpolating polynomials. Math. Methods Appl. Sci. 2009, 32, 127–134. [Google Scholar] [CrossRef]
  19. Chen, G.; Liu, J.; Wang, L. Color Image Sharing Method Based on Lagrange’s Interpolating Polynomial. In Health Information Science; He, J., Liu, X., Krupinski, E.A., Xu, G., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2012; Volume 7231, pp. 63–75. [Google Scholar] [CrossRef]
  20. Senapati, M.K.; Pradhan, C.; Nayak, P.K.; Samantaray, S.R. Lagrange Interpolating Polynomial based deloading control scheme for variable speed wind turbines. Int. Trans. Electr. Energy Syst. 2019, 29, e2824. [Google Scholar] [CrossRef]
  21. Vazquez-Leal, H.; Sandoval-Hernandez, M.A.; Filobello-Nino, U. The novel family of transcendental Leal-functions with applications to science and engineering. Heliyon 2020, 6, e05418. [Google Scholar] [CrossRef] [PubMed]
  22. Mohsen, A. A simple solution of the Bratu problem. Comput. Math. Appl. 2014, 67, 26–33. [Google Scholar] [CrossRef]
  23. Ascher, U.M.; Mattheij, R.M.M.; Russell, R.D. Numerical Solution of Boundary Value Problems for Ordinary Differential Equations; Classics in Applied Mathematics; SIAM: Philadelphia, PA, USA, 1995; p. xxv×593. [Google Scholar] [CrossRef]
  24. Ascher, U.M.; Petzold, L.R. Computer Methods for Ordinary Differential Equations and Differential-Algebraic Equations; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 1998. [Google Scholar] [CrossRef]
  25. Vazquez-Leal, H.; Sandoval-Hernandez, M.; Castaneda-Sheissa, R.; Filobello-Nino, U.; Sarmiento-Reyes, A. Modified Taylor solution of equation of oxygen diffusion in a spherical cell with Michaelis-Menten uptake kinetics. Int. J. Appl. Math. Res. 2015, 4, 253–258. [Google Scholar] [CrossRef]
  26. He, J.H. Variational iteration method—A kind of non-linear analytical technique: Some examples. Int. J.-Non-Linear Mech. 1999, 34, 699–708. [Google Scholar] [CrossRef]
  27. He, J.H. An Old Babylonian Algorithm and Its Modern Applications. Symmetry 2024, 16, 1467. [Google Scholar] [CrossRef]
Figure 1. Comparison of the absolute error in the logarithmic scale for the shown methods.
Figure 1. Comparison of the absolute error in the logarithmic scale for the shown methods.
Appliedmath 05 00034 g001
Figure 2. Comparison between the numerical solution of Bratu´s problem and the approximate solution (37).
Figure 2. Comparison between the numerical solution of Bratu´s problem and the approximate solution (37).
Appliedmath 05 00034 g002
Figure 3. Comparison of the absolute error between the approximate solution (37) and Taylor approximation (38) on a logarithmic scale.
Figure 3. Comparison of the absolute error between the approximate solution (37) and Taylor approximation (38) on a logarithmic scale.
Appliedmath 05 00034 g003
Figure 4. Comparison of the absolute error for the derivatives of (37) and Taylor (38) on a logarithmic scale.
Figure 4. Comparison of the absolute error for the derivatives of (37) and Taylor (38) on a logarithmic scale.
Appliedmath 05 00034 g004
Table 1. Comparison of the proposed approximation (26) versus other approximations from the literature.
Table 1. Comparison of the proposed approximation (26) versus other approximations from the literature.
xLn(x)(20)(23)LIP Passing Through Five NodesThiele InterpolationLeast Squares MethodSplines(26)Leal Polynomial [21]
1.20.1823215560.1571133600.1814659700.1806834900.1822243320.1288510000.1714591840.1823230630.182326443
1.70.5306282510.5094631770.5308711130.5311755970.5306476080.5827913130.533618340.5306284260.530628954
2.20.7884573600.8040507290.7882568760.7879396140.7884453920.6594098510.7877234450.7884575250.788458127
2.70.9932517731.0408760160.9938669110.9950296320.9932803232.0347783420.9932963700.9932537670.993262355
3.01.0986122881.1552453001.1007549961.1051643831.0986987517.2248705521.0975782651.0986397161.098768749
3.51.2527629681.2996509631.2570942491.2670602351.25290295028.5440062371.2493222101.2528963351.253608595
Table 2. Comparison of the numerical solution of (27), the proposed solution (37) and the nine-order Taylor polynomial approximate solution of (27).
Table 2. Comparison of the numerical solution of (27), the proposed solution (37) and the nine-order Taylor polynomial approximate solution of (27).
x y ( x ) (37)(38)
0000
0.10.298583790.2985900870.297190666
0.20.551220880.5512130180.548501319
0.30.744898450.744892840.741018925
0.40.867238830.8672397480.862540412
0.50.909142650.9091442650.904447458
0.60.867238830.8672400010.864771632
0.70.744898450.7448924470.749705070
0.80.551220880.551212610.570507225
0.90.298583780.2985883540.331136834
1.0000
Table 3. Comparison of the numerical solution for the derivative of (27), the derivative for proposed solution (37) and the Taylor polynomial approximation for the derivative of (38).
Table 3. Comparison of the numerical solution for the derivative of (27), the derivative for proposed solution (37) and the Taylor polynomial approximation for the derivative of (38).
x y ( x ) Derivative (37)Derivative of (38)
03.1747308423.1746828783.160707044
0.12.7772047682.7771103532.763472447
0.22.2535299232.2534467442.240896836
0.31.5989273441.5990144661.588620933
0.40.8322720530.8322987640.826893790
0.500.0000301200.007643290
0.6−0.832272053−0.832301972−0.790433990
0.7−1.598927344−1.599020127−1.490226272
0.8−2.253529923−2.253444516−2.082633859
0.9−2.777204768−2.777145209−2.748868191
1.0−3.174730842−3.174479705−4.059588223
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Filobello-Nino, U.A.; Vazquez-Leal, H.; Sandoval-Hernandez, M.A.; Dominguez-Chavez, J.A.; Salinas-Castro, A.; Jimenez-Fernandez, V.M.; Huerta-Chua, J.; Hoyos-Reyes, C.; Carrillo-Ramon, N.; Flores-Mendez, J. Modified Lagrange Interpolating Polynomial (MLIP) Method: A Straightforward Procedure to Improve Function Approximation. AppliedMath 2025, 5, 34. https://doi.org/10.3390/appliedmath5020034

AMA Style

Filobello-Nino UA, Vazquez-Leal H, Sandoval-Hernandez MA, Dominguez-Chavez JA, Salinas-Castro A, Jimenez-Fernandez VM, Huerta-Chua J, Hoyos-Reyes C, Carrillo-Ramon N, Flores-Mendez J. Modified Lagrange Interpolating Polynomial (MLIP) Method: A Straightforward Procedure to Improve Function Approximation. AppliedMath. 2025; 5(2):34. https://doi.org/10.3390/appliedmath5020034

Chicago/Turabian Style

Filobello-Nino, Uriel A., Hector Vazquez-Leal, Mario A. Sandoval-Hernandez, Jose A. Dominguez-Chavez, Alejandro Salinas-Castro, Victor M. Jimenez-Fernandez, Jesus Huerta-Chua, Claudio Hoyos-Reyes, Norberto Carrillo-Ramon, and Javier Flores-Mendez. 2025. "Modified Lagrange Interpolating Polynomial (MLIP) Method: A Straightforward Procedure to Improve Function Approximation" AppliedMath 5, no. 2: 34. https://doi.org/10.3390/appliedmath5020034

APA Style

Filobello-Nino, U. A., Vazquez-Leal, H., Sandoval-Hernandez, M. A., Dominguez-Chavez, J. A., Salinas-Castro, A., Jimenez-Fernandez, V. M., Huerta-Chua, J., Hoyos-Reyes, C., Carrillo-Ramon, N., & Flores-Mendez, J. (2025). Modified Lagrange Interpolating Polynomial (MLIP) Method: A Straightforward Procedure to Improve Function Approximation. AppliedMath, 5(2), 34. https://doi.org/10.3390/appliedmath5020034

Article Metrics

Back to TopTop