Research Article | | Peer-Reviewed

Versatility of the Generalized Lagrange Interpolation Formula in the Matrix Form

Received: 13 October 2025     Accepted: 8 November 2025     Published: 20 January 2026
Views:       Downloads:
Abstract

In this paper, a generalized Lagrange interpolation formula expressed in matrix form is developed to systematically expand a sampled function with enhanced flexibility and computational rigor. The proposed formulation employs appropriate coordinate functions that not only satisfy prescribed boundary conditions but also exploit the symmetry or anti-symmetry inherent in the function under consideration. When such conditions are absent, the coordinate functions naturally degenerate into polynomial bases, thereby reproducing the classical Lagrange interpolation as a special case. The expansion coefficients are efficiently obtained through the collocation method, ensuring numerical simplicity and stability. The matrix-based generalized Lagrange interpolation exhibits substantial versatility beyond traditional interpolation tasks. It can be readily applied to numerical differentiation and integration under both uniform and non-uniform sampling schemes. Moreover, the approach proves useful in solving ordinary differential equations with specified boundary constraints, as well as in problems involving root-finding and extremum detection of functions. Numerical experiments demonstrate the accuracy and robustness of the proposed method, revealing a marked reduction in the Runge phenomenon even when the number of sampling points is limited. The results further indicate that computational efficiency and precision improve progressively as the number of samples increases. Overall, the generalized interpolation framework developed herein provides a unified and reliable computational tool for interpolation, differentiation, integration, and boundary-value problems, thereby offering broad potential for applications in numerical analysis and scientific computing.

Published in American Journal of Applied Mathematics (Volume 14, Issue 1)
DOI 10.11648/j.ajam.20261401.13
Page(s) 14-26
Creative Commons

This is an Open Access article, distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution and reproduction in any medium or format, provided the original work is properly cited.

Copyright

Copyright © The Author(s), 2026. Published by Science Publishing Group

Keywords

Lagrange Interpolation, Numerical Differentiation, Numerical Integration, Boundary Condition, Runge Phenomenon

