Tomorrow, I will have a mid-term exam including Lagrange polynomial. So, I summarize down these content. There won’t be a Mandarin version, because I am so lazy to translate it. Besides, you may get better reading experience here.
Lagrange Polynomial
The Lagrange polynomial is a method of polynomial interpolation that allows us to approximate a function f(x) by a polynomial P(x). Given the fucntion passthrough a set of points (x0,y0),(x1,y1),…,(xn,yn), where xi are distinct. The main idea of the Lagrange Polynomial is to construct a polynomial directly using a linear combination of basis polynomials, denoted as Li(x) which are defined as follows:
Li(xj)=δij={10if i=jif i=j
The core logic relies on the property of Li(xj), which ensures that each basis polynomial contributes to the final interpolation only at its corresponding point. To ensure Li(xj)=0 when i=j, the function Li(x) must contain the term (x−xj) for all j=i.
Li(x)=j=0,j=i∏nx−xj
To satisfy the condition Li(xi)=1, we need to normalize Li(x) by dividing it by its value at xi. Hence the normalized basis polynomial is given by:
Ln,i(x)=j=0,j=i∏nxi−xjx−xj
Finally, we scale each basis polynomial by its corresponding yi value and sum them up to get the final Lagrange polynomial:
P(x)=i=0∑nf(xi)Li(x)
Besides, the Lagrange polynomial can also be expressed in another form. Let us define the nodal polynomial Q(x) as the product of all linear factors associated with the data points:
Q(x)=j=0∏n(x−xj)
Taking the natural logarithm on both sides to simplify the differentiation of the product:
lnQ(x)=j=0∑nln(x−xj)
Differentiating with respect to x yields the logarithmic derivative:
Q(x)Q′(x)=j=0∑nx−xj1
Multiplying both sides by Q(x), we obtain the general expression for the derivative Q′(x):
Q′(x)=j=0∑nx−xjQ(x)
When evaluating this derivative at a specific node x=xi, the limit must be considered since Q(xi)=0. Applying the product rule isolates the non-zero term:
Using this result, the Lagrange basis polynomial Ln,i(x) can be elegantly rewritten in terms of Q(x) and Q′(xi):
Ln,i(x)=Q′(xi)x−xiQ(x)=(x−xi)Q′(xi)Q(x)
Finally, the interpolating polynomial P(x) is constructed as a linear combination of these basis polynomials and the given function values f(xi):
P(x)=i=0∑n(x−xi)Q′(xi)Q(x)⋅f(xi)
Uniqueness
Suppose there are two different polynomials P(x) and Q(x) that both interpolate the same set of points. Let
R(x)=P(x)−Q(x)
Since both P(x) and Q(x) interpolate the same points, we have
R(xi)=P(xi)−Q(xi)=0∀i=0,1,…,n
This means that R(x) has at least n+1 distinct roots. However, a non-zero polynomial of degree at most n can have at most n distinct roots. Therefore, the only possibility is that R(x) is the zero polynomial, which implies that P(x)=Q(x) for all x. Hence, the Lagrange polynomial is unique.
Error Analysis
Since we have known the points of interpolation, the error on xi is zero. However, for any other point x that is not in the set of interpolation points, we construct a polynomial that vanishes at all the interpolation points, with a coefficient c to be determined:
f(x)=P(x)+cj=0∏n(x−xj)
Since we do not know whether the error for all the points is linear or not, we cannot simply suppose that c is a constant. Instead, we need to see c as a function of x. Given Q(x)=∏j=0n(x−xj), we can rewrite the above equation as:
f(x)=P(x)+c(x)Q(x)
To analyze the error, we define a new auxiliary function F(z) to assist our analysis:
F(z)=f(z)−P(z)−c(x)Q(z)
By construction, F(z) has at least n+2 distinct roots x0,x1,…,xn, and it also trivially evaluates to zero at z=x (since F(x)=f(x)−P(x)−c(x)Q(x)=0 ).
If we assume that f(z) is sufficiently smooth (i.e., it has at least n+1 continuous derivatives), then by the repeated application of Rolle’s theorem, there must exist a point ξ in the interval containing both the interpolation points and x, such that the (n+1)-th derivative of F(z) vanishes:
F(n+1)(ξ)=0
Calculating the (n+1)-th derivative of F(z), we have:
F(n+1)(ξ)=f(n+1)(ξ)−P(n+1)(ξ)−c(x)Q(n+1)(ξ)
Since P(z) is a polynomial of degree at most n, its (n+1)-th derivative is zero. Additionally, since Q(z) is a product of (n+1) linear factors, its (n+1)-th derivative is (n+1)!. Therefore, the above equation simplifies to:
0=f(n+1)(ξ)−c(x)(n+1)!
Solving for c(x) gives us:
c(x)=(n+1)!f(n+1)(ξ)
Substituting this back into equation (3) yields the error formula for the Lagrange interpolation:
f(x)=P(x)+(n+1)!f(n+1)(ξ)j=0∏n(x−xj)
Derivative of Lagrange Polynomial
To find the derivative of the Lagrange polynomial P(x), we need equation (1) and the expression for Ln,i(x) in terms of Q(x) and Q′(xi):
Recall the standard error formula for polynomial interpolation. For a sufficiently differentiable function f(x) interpolated by a polynomial P(x) of degree n at distinct nodes x0,x1,…,xn, the interpolation error is given by:
f(x)=P(x)+(n+1)!Q(x)f(n+1)(ξx)
where Q(x)=∏i=0n(x−xi) is the nodal polynomial, and ξx is some point in the smallest interval containing x and all nodes xi. Crucially, ξx depends on x, meaning it must be treated as a function ξ(x) during differentiation.
To find the error of the derivative, we differentiate both sides with respect to x. Applying the product rule and the chain rule to the error term yields:
Since xi is a root of the nodal polynomial, Q(xi)=0. This mathematical property conveniently eliminates the complex second term involving the unknown derivative ξ′(xi):
R(xi)=Q′(xi)f(n+1)(ξ(xi))+0
By substituting x=xi into our expansion for Q′(x), all terms in the summation vanish except the term where j=i, yielding:
Q′(xi)=k=0k=i∏n(xi−xk)
Therefore, the exact formulation for the derivative at an interpolation node xi simplifies to:
Let the integration interval [a,b] be partitioned into n equal subintervals with step size Δx=nb−a, where n is an even integer. The grid points are defined as:
xi=a+iΔx
To derive Simpson’s rule, we approximate the integrand f(x) over each subinterval [xi−1,xi+1] using a quadratic polynomial P2(x)=ax2+bx+c. This parabola is uniquely determined by passing through three adjacent points: (xi−1,f(xi−1)), (xi,f(xi)), and (xi+1,f(xi+1)).
Using Lagrange interpolation, this quadratic polynomial can be expressed as a linear combination of Lagrange basis polynomials:
The basis polynomials L0(x), L1(x), and L2(x) are formulated as follows. We simplify the denominators by utilizing the uniform spacing constraint xk−xk−1=Δx:
To find the approximate area under f(x), we integrate P2(x) over the sub-domain [xi−1,xi+1]. We then sum these local integrals over the n/2 sub-domains to cover the entire interval [a,b]:
To elegantly evaluate the integral of each basis polynomial, we apply the affine transformation x=xi+tΔx, which implies dx=Δxdt. This standardizes the limits of integration from [xi−1,xi+1] to [−1,1].