Quadratic Interpolation

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

Table of Content

  • What is Interpolation?
  • What is Quadratic Interpolation?
  • Quadratic Interpolation Formula
  • Derivation of Quadratic Interpolation Formula
  • Applications of Quadratic Interpolation
  • Limitations of Quadratic Interpolation
  • Solved Problems on Quadratic Interpolation Formula.

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 Formula

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
  • 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, 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.

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.

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

FAQs Quadratic Interpolation Formula

Define Quadratic Interpolation.

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

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

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.

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

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

What are the Limitations of Quadratic Interpolation?

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.

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

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.



Contact Us