1. Introduction
In the field of numerical analysis, interpolation methods are frequently employed for function approximation, numerical differentiation, and numerical integration. A wide variety of interpolation techniques are commonly used, including interpolation formulas for non-uniform nodes , uniform node interpolation formulas , linear interpolation methods , the Lagrange's interpolation formula, and spline interpolation . Most of these interpolation formulas impose strict requirements on the number of sampling points and necessitate that the intervals between points be regular. A possible approach for performing numerical differentiation and integration with irregular intervals is the Lagrange's interpolation formula.
Lagrange's interpolation formula is a classical interpolation method that constructs a polynomial to approximate the function values at a given set of data points. For a given set of n samples at x1, x2,,xn, Lagrange's interpolation formula is
yx=k=1nj=1jknx-xjxk-xjyk.(1)
Differentiating equation (1) with respect to x once and twice gives the first-order and second-order derivatives:
y'(x)=k=1nddxj=1jknx-xjxk-xjyk,
y''(x)=k=1nd2dx2j=1jknx-xjxk-xjyk.(2)
Integrating equation (1) with respect to x from a to b gives the definite integral:
abyxdx=k=1nabj=1jknx-xjxk-xjykdx.(3)
Lagrange's interpolation formula can perform differentiation and integration when intervals are irregular, and it can accommodate an arbitrary number of sampling points. However, it is obvious that each process is very tedious and such an operation is seldom applied.
To address this issue, Wang proposed the Lagrange interpolation in the matrix form using the Vandermonde matrix. Through practical examples, it was shown that this matrix formulation not only retains the adaptability of the original interpolation formula with respect to interval length and the number of sampling points, but also achieves higher computational efficiency and numerical accuracy in differentiation, integration, and extremum determination.
However, whether the interpolation formula takes the matrix form or the polynomial form, the Runge phenomenon inevitably occurs when approximating certain types of functions on equidistant grids, rendering numerical results unreliable near the endpoints of the interpolation interval. The Runge phenomenon refers to the substantial oscillation and numerical instability exhibited by high-order polynomial interpolation functions near interval endpoints, especially when interpolating functions characterized by high-order derivatives or significant curvature. Furthermore, when equally spaced interpolation nodes are used, increasing the interpolation order exacerbates oscillations, resulting in significant interpolation errors.
The Runge phenomenon was first identified by the German mathematician Carl Runge in 1901. To illustrate, consider the following function:
yx=11+5x+10x2,   -1x1.(4)
Select n equally spaced sampling points over the interval -1x1:
xi=-1+2in-1,   i=0, 1, 2, , n-1.
The results obtained using the classical Lagrange interpolation are shown in Figure 1 for n=5, 7, 9, and 11. It is clearly observed that there are large oscillations and divergence, especially close to the boundaries of the interval, in the results of the classical Lagrange interpolation. As n increases, the oscillations and divergence do not improve but exacerbate.
Figure 1. Illustration of the Runge phenomenon.
To resolve the issue of Runge phenomenon, some methods have been successively proposed over the past decades . The Tikhonov regularization method was proposed by Boyd , in which the polynomial approximation was constructed by minimizing a weighted sum of the interpolation residual and a smoothness norm. Compared to conventional equidistant interpolation, the pointwise error was reduced by up to a factor of approximately 20,000. Subsequently, various single-interval polynomial interpolation approaches , such as Tikhonov regularization, Fourier extension, and Gaussian radial basis functions methods, were comparatively analyzed . These techniques typically control endpoint oscillations in high-order polynomial interpolations by incorporating regularization, improving node distribution, constructing over-determined systems, or utilizing smoother basis functions. Although numerical experiments demonstrated their high approximation accuracy, these methods still faced theoretical and efficiency challenges due to limitations such as low computational efficiency and numerical ill-conditioning.
Instead of relying on polynomial interpolation to overcome the Runge phenomenon, an immune genetic algorithm-based optimal parameter searching method was proposed by Lin and Sun . This method searches for an optimal parameter sequence that minimizes an energy function, thereby constructing parametric curves that avoid Runge oscillations. However, genetic algorithms generally suffer from parameter sensitivity, uncertainty in stochastic convergence, high computational costs, and limited scalability, which restrict their applicability in practical engineering applications.
The objective of this study is to eliminate Runge oscillations by proposing a generalized Lagrange interpolation formula in the matrix form. Within this framework, suitable coordinate functions are selected according to the characteristics of the target function, enabling the interpolation formula to possess similar properties, which leads to enhanced computational versatility, accuracy and efficiency, and significantly improving convergence near the interval boundaries. The proposed method is readily applicable to numerical computations in engineering practice.
In Section 2, the generalized Lagrange interpolation is described in detail, numerical methods for even and odd target functions, and the use of classical normal modes in free vibration of beams as coordinate functions are provided. The proposed method effectively eliminates the Runge phenomenon and is equally applicable to numerical differentiation, integration, root-finding, and determining extrema. To validate the effectiveness of the proposed method, six numerical examples are presented in Section 3 to demonstrate the versatility, efficiency, and accuracy of the method. Some conclusions are drawn in Section 4.
2. Formulation
2.1. Generalized Lagrange Interpolation in the Matrix Form
Let yx be a single-valued smooth function of variable x. If φkx,  k=1, 2, ..., is a set of basis (coordinate) functions suitable for yx, then yx can be expanded in terms of the basis functions as
yx=k=1akφkx.(5)
In practice, only n terms in the expansion are used, resulting in an approximation of function yx:
yx=k=1akφkx=φ1x  φ2x   φnxa1a2an,(6)
the n coefficients ak,  k=1, 2, ..., n, can be estimated from a set of n samples, which are taken at n distinct points x1<x2<<xn to be obtain the corresponding values y1, y2, ..., yn of the function. This set of n samples leads to a system of n linear algebraic equations
yx1=y1=a1φ1x1+a2φ2x1++anφnx1.yx2=y2=a1φ1x2+a2φ2x2++anφnx2.yxn=yn=a1φ1xn+a2φ2xn++anφnxn.(7)
Solving for the unknown coefficients a1,a2,,an, the expansion (6) can be written in the matrix form as
yx=φ1x  φ2x   φnxVs-1ys,(8)
Vs=φ1x1φ2x1φ1x2φ2x2φnx1φnx2φ1xnφ2xnφnxn,
ys=y1y2yn.(9)
Equation (8) is the generalized Lagrange interpolation in the matrix in terms of the coordinate functions φ1x,  φ2x, ,  φnx. The derivatives of yx can be easily obtained by differentiating equation (8) with respect to x:
y'x=φ1'x  φ2'x   φn'xVs-1ys,(10)
y''x=φ1''x  φ2''x   φn''xVs-1ys.(11)
The definite integral of yx between a and b can also be easily obtained by integrating equation (8) from a to b:
abyxdx=abφ1xdx  abφ2xdx   abφnxdxVs-1ys,
where Vs denotes the generalized Vandermonde matrix. Depending on the characteristics of function yx, suitable coordinate functions φ1x,  φ2x, ,  φnx can be selected so that the generalized Lagrange interpolation is more efficient and more accurate. Some cases are discussed in the following subsections.
2.2. Classical Lagrange Interpolation in the Matrix Form
In the absence of any prescribed conditions, yx can be represented by a polynomial of degree n-1, i.e., the coordinate functions φkx=xk-1,
yx=k=1akxk-1=1  x  x2   xn-1a1a2an.(12)
For a sample of size n:x1,y1,x2,y2,,xn,yn, equation (12) can be written in the matrix form as
yx=1  x  x2   xn-1Vs-1ys,(13)
Vs=1x11x2x12x1n-1x22x2n-11xn       xn2xnn-1,
ys=y1y2yn(14)
Equation (13) is the classical Lagrange interpolation in matrix form, which applies to an asymmetric set of data points subject only to the condition of belonging to L2. A detailed study of Lagrange interpolation in the matrix form is presented by Wang et al. .
2.3. Even Target Functions
When function yx is an even function, i.e., y-x=yx, polynomials of even powers can be employed as coordinate functions, i.e., φkx=x2k-1, to yield
yx=1  x2  x4   x2n-1Vs-1ys,(15)
Vs=1x121x22x14x12n-1x24x22n-11xn2       xn4xn2n-1,
ys=y1y2yn.(16)
The corresponding first and second numerical derivatives, and the definite integral are given by
y'(x)=0  2x  4x3   2n-2x2n-3Vs-1ys,(17)
y''(x)=0  2  12x2   2n-22n-3x2n-4Vs-1ys,(18)
abyxdx=b-a   b3-a33    b2n-1-a2n-12n-1Vs-1ys.(19)
2.4. Odd Target Functions
If function yx is an odd function, i.e., y-x=-yx, polynomials of odd powers can be employed as coordinate functions, i.e., φkx=x2k-1. The generalized Lagrange interpolation and the corresponding derivatives and the definite integral are
yx=x  x3  x5   x2n-1Vs-1ys,(20)
Vs=x1x13x2x23x15x12n-1x25x22n-1xnxn3       xn5xn2n-1,
ys=y1y2yn,(21)
y'(x)=1  3x2  5x4   2n-1x2n-2 Vs-1ys,(22)
y''(x)=0  6x   2n-12n-2x2n-3 Vs-1ys,(23)
abyxdx=b2-a22   b4-a44    b2n-a2n2nVs-1ys.(24)
2.5. Classical Normal Modes
When yx satisfies certain boundary conditions, such as the deflections of supported beams, the classical normal modes of a prismatic beam of length L can be employed as coordinate functions because they inherently satisfy the relevant boundary conditions:
1) Choose the free vibration modes of a simply supported beam to satisfy φk0=φkL=0 and φk''0=φk''L=0.
2) Choose the free vibration modes of a clamped beam to satisfy φk0=φkL=0 and φk'0=φk'L=0.
3) Choose the free vibration modes of a cantilever beam to satisfy φk0=φk'0=0 and φk''L=φk'''L=0.
Additional boundary configurations can be handled analogously, and details of these classical normal modes are provided by Blevins . An example using the free vibration modes of a clamped beam as coordinate functions is presented in Section 3.6.
3. Numerical Examples
In this section, six examples are presented to illustrate the versatility and superiority of the method of generalized Lagrange interpolation in the matrix form.
3.1. Example 1 - Even Functions
Consider an even function yx=cosπx as the target function. Because uniformly spaced sampling points offer high efficiency and accuracy, five sampling points with regular intervals are listed in Table 1. The exact first-order derivatives of yx at x=0.1, 0.2, 0.3, 0.4, 0.5 are given in Table 2, and the definite integral of the function over the interval [0, 0.5] is
abcosπxdx=0.3193098862.
These results are used to assess the efficiency and accuracy of the results obtained using the proposed method.
Table 1. Five sampling points with regular intervals.

