Open In App

Quadratic Interpolation

Last Updated : 31 Jul, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

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 behavior of a smooth curve passing through these points, you frequently use this formula. For the purpose of trying to predict intermediate values, the quadratic interpolation method makes the assumption that the fundamental connection between the points follows a curve that is parabolic (a second-degree polynomial).

What is Interpolation?

Many fields, including mathematics, computer graphics, engineering, data analysis, and scientific computing, often employ interpolation. Using known data points as a point of reference, it 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:

Learn more about Interpolation.

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 modeled by a quadratic equation.

The 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.

Quadratic Interpolation Formula

Given 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, and 

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₁))

Derivation of Quadratic Interpolation Formula

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;
    • y0 = ax02 + bx0 + c
  • At x = x1
    • y1 = ax12 + bx1 + c
  • At x = x2
    • y2 = ax22 + bx2 + c

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 the uses of Interpolation.

Limitations of Quadratic Interpolation

Quadratic Interpolation has some limitations, which are listed as follows:

  • The 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.
  • The distribution as well as the density of the data points affect the estimation’s efficiency, as they do with any interpolation approach.

Solved Problems on Quadratic Interpolation Formula.

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.

FAQs Quadratic Interpolation Formula

Q1: Define Quadratic Interpolation.

Answer:

A specific type of polynomial interpolation called quadratic interpolation uses a polynomial with a quadratic form for estimating values between two known data points.

Q2: Can I Implement Quadratic Interpolation on data in three dimensions or more?

Answer:

Since a quadratic polynomial must be created from three data points, quadratic interpolation is typically primarily useful for one-dimensional (1D) or two-dimensional (2D) data. If we need to implement Quadratic Interpolation we need to derive another set of formulas considering the cases of three-dimension.

Q3: Assuming my Data Points are Collinear, What Should I Do?

Answer:

Using quadratic interpolation might not be appropriate if your data points are collinear, you should use linear interpolation for your use case.

Q4: What are the Limitations of Quadratic Interpolation?

Answer:

Some of the limitation of quadratic interpolation are:

  • It relies on a claim that the underlying data has a parabolic pattern, and it might not properly represent relationships with more complex dynamics.
  • Noisy data or errors may affect the precision of quadratic interpolation.
  • When analyzing real-world data, it’s crucial to assess the data’s properties and, if necessary, take various methods of interpolation into consideration.

Q5: Can Data with More than Three Points be Interpolated using Quadratic Equations?

Answer:

No, quadratic interpolation was developed with the idea of three data points only. Other interpolation techniques, like polynomial interpolation or spline interpolation, that can handle a larger number of data points, would be required if you had more than three points.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads