A quadratic polynomial is used in the mathematical process of quadratic interpolation to estimate values between data points. When you have a set of three data points and wish to estimate the behaviour of a smooth curve passing through these points, you frequently use this formula. To try to predict intermediate values, the quadratic interpolation method assumes that the fundamental connection between the points follows a parabolic curve (a second-degree polynomial).
What is Interpolation?
Interpolation is a mathematical method used to estimate unknown values that fall within the range of known data points. Many fields, including mathematics, computer graphics, engineering, data analysis, and scientific computing, often employ interpolation. Using known data points as a point of reference is a mathematical and computational technique for estimating values.
It is often utilized when we need to calculate the value of an equation at points located between the given data points and we have a set of data points. Common interpolation techniques include:
What is Quadratic Interpolation?
Using three known data points and a mathematical technique called quadratic interpolation, one can figure out the value of a function that is unidentified at a given location. It depends on the idea that the underlying connection between the information sets follows a parabolic curve, which is modelled by a quadratic equation.
General form of a quadratic equation is: y = ax2 + bx + c
Three data points—(x₀, y₀), (x₁, y₁), and (x₂, y₂)—each consisting of an x-value and its associated y-value—are necessary in order to apply quadratic interpolation. You may generate a quadratic equation that matches the curve that passes through these data points using these points as the starting point. The quadratic interpolation formula is shown in the image added below:
Quadratic Interpolation FormulaGiven three known data points (x₀, y₀), (x₁, y₁), and (x₂, y₂), each of which is composed of an x-value and its corresponding y-value, the quadratic interpolation method is used to obtain an estimated value, y, at a given x-value, x. The quadratic Equation required is given as follows:
y = y0 × L0(x) + y1 × L1(x) + y2 × L2(x)
where,
- y₀, y₁, and y₂ are "y-value" of the three known data point
- x₀, x₁, and x₂ are "x-value" of the three known data point
- L₀(x), L₁(x), and L₂(x) are the Lagrange basis polynomial
Lagrange basis polynomials are defined as:
L₀(x) = (x - x₁) × (x - x₂) / ((x₀ - x₁) × (x₀ - x₂))
L₁(x) = (x - x₀) × (x - x₂) / ((x₁ - x₀) × (x₁ - x₂))
L₂(x) = (x - x₀) × (x - x₁) / ((x₂ - x₀) × (x₂ - x₁))
We assume that we have three data points (x0, y0), (x1, y1), and (x2, y2) and that we are attempting to find a quadratic function that passes across these points in order to develop the quadratic interpolation formula. The form of the quadratic function is:
f(x) = ax2 + bx + c
To fit the function to the provided data points, we need to identify the values of coefficients a, b, and c. Three mathematical equations based on the data points can be constructed to do this:
- At x = x0;
- At x = x1;
- At x = x2;
Now, solve this system of three equations to find the values of coefficients a, b, and c.
Step 1: Simplifying the equations
Expand the equations:
- y0 = ax02 + bx0 + c
- y1 = ax12 + bx1 + c
- y2 = ax22 + bx2 + c
Step 2: Eliminate c from the equations
Subtract the first equation from the second equation and the first equation from the third equation:
- y0 - y1 = ax02 + bx0 + c - (ax12 + bx1 + c)
- y0 - y2 = ax02 + bx0 + c - (ax22 + bx2 + c)
This simplifies to:
- y0 - y1 = a(x02 - x12) + b(x0 - x1) . . . (1)
- y0 - y2 = a(x02 - x22) + b(x0 - x2) . . . (1)
Step 3: Calculating a
Multiply the first equation by (x0 - x2) and the second equation by (x0 - x1) to eliminate b:
a(x02 - x12)(x0 - x2) + b(x0 - x1)(x0 - x1) = (y0 - y1)(x0 - x2)
a(x02 - x22)(x0 - x1) + b(x0 - x1)(x0 - x2) = ( y0 - y2)(x0 - x1)
Now, subtract the second equation from the first equation to eliminate b:
a(x02 - x12)(x0 - x2) - a(x02 - x22)(x0 - x1) = (y0 - y1)(x0 - x2) - ( y0 - y2)(x0 - x1)
Step 4: Solving for a
Now, factor out a from both sides:
a[(x02 - x12)(x0 - x2) - (x02 - x22)(x0 - x1)] = (y0 - y1)(x0 - x2) - ( y0 - y2)(x0 - x1)
Now, dividing both sides by [(x02 - x12)(x0 - x2) - (x02 - x22)(x0 - x1)] to get the value of a.
a = [(y0 - y1)(x0 - x2) - ( y0 - y2)(x0 - x1)]/[(x02 - x12)(x0 - x2) - (x02 - x22)(x0 - x1)]
Step 5: Calculating b
Now find the value of b by substituting the value of a in the original equation.
Step 6: Calculating c
After you have found the values of a and b, you can find c by substituting them back into any of the original equation:
c = y0 - ax02 - bx0
Now you have the coefficients a, b, and c, which represent the quadratic function that passes through the given data points (x0, y0), (x1, y1), and (x2, y2).
Applications of Quadratic Interpolation
Some of its applications are as follows:
- Computer Graphics: For creating animated scenes in computer graphics and animation, seamless transitions between keyframes are achieved through quadratic interpolation.
- Curve Fitting: When a quadratic equation is thought to be sufficient for the relationship between variables, quadratic interpolation is a form of curve-fitting approach used to approximate data from experiments.
- Numerical Analysis: Quadratic interpolation is used to estimate solutions for problems where data is only available at periodic spots.
- Signal Processing: When estimating the amounts of signals or data points among discontinuous sample sites, quadratic interpolation is a common technique.
- Finance: When there are few data points available, quadratic interpolation can be used in financial planning to determine the value of a possibility or commodity.
Learn more about, Uses of Interpolation
Limitations of Quadratic Interpolation
Quadratic Interpolation has some limitations, which are listed as follows:
- Assumption of a parabolic curve between the data points may not always exactly represent the real connection.
- Using quadratic interpolation for extrapolation—or guessing values outside the data range—may be very unreliable and can produce incorrect results.
- Distribution as well as the density of the data points affect the estimation's efficiency, as they do with any interpolation approach.
Problem 1: Suppose we have the following three data points: (x₀, y₀) = (1, 5) (x₁, y₁) = (2, 12) (x₂, y₂) = (3, 23)
Now, let's use quadratic interpolation to estimate the value of y at x = 2.5.
Solution:
First, we calculate the Lagrange basis polynomials:
L₀(2.5) = (2.5 - 2) × (2.5 - 3) / ((1 - 2) × (1 - 3)) = 0.75,
L₁(2.5) = (2.5 - 1) × (2.5 - 3) / ((2 - 1) × (2 - 3)) = -1.5, and
L₂(2.5) = (2.5 - 1) × (2.5 - 2) / ((3 - 1) × (3 - 2)) = 0.75.
Now, applying quadratic interpolation formula:
y = y₀ × L₀(2.5) + y₁ × L₁(2.5) + y₂ × L₂(2.5) y
⇒ y = 5 × 0.75 + 12 × (-1.5) + 23 × 0.75 y
⇒ y = 3.75 - 18 + 17.25 y
⇒ y = 2
So, the estimated value of y at x = 2.5 is 2.
Problem 2: Given the following data points: (x₀, y₀) = (1, 3) (x₁, y₁) = (4, 24) (x₂, y₂) = (7, 67)
Let's estimate the value of y at x = 5.
Solution:
Calculating the Lagrange basis polynomials:
L₀(5) = (5 - 4) × (5 - 7) / ((1 - 4) × (1 - 7)) = -1
L₁(5) = (5 - 1) × (5 - 7) / ((4 - 1) × (4 - 7)) = 2
L₂(5) = (5 - 1) × (5 - 4) / ((7 - 1) × (7 - 4)) = 3/8
Applying the quadratic interpolation formula:
y = y₀ × L₀(5) + y₁ × L₁(5) + y₂ × L₂(5) y
⇒ y = 3 × (-1) + 24 × 2 + 67 × 3/8 y
⇒ y = -3 + 48 + 25.125 y
⇒ y = 70.125
So, the estimated value of y at x = 5 is approximately 70.125.
Problem 3: Given the following data points: (x₀, y₀) = (1, 3) (x₁, y₁) = (2, 8) (x₂, y₂) = (3, 15)
Let's estimate the value of y at x = 1.5.
Solution:
Firstly, calculating the Lagrange basis polynomials:
L₀(1.5) = (1.5 - 2) × (1.5 - 3) / ((1 - 2) × (1 - 3)) = 0.75
L₁(1.5) = (1.5 - 1) × (1.5 - 3) / ((2 - 1) × (2 - 3)) = -0.75
L₂(1.5) = (1.5 - 1) × (1.5 - 2) / ((3 - 1) × (3 - 2)) = 0.25
Then, applying the quadratic interpolation formula:
y = y₀ × L₀(1.5) + y₁ × L₁(1.5) + y₂ × L₂(1.5) y
⇒ y = 3 × 0.75 + 8 × (-0.75) + 15 × 0.25 y
⇒ y = 2.25 - 6 + 3.75 y
⇒ y = 0
So, the estimated value of y at x = 1.5 is 0.
Problem 4: Given the following data points: (x₀, y₀) = (0, 1) (x₁, y₁) = (2, 3) (x₂, y₂) = (5, 6)
Let's estimate the value of y at x = 3.
Solution:
Again repeating the same steps,
Firstly, calculate the Lagrange basis polynomials:
L₀(3) = (3 - 2) × (3 - 5) / ((0 - 2) × (0 - 5)) = 1/10
L₁(3) = (3 - 0) × (3 - 5) / ((2 - 0) × (2 - 5)) = -3/10
L₂(3) = (3 - 0) × (3 - 2) / ((5 - 0) × (5 - 2)) = 3/10
Now, applying the quadratic interpolation formula:
y = y₀ × L₀(3) + y₁ × L₁(3) + y₂ × L₂(3) y
⇒ y 1 × 1/10 + 3 × (-3/10) + 6 × 3/10 y
⇒ y = 0.1 - 0.9 + 1.8 y
⇒ y = 1
So, the estimated value of y at x = 3 is 1.
Problem 5: Given the following data points: (x₀, y₀) = (-2, 4) (x₁, y₁) = (0, 1) (x₂, y₂) = (1, -1)
Let's estimate the value of y at x = -1.
Solution:
Calculating the Lagrange basis polynomials:
L₀(-1) = (-1 - 0) × (-1 - 1) / ((-2 - 0) × (-2 - 1)) = 1/6
L₁(-1) = (-1 - (-2)) × (-1 - 1) / ((0 - (-2)) × (0 - 1)) = -1/2
L₂(-1) = (-1 - (-2)) × (-1 - 0) / ((1 - (-2)) × (1 - 0)) = 1/3
Apply the quadratic interpolation formula:
y = y₀ × L₀(-1) + y₁ × L₁(-1) + y₂ × L₂(-1) y
⇒ y = 4 × 1/6 + 1 × (-1/2) + (-1) × 1/3 y
⇒ y = 2/3 - 1/2 - 1/3 y
⇒ y = 0
So, the estimated value of y at x = -1 is approximately 0.
Practice Questions on Quadratic Interpolation
Q1. Given three data points (1,2), (2,3), and (3,5), use quadratic interpolation to estimate the value at x = 2.5.
Q2. Given three data points (0,1), (1,3), and (2,2), determine the quadratic equation that passes through these points and use it to find the value at x=1.5.
Q3. If you have the data points (1,4), (2,7), and (3,6) what is the quadratic function that fits these points? Estimate the value at x = 2.2
Q4. Given the points (2,5), (3,9), and (5,15) perform quadratic interpolation to find the polynomial and use it to estimate the value at x = 4
Similar Reads
Quadratic Function A quadratic function is a type of polynomial function of degree 2, which can be written in the general form:f(x) = ax2 + bx + cwhere:⢠x is the variable,⢠a, b, and c are constants with a â 0 (if a = 0, the function would be linear, not quadratic),⢠The highest exponent of x is 2 (hence the term "qu
9 min read
Interpolation in MATLAB Upsampling can be defined as a process that comprises adding zero-valued samples in between existing original samples in order to increase the sampling rate. Upsampling is also called zero-stuffing. Interpolation:Upsampling with Filtering is called Interpolation. Upsampling adds zero-valued samples
3 min read
Linear Interpolation in MATLAB Interpolation is a numerical method of finding new data points by finding a pattern in a given set of discrete data points. There are various types and methods of interpolation in the field of Numerical Analysis such as linear interpolation, cubic interpolation, spline interpolation, etc. The key p
3 min read
Interpolation Search - Python Interpolation Search is an efficient searching algorithm particularly when dealing with the uniformly distributed sorted arrays. It finds the target value in the sorted array by narrowing down the search space. It improves upon binary search by the estimating the location of the target element based
3 min read
Interpolation in Python Interpolation in Python refers to the process of estimating unknown values that fall between known values. This concept is commonly used in data analysis, mathematical modeling, and graphical representations. Python provides several ways to perform interpolation, including the use of libraries like
2 min read
Lagrange Interpolation Formula The Lagrange Interpolation Formula finds a polynomial called Lagrange Polynomial that takes on certain values at an arbitrary point. It is an nth-degree polynomial expression of the function f(x). The interpolation method is used to find the new data points within the range of a discrete set of know
7 min read