x

0.000

0.125

0.250

0.375

0.500

y

1.00000

0.92388

0.70711

0.38268

0.00000

Table 2. Exact values of the first-order derivative.

x

0.1

0.2

0.3

0.4

0.5

y'

−0.97081

−1.84658

−2.54160

−2.98783

−3.14159

3.1.1. Using the Classical Lagrange Interpolation
By using the sampling points at x=0, 0.125, 0.375, 0.5 and applying equation (14), the corresponding Vandermonde matrix Vs and the vector ys are
Vs=10.0000.000000.000000.0000010.1250.015630.001950.0002410.2500.062500.015630.0039110.3750.140630.052730.0197810.5000.250000.125000.06250,
ys=1.000000.923880.707110.382680.00000,Vs-1ys=1.000000.00887-5.076190.718372.79703.
Differentiating equation (13) with respect to x, the first-order derivative can be determined
y'(x)=0  1  2x  3x2  4x3 Vs-1ys.
The results of numerical differentiation using the classical Lagrange interpolation are compared with the exact values in Table 3. The relative error ranges from -0.37% to 0.29%, and it increases as the evaluation point approaches the domain boundary. Integrating equation (13) with
respect to x, the definite integral is determined as
I=00.5cosπxdx=0.5  0.522  0.533 0.544  0.555 Vs-1ys=0.3183072014.
The error between the numerical integral and the exact value is −0.00084%.
Table 3. Numerical differentiation error of classical Lagrange interpolation.

x

0.1

0.2

0.3

0.4

0.5

Exact values

−0.97081

−1.84658

−2.54160

−2.98783

−3.14159

Numerical values

−0.97363

−1.84589

−2.54080

−2.99122

−3.13002

Error (%)

0.2905

−0.0374

−0.0315

0.1135

−0.3683

3.1.2. Using the Generalized Lagrange Interpolation
By using the sampling points at x= 0, 0.125, 0.25, 0.375, 0.5 and applying equation (16), the corresponding Vandermonde matrix Vs and the vector ys are
Vs=10.000000.000000.0000000.0000010.015630.000243.81×10-65.96×10-810.062500.003910.0002401.53×10-510.140630.019780.0027800.0003910.250000.062500.0156250.00391,
ys=1.000000.923880.707110.382680.00000,Vs-1ys=1.00000-4.934804.05863-1.333600.22352.
Using equation (17), the first-order derivative can be determined, and the numerical results of generalized Lagrange interpolation are compared with the corresponding exact values in Table 4. When the exact differentiation solution is provided to five decimal places, the proposed method produces results that match up to four to five decimal places. The definite integral is determined from equation (19) as
I=00.5cosπxdx=0.5  0.533  0.555 0.577  0.599 Vs-1ys=0.3183098600,
with a relative error of −0.000008%.
Table 4. Numerical differentiation error of generalized Lagrange interpolation.

x

0.1

0.2

0.3

0.4

0.5

Exact values

−0.97081

−1.84658

−2.54160

−2.98783

−3.14159

Numerical values

−0.97081

−1.84658

−2.54160

−2.98784

−3.14156

Error (%)

0

0

0

3.35×10-4

-9.55×10-4

The values of relative error demonstrate that the generalized Lagrange interpolation delivers markedly higher accuracy for both differentiation and integration than the classical method.
3.2. Example 2 - Odd Functions
Consider the odd function yx=tanhx. Six sampling points with regular intervals are listed in Table 5, and the exact first-order derivatives of yx at x=0.1, 0.3, 0.5, 0.7, 0.9 are given in Table 6. The definite integral of the function over the interval [0,1] is
01tanhxdx=0.4337808305.
Table 5. Six sampling points with regular intervals.

x

0.0

0.2

0.4

0.6

0.8

1.0

y

1.00000

0.92388

0.70711

0.38268

0.00000

0.76159

Table 6. Exact values of the first-order derivative.

x

0.1

0.3

0.5

0.7

0.9

y'

0.99007

0.91514

0.78645

0.63474

0.48692

3.2.1. Using the Classical Lagrange Interpolation
When the six sampling points at x= 0, 0.2, 0.4, 0.6, 0.8, 1.0 are used, the corresponding Vandermonde matrix Vs and the vector ys are
Vs=10.00.000.0000.00000.0000010.20.040.0080.00160.0003210.40.160.0640.02560.0102410.60.360.2160.12960.0777610.80.640.5120.40960.3276811.01.001.0001.00001.00000,
ys=0.000000.197380.379950.537050.664040.76159,Vs-1ys=0.000000.997850.02484-0.436570.19388-0.01841.
The numerical derivatives and integral are summarized in Table 7; it is seen that the relative error ranges from -0.05% to 0.04%. Similar to the case of even functions, the accuracy of numerical results deteriorates near the domain boundaries. The numerical integral is given by
I=01tanhxdx=1   12    13   14   15 Vs-1ys=0.4337712577,
and the relative error between numerical integral and the exact value is −0.0022%.
Table 7. Numerical differentiation using the classical Lagrange interpolation.

x

0.1

0.3

0.5

0.7

0.9

Exact values

0.99007

0.91514

0.78645

0.63474

0.48692

Numerical values

0.99049

0.91507

0.78645

0.63478

0.48667

Error (%)

0.0424

−0.0077

0

0.0063

−0.0513

3.2.2. Using the Generalized Lagrange Interpolation
When the generalized Lagrange interpolation for an odd target function is applied, the condition that y0=0 is implicitly used. As a results, only five sampling points at x= 0.2, 0.4, 0.6, 0.8, 1.0 are used, and the corresponding Vandermonde matrix Vs and the vector ys are
Vs=0.20.0080.000321×10-55×10-70.40.0640.010240.001640.000260.60.2160.077760.027990.010080.80.5120.327680.209720.134221.01.0001.000001.000001.00000,
ys=0.197380.379950.537050.664040.76159,  Vs-1ys=0.99999-0.333110.13127-0.046520.00997.
Using equation (22), the numerical derivatives are evaluated, and the results are presented in Table 8, in which the relative errors range from -0.045% to 0.0032%. From equation (24), the numerical integral is
I=01tanhxdx= 12   14   16   18   110 Vs-1ys=0.4337782661,
and the relative error is -0.0006%. These results demonstrate a clear advantage in accuracy of the generalized Lagrange interpolation over the classical Lagrange interpolation method.
Table 8. Numerical differentiation using the generalized Lagrange interpolation.

x

0.1

0.3

0.5

0.7

0.9

Exact values

0.99007

0.91514

0.78645

0.63474

0.48692

Numerical values

0. 99007

0. 91514

0.78644

0.63476

0.48670

Error (%)

0

0

-1.27×10-5

0.0032

-0.0452

3.3. Example 3 - Root of a Function
Consider the even function yx=cosx-x2. The exact root of yx within the interval [0, 1] is x=0.824132312, which serves as a reference for evaluating the efficiency and accuracy of the results obtained using the proposed method.
The Taylor series expansion of the function yx is
yx=cosx-x2=1-32x2+14!x4+οx66!.
It shows that if a three-point generalized Lagrange interpolation for even function is used, the square of the estimated root is governed by a quadratic equation, the root of which is readily calculated.
3.3.1. The First Iteration
Sample the function at three points with regular intervals as listed in Table 9.
Table 9. Sampling points for the first iteration.

x

0.75

0.875

1.0

y

0.169188869

-0.124628142

-0.459697694

By using these three sampling points and applying equation (16), the corresponding Vandermonde matrix Vs and the vector ys are
Vs=10.5625000.31640625010.7656250.58618164111.0000001.000000000,
ys=0.169188869-0.124628142-0.459697694, Vs-1ys=0.999426292-1.4976466270.038522640.
The root of the function yx is obtained by setting equation (15) equal to zero as follows:
yx=1  x2  x4Vs-1ys=0.999426292-1.497646627x2+0.03852264x4=0,
from which the root in the interval [0, 1] is x=0.8241341. The relative error with respect to the exact root in the first iteration is 0.0002%.
3.3.2. The Second Iteration
To improve the accuracy, a new set of three sampling points is selected for this iteration as shown in Table 10. The root found in the first iteration is used as the centre point, and the interval of the sampling point can be reduced significantly as the root in the first iteration is already quite accurate.
Table 10. Sampling points for the second iteration.

x

0.814

0.824

0.834

y

0.023999776

0.000315174

-0.023637357

The corresponding Vandermonde matrix Vs and the vector ys are given by
Vs=10.6625960.43903345910.6789760.46100840910.6955560.483798149,
ys=0.0239997760.000315174-0.023637357, Vs-1ys=0.999581006-1.4981405110.038905190.
The root of the function yx is obtained by
yx=1  x2  x4Vs-1ys=0.999581006-1.498140511x2+0.038905190x4=0,
from which the corresponding root is determined as x=0.824132312, which is the same as the exact root.
It is demonstrated that the proposed method can achieve a high-accuracy numerical solution with only two iterations. By employing this approach, one can avoid the shortcomings of y'=0 and a non-convergent loop that may occur in the Newton-Raphson formula. Moreover, at any stage of the iteration, three new appropriate samples can be chosen to fit.
3.4. Example 4 - Extrema of a Function
Consider the odd function yx=10sinx-tanx. In the interval [0, 1.5], the maximum value ymax=6.949224835 occurs at x=1.088111560.
3.4.1. The First Iteration
Sample the function at three points with regular intervals as listed in Table 11.
Table 11. Sampling points for the first iteration.

x

1.0

1.1

1.2

y

6.857302123

6.947313944

6.748239238

By using these three sampling points and applying equation (21), the corresponding Vandermonde matrix Vs and the vector ys are
Vs=1.01.0001.000001.11.3311.610511.21.7282.48832,
ys=6.8573021236.9473139446.748239238, Vs-1ys=8.251664187-0.415431956-0.978930108.
The critical point of function yx is obtained by setting
equation (22) equal to zero, as follows:
y'(x)=1  3x2  5x4Vs-1ys=8.251664187-1.246295867x2-4.894650541x4=0,
from which the root in the interval [0, 1.5] is x=1.085043282, and the corresponding extremum of yx is given by
y1.085043282=10sin1.085043282-tan1.085043282=6.949100305.
The relative error with respect to the exact extremum in the first iteration is −0.00179%.
3.4.2. The Second Iteration
To improve the accuracy, a new set of three sampling points is selected for this iteration as shown in Table 12. As in Example 3, the centre point is chosen as the root in the first iteration, and the interval of sampling is significantly reduced.
Table 12. Sampling points for the second iteration.

x

1.080

1.085

1.090

y

6.948360731

6.949096775

6.949177322

The corresponding Vandermonde matrix Vs and the vector ys are given by
Vs=1.0801.2597120001.4693280771.0851.2772891251.5036566901.0901.2950290001.538623955,
ys=6.9483607316.9490967756.949177322, Vs-1ys=8.381084461-0.672249549-0.855064082.
The critical point of function yx is obtained by
y'(x)=1  3x2  5x4Vs-1ys=8.381084461-2.016748647x2-4.275320409x4=0,
from which the root is determined as x=1.088112745, and the corresponding local extremum of yx is
y1.088112745=10sin1.088112745-tan1.088112745=6.949224834.
which is the same as the exact extremum up to the eighth decimal place. Using equation (23), the value of the second-order derivative at the critical point is
y''1.088112745=-26.42<0,
indicating that the local extremum 6.949224834 is a maximum.
3.5. Example 5 - Functions Exhibiting Runge Phenomenon
As discussed in Section 1, when interpolating certain functions in a finite interval using the classical Lagrange interpolation, there may be large oscillations and divergence close to the endpoints of the interpolation intervals, resulting in the so-called Runge phenomenon.
The Runge phenomenon can be effectively eliminated by applied the generalized Lagrange interpolation with appropriate coordinate functions. Without loss of generality, consider a function fz with end points a,α and b,β. By adding a linear function fz as
yz=fz-βa-αba-b-α-βa-bz,(25)
the endpoints of function yz can be transformed to a,0 and b,0. By a change of variable z=a+b-ax, the domain of function yx becomes [0, 1].
Because function yx satisfies the boundary conditions y0=0 and y1=0, while y'00 and y'10, the shape functions of the free vibration of a simply supported beam of length L=1 can be employed as the coordinate functions, which satisfy the required boundary conditions and are given by
φnx=sinnπx,n=1, 2, ....(26)
To illustrate, consider the function in equation (4), or
fz=11+5z+10z2,   -1z1,
with endpoints (-1, 1/6) and (1, 1/16). Using equation (25), function
yz=11+5z+10z2-1196+596z,   -1z1,
has endpoints (-1, 0) and (1, 0). Letting z=-1+2x, the transformed function
yx=16-30x+40x2-16+548x,   0x1,(27)
has endpoints (0, 0) and (1, 0).
3.5.1. Classical Lagrange Interpolation
Sample the function yx in equation (25) using n equally spaced points within the interval 0x1:xi=in-1, i=0, 1, 2, ..., n-1. For n=11, the corresponding Vandermonde matrix Vs and the vector ys are given by
Vs=100010.10.011×10-1010.20.041×10-7111111×11,
ys=00.137870.47917011×1,    Vs-1ys=0-372.87910182.0834.543×10511×1.
For equation (13), the expression for the classical Lagrange interpolation is
yx=1xx2x10  Vs-1ys ,
which is shown in Figure 2(a) as black dashed line. It is seen that the classical Lagrange interpolation exhibits the typical Runge phenomenon near the endpoints of the interval.
3.5.2. Generalized Lagrange Interpolation
The shape functions φnx in equation (26) are employed as coordinate functions. Because the conditions y0=y1=0 are inherently satisfied, nine sampling points at x=0.1, 0.2, 0.3, ..., 0.9 are used. The corresponding Vandermonde matrix Vs and the vector ys are
Vs=0.309020.587790.809020.309020.587790.951060.95106-0.587790.809020.951060.309020.809020.30902-0.587790.809020.309029×9,
ys=0.137870.479171.531250.014809×1,    Vs-1ys=0.008490.013640.011420.000249×1.
Using equation (8), the expression for the generalized Lagrange interpolation is
yx=sinπxsin2πxsin9πx  Vs-1ys ,
which is shown in Figure 2(b) as blue dashed line.
(a). Classical Lagrange interpolation. (b). Generalized Lagrange interpolation.

Download: Download full-size image

Figure 2. Comparison between numerical and exact results.
It is observed that the generalized Lagrange interpolation method effectively eliminates the Runge phenomenon and demonstrates significantly higher approximation accuracy across the entire domain as compared to the classical Lagrange interpolation. As the number of sampling points increases, the Runge phenomenon in the classical method becomes more pronounced, whereas the accuracy of the generalized Lagrange interpolation is further improved.
3.6. Example 6 - Deformation of a Beam on Elastic Foundation
Consider a beam AB on elastic foundation, which is clamped at both ends, as shown in Figure 3. The beam is subjected to a concentrated load L, the width of the beam is b, the moment of inertia is I, and the Young’s modulus is E. From Winkler’s assumption, k=k0b, where k0 is the modulus of the foundation.
Figure 3. Clamped-clamped beam on elastic foundation.
By using Dirac delta function, the concentrated load can be expressed as wx=x-a. The differential equation governing the deflection yx is
d4yxdx4+4β4yx=Ŵδx-a,(28)
4β4=kEI,  Ŵ=WEI.
Because both ends of the beam are clamped, the boundary conditions are
y0=yL=y'0=y'L=0.
Applying the method of Laplace transform, it can be shown that the solution of differential equation (28) is
yx=y''0ϕ1x+y'''0ϕ0x+Ŵϕ0x-aHx-a(29)
in which
ϕ0x=14β3sinβxcoshβx-cosβxsinhβx,
ϕ1x=12β2sinβxsinhβx,
ϕ2x=12βsinβxcoshβx+cosβxsinhβx.
From the boundary conditions yL=y'L=0, y''0 and y'''0 can be determined as
y''(0)=α0ϕ1L-α1ϕ0Lϕ12L-ϕ0Lϕ2L,
y'''(0)=α1ϕ1L-α0ϕ2Lϕ12L-ϕ0Lϕ2L,
where
α0=-Ŵϕ0L-a,  α1=-Ŵϕ1L-a.
In order to induce significant deflection in the beam for illustrative purposes, the following parameters are adopted: Young’s modulus E=100Gpa, the width, thickness, and height of the beam are b=1m, h=3m, L=20m, the modulus of the foundation k0=1.125×1011 N/m3, and the concentrated load W=22.5 GN. Thus, Ŵ=W/EI= 0.1 and β=(k/4EI)1/4=0.5946, in which the moment of inertia is calculated as I=bh3/12.
3.6.1. Numerical Beam Deflection by the Classical Lagrange Interpolation
Eleven sample points are selected at x=0, 2, 4, 6, ..., 20. From the analytical deflection (29), the corresponding Vandermonde matrix Vs and the vector ys are given by
Vs=10001241024141610485761204001.024×101311×11,
ys=00.008350.045484×10-711×1,    Vs-1ys=00.19791-0.27483-4×10-1011×1.
According to equation (13), the expression for the beam deflection from Lagrange interpolation is
yx=1xx2x10  Vs-1ys ,
which is shown in Figure 5 as black dashed line.
3.6.2. Numerical Beam Deflection by the Generalized Lagrange Interpolation
The shape functions of a supported beam are usually derived from the eigen-solutions of its free vibration. If the boundary characteristics of a supported beam, such as end displacements and rotations, are consistent with those of a more complex structural element, the shape functions of the beam can be employed as coordinate functions, so that the boundary conditions are satisfied intrinsically.
For a beam of length L with clamped-clamped boundary conditions, the n modal shape function of free vibration is given by
φnξ=coshλnξ-cosλnξ
-coshλn-cosλnsinhλn-sinλnsinhλnξ-sinλnξ,(30)
where ξ=x/L, and λn denotes the n th positive root of the characteristic equation
coshλcosλ=1.
The characteristic roots of the first nine modes are listed in Table 13, and the corresponding beam shape-functions are shown in Figure 4.
Table 13. Values of λ.

n

1

2

3

4

5

λn

4.7300

7.8532

10.9956

14.1372

17.2788

n

6

7

8

9

λn

20.4204

23.5619

26.7035

29.8451

Figure 4. Shape functions of the first nine beam modes.
Selecting nine sampling points at x=2, 4, 6, 8, ..., 18 m, the corresponding Vandermonde matrix Vs and the vector ys are
Vs=0.189100.455740.770051.194690.619391.206751.50783-1.257521.096001.505500.868631.345130.18910-0.455740.770050.987699×9,
ys=0.008350.045480.045482.7×10-59×1,    Vs-1ys=0.008490.013640.011420.000249×1.
By applying equation (8), the deflection y(x) obtained using the generalized Lagrange interpolation is given by
yx=φ1x  φ2x  φ3x   φ9x Vs-1ys,
which is shown in Figure 5 as blue dashed line.
Figure 5. Comparison between numerical and exact results.
Figure 5 presents a comparison of beam deflections obtained using the classical Lagrange interpolation, the generalized Lagrange interpolation, and the exact theoretical solution. It can be observed that the classical Lagrange interpolation yields accurate results only near the mid-span of the beam. Close to the boundaries, the accuracy of the interpolation result deteriorates rapidly, leading to the Runge phenomenon with significant discrepancies from the exact solution.
In contrast, the generalized Lagrange interpolation demonstrates high accuracy across the entire beam, even with fewer sampling points. More accurate solutions are achieved for n7, with fitting performance further improving as n increases. This is attributed to the fact that the boundary conditions are inherently embedded in the coordinate functions, which markedly enhances convergence near the boundaries and effectively eliminates the Runge phenomenon commonly observed with classical Lagrange polynomials.
The result of generalized Lagrange interpolation, when nineteen sampling points at x=1, 2, ..., 19 (m) are used, is shown in Figure 6. It is seen that the result agrees with the exact result extremely well, with almost no visual difference.
It is noted that, for the classical Lagrange interpolation, two extra sampling points at x=0, 20 (m) are needed, and the Runge phenomenon is very severe, especially at the left end. The overall performance of the classical Lagrange interpolation does not improve by using more sampling points due to the Runge phenomenon.
(a) (b)
4. Discussions and Conclusions
It is evident that the classical Lagrange interpolation performs comparably to Stirling's stencil for first derivatives, matches the central difference scheme for second derivatives, and outperforms Simpson's rule for definite integration. However, its performance deteriorates when applied to symmetric or antisymmetric target functions, and it becomes invalid when boundary conditions are imposed. Moreover, the classical Lagrange interpolation exhibits a strong Runge phenomenon in the application of Runge-type functions.
In this study, a generalized Lagrange interpolation formula is proposed to improve the classical Lagrange interpolation, effectively overcoming the commonly observed Runge phenomenon, and thereby extending its range of applicability. The general n-point formulation of the proposed method is presented in equation (8).
According to the type of the target function, the generalized Lagrange interpolation formula selects appropriate coordinate functions to ensure that the interpolation inherently possesses key properties of the target function. Specifically, for asymmetric, symmetric, and antisymmetric target functions, consecutive-power, even-power, and odd-power polynomials are employed, respectively. For Runge-type functions or functions with prescribed boundary conditions, admissible shape functions are adopted as coordinate functions.
To illustrate the approach, six representative examples are presented: an even function, an odd function, root-finding of an even function, determining extrema of an odd function, a function exhibiting severe Runge phenomenon, and the deflection of a loaded beam on elastic foundation subject to prescribed boundary conditions. The use of appropriate coordinate functions improves convergence and enhances the overall accuracy of the numerical results.
Validation through numerical examples confirms that the proposed method effectively eliminates the Runge phenomenon and consistently outperforms the classical Lagrange interpolation in numerical differentiation, numerical integration, root-finding, and determining extrema tasks, demonstrating its versatility in handling symmetric and antisymmetric target functions. When applied to Runge-type functions, the generalized approach yields higher accuracy and better numerical stability, particularly in regions near the boundaries where the classical interpolation tends to diverge. Notably, the generalized Lagrange interpolation maintains high levels of accuracy, efficiency, and stability, all of which are further enhanced as the number of sampling points increases.
To ensure numerical accuracy and stability in practical applications of generalized Lagrange interpolation, the following guidelines are recommended:
When sampling points are evenly spaced, appropriate coordinate functions should be selected based on the properties of the target function to avoid the Runge phenomenon.
The magnitudes of sample values are to be comparable, and large discrepancies in scale should be avoided.
Using an appropriate transformation, the domain and boundary conditions can be modified as illustrated in Example 5, so that well-known coordinate functions can be applied to achieve more accurate and stable results.
The existing methodologies to resolve Runge's phenomenon primarily rely on the use of Chebyshev nodes or spline interpolation. In contrast, the proposed generalized Lagrange interpolation that uses collocation to determine the coefficients of expansion, similar to Galerkin's method of least square residues, offers a more robust, versatile, and simple alternative by employing admissible shape functions as coordinate functions. Whether applied to numerical differentiation, numerical definite integration, root-finding, determining extrema, or the solution of ordinary differential equations with imposed boundary conditions, this method consistently achieves high levels of accuracy, stability, and numerical efficiency.
Funding
This work is not supported by any external funding.
Data Availability Statement
The data is available from the corresponding author upon reasonable request.
Conflicts of Interest
The authors declare no conflicts of interest.
References
[1] Liszka T. An interpolation method for an irregular net of nodes, International Journal for Numerical Methods in Engineering. 1984, 20(9): 1599-1612.
[2] Curtiss J. Interpolation in regularly distributed points, Transactions of the American Mathematical Society. 1935, 38(3): 458-473.
[3] Blu T, Thévenaz P, Unser M. Linear interpolation revitalized, IEEE Transactions on Image Processing. 2004, 13(5): 710-719.
[4] Greville T N E. Numerical procedures for interpolation by spline functions, Journal of the Society for Industrial and Applied Mathematics. Series B: Numerical Analysis, 1964, 1(1): 53-68.
[5] Wang, R, Ly, B, Xie, W, Pandey, M. Lagrange Interpolation in Matrix Form for Numerical Differentiation and Integration, American Journal of Applied Mathematics. 2024, 12(3), 66-78.
[6] Runge C. Über empirische Funktionen und die Interpolation zwischen äquidistanten Ordinaten, Zeitschrift für Mathematik und Physik. 1901, 46(224-243): 20.
[7] Boyd J P. Trouble with Gegenbauer reconstruction for defeating Gibbs’ phenomenon: Runge phenomenon in the diagonal limit of Gegenbauer polynomial approximations, Journal of Computational Physics. 2005, 204(1): 253-264.
[8] Chen Y J, He H Y, Zhang S L. A new algebra interpolation polynomial without Runge phenomenon, Applied Mechanics and Materials. 2013, 303: 1085-1088.
[9] Piret C. A radial basis function based frames strategy for bypassing the Runge phenomenon [J]. SIAM Journal on Scientific Computing, 2016, 38(4): A2262-A2282.
[10] Majidian H. Creating stable quadrature rules with preassigned points by interpolation, Calcolo. 2016, 53(2): 217-226.
[11] She J, Tan Y. Research on Runge phenomenon, Computational and Mathematical Biophysics. 2019, 8(8): 1500-1510.
[12] Zhang R J, Liu X. Rational interpolation operator with finite Lebesgue constant, Calcolo. 2022, 59(1): 10.
[13] Boyd J P. Defeating the Runge phenomenon for equispaced polynomial interpolation via Tikhonov regularization, Applied mathematics letters. 1992, 5(6): 57-59.
[14] Gottlieb D, Shu C W. Resolution properties of the Fourier method for discontinuous waves, Computer methods in applied mechanics and engineering. 1994, 116(1-4): 27-37.
[15] Boyd J P. A comparison of numerical algorithms for Fourier extension of the first, second, and third kinds, Journal of Computational Physics. 2002, 178(1): 118-160.
[16] Gelb A. Parameter optimization and reduction of round off error for the Gegenbauer reconstruction method, Journal of Scientific Computing. 2004, 20(3): 433-459.
[17] Jackiewicz Z. Determination of Optimal Parameters for the Chebyshev--Gegenbauer Reconstruction Method, SIAM Journal on Scientific Computing. 2004, 25(4): 1187-1198.
[18] Jung J H, Shizgal B D. Generalization of the inverse polynomial reconstruction method in the resolution of the Gibbs phenomenon, Journal of computational and applied mathematics. 2004, 172(1): 131-151.
[19] Platte R B, Driscoll T A. Polynomials and potential theory for Gaussian radial basis function interpolation, SIAM Journal on Numerical Analysis. 2005, 43(2): 750-766.
[20] Boyd J P, Ong J R. Exponentially-convergent strategies for defeating the Runge phenomenon for the approximation of non-periodic functions, part I: single-interval schemes, Comput. Phys. 2009, 5(2-4): 484-497.
[21] Lin H, Sun L. Searching globally optimal parameter sequence for defeating Runge phenomenon by immunity genetic algorithm, Applied Mathematics and Computation. 2015, 264: 85-98.
[22] Blevins R D, Plunkett R. Formulas for natural frequency and mode shape, Journal of Applied Mechanics. 1980, 47(2): 461.
[23] Xie W C. Differential equations for engineers. Cambridge university press, 2010.
Cite This Article
  • APA Style

    Cheng, Z., Xie, W., Pandey, M., Ly, B. (2026). Versatility of the Generalized Lagrange Interpolation Formula in the Matrix Form. American Journal of Applied Mathematics, 14(1), 14-26. https://doi.org/10.11648/j.ajam.20261401.13

    Copy | Download

    ACS Style

    Cheng, Z.; Xie, W.; Pandey, M.; Ly, B. Versatility of the Generalized Lagrange Interpolation Formula in the Matrix Form. Am. J. Appl. Math. 2026, 14(1), 14-26. doi: 10.11648/j.ajam.20261401.13

    Copy | Download

    AMA Style

    Cheng Z, Xie W, Pandey M, Ly B. Versatility of the Generalized Lagrange Interpolation Formula in the Matrix Form. Am J Appl Math. 2026;14(1):14-26. doi: 10.11648/j.ajam.20261401.13

    Copy | Download

  • @article{10.11648/j.ajam.20261401.13,
      author = {Zhengquan Cheng and Wei-Chau Xie and Mahesh Pandey and Binh-Le Ly},
      title = {Versatility of the Generalized Lagrange Interpolation Formula in the Matrix Form},
      journal = {American Journal of Applied Mathematics},
      volume = {14},
      number = {1},
      pages = {14-26},
      doi = {10.11648/j.ajam.20261401.13},
      url = {https://doi.org/10.11648/j.ajam.20261401.13},
      eprint = {https://article.sciencepublishinggroup.com/pdf/10.11648.j.ajam.20261401.13},
      abstract = {In this paper, a generalized Lagrange interpolation formula expressed in matrix form is developed to systematically expand a sampled function with enhanced flexibility and computational rigor. The proposed formulation employs appropriate coordinate functions that not only satisfy prescribed boundary conditions but also exploit the symmetry or anti-symmetry inherent in the function under consideration. When such conditions are absent, the coordinate functions naturally degenerate into polynomial bases, thereby reproducing the classical Lagrange interpolation as a special case. The expansion coefficients are efficiently obtained through the collocation method, ensuring numerical simplicity and stability. The matrix-based generalized Lagrange interpolation exhibits substantial versatility beyond traditional interpolation tasks. It can be readily applied to numerical differentiation and integration under both uniform and non-uniform sampling schemes. Moreover, the approach proves useful in solving ordinary differential equations with specified boundary constraints, as well as in problems involving root-finding and extremum detection of functions. Numerical experiments demonstrate the accuracy and robustness of the proposed method, revealing a marked reduction in the Runge phenomenon even when the number of sampling points is limited. The results further indicate that computational efficiency and precision improve progressively as the number of samples increases. Overall, the generalized interpolation framework developed herein provides a unified and reliable computational tool for interpolation, differentiation, integration, and boundary-value problems, thereby offering broad potential for applications in numerical analysis and scientific computing.},
     year = {2026}
    }
    

    Copy | Download

  • TY  - JOUR
    T1  - Versatility of the Generalized Lagrange Interpolation Formula in the Matrix Form
    AU  - Zhengquan Cheng
    AU  - Wei-Chau Xie
    AU  - Mahesh Pandey
    AU  - Binh-Le Ly
    Y1  - 2026/01/20
    PY  - 2026
    N1  - https://doi.org/10.11648/j.ajam.20261401.13
    DO  - 10.11648/j.ajam.20261401.13
    T2  - American Journal of Applied Mathematics
    JF  - American Journal of Applied Mathematics
    JO  - American Journal of Applied Mathematics
    SP  - 14
    EP  - 26
    PB  - Science Publishing Group
    SN  - 2330-006X
    UR  - https://doi.org/10.11648/j.ajam.20261401.13
    AB  - In this paper, a generalized Lagrange interpolation formula expressed in matrix form is developed to systematically expand a sampled function with enhanced flexibility and computational rigor. The proposed formulation employs appropriate coordinate functions that not only satisfy prescribed boundary conditions but also exploit the symmetry or anti-symmetry inherent in the function under consideration. When such conditions are absent, the coordinate functions naturally degenerate into polynomial bases, thereby reproducing the classical Lagrange interpolation as a special case. The expansion coefficients are efficiently obtained through the collocation method, ensuring numerical simplicity and stability. The matrix-based generalized Lagrange interpolation exhibits substantial versatility beyond traditional interpolation tasks. It can be readily applied to numerical differentiation and integration under both uniform and non-uniform sampling schemes. Moreover, the approach proves useful in solving ordinary differential equations with specified boundary constraints, as well as in problems involving root-finding and extremum detection of functions. Numerical experiments demonstrate the accuracy and robustness of the proposed method, revealing a marked reduction in the Runge phenomenon even when the number of sampling points is limited. The results further indicate that computational efficiency and precision improve progressively as the number of samples increases. Overall, the generalized interpolation framework developed herein provides a unified and reliable computational tool for interpolation, differentiation, integration, and boundary-value problems, thereby offering broad potential for applications in numerical analysis and scientific computing.
    VL  - 14
    IS  - 1
    ER  - 

    Copy | Download

Author Information
  • Department of Civil and Environmental Engineering, University of Waterloo, Ontario, Canada

    Biography: Zhengquan Cheng is a PhD student in the Civil and Environmental Engineering department at the University of Waterloo.

  • Department of Civil and Environmental Engineering, University of Waterloo, Ontario, Canada

    Biography: Wei-Chau Xie is a Professor in the Civil and Environmental Engineering department at the University of Waterloo.

  • Department of Civil and Environmental Engineering, University of Waterloo, Ontario, Canada

    Biography: Mahesh Pandey is a Professor in the Civil and Environmental Engineering department at the University of Waterloo.

  • Atomic Energy of Canada, Mississauga, Canada

    Biography: Binh-Le Ly received PhD degree in University of Waterloo, and he worked at Atomic Energy of Canada.

  • Abstract
  • Keywords
  • Document Sections

    1. 1. Introduction
    2. 2. Formulation
    3. 3. Numerical Examples
    4. 4. Discussions and Conclusions
    Show Full Outline
  • Funding
  • Data Availability Statement
  • Conflicts of Interest
  • References
  • Cite This Article
  • Author Information