Lagrange and cubic spline interpolate

  • Thread starter Thread starter BearY
  • Start date Start date
  • Tags Tags
    Cubic Lagrange
BearY
Messages
53
Reaction score
8

Homework Statement


This is a bit unusual, I don't know whether I should post it here or math forum tbh.
When I was doing numerical method home work, I am required to do perform both of these interpolation on a set of 4 data points. It turns out that the result of these 2 methods always agrees with each other(not proven in any way, just by playing with data, that's why I am asking). We were asked to explain this. I have not a clue how this is happening.

Homework Equations

The Attempt at a Solution


Since there are 4 data points, the Lagrange polynomial is also a cubic function. I have that to start with.
I also have the formula of how the cubic splines are piece-wise calculated. But then I am stuck here.
Is it because of the formula or there is a deeper reason?
 
Last edited:
Physics news on Phys.org
BearY said:

Homework Statement


This is a bit unusual, I don't know whether I should post it here or math forum tbh.
When I was doing numerical method home work, I am required to do perform both of these interpolation on a set of 4 data points. It turns out that the result of these 2 methods always agrees with each other(not proven in any way, just by playing with data, that's why I am asking). We were asked to explain this. I have not a clue how this is happening.

Homework Equations

The Attempt at a Solution


Since there are 4 data points, the Lagrange polynomial is also a cubic function. I have that to start with.
I also have the formula of how the cubic splines are piece-wise calculated. But then I am stuck here.
Is it because of the formula or there is a deeper reason?
I think that is a good place to start. Show that both approaches produce the same equation for the dependent variable. You could do that by brute force, or you could show that the Lagrange polynomial solution satisfies all of the conditions of the cubic spline solution. (The second way is a lot easier.)
 
  • Like
Likes BearY
tnich said:
I think that is a good place to start. Show that both approaches produce the same equation for the dependent variable. You could do that by brute force, or you could show that the Lagrange polynomial solution satisfies all of the conditions of the cubic spline solution. (The second way is a lot easier.)
From what I know, the only (three if count separately) condition is neighbor splines have same value of ##f, f', f''## at the joint. The deriving of spline formula is also solely based on these conditions if I am not mistaken. Since the Lagrange polynomial is a polynomial, it naturally fits these criteria. But does fitting these criteria plus having 4 intersections making the cubic function equivalent?
edit: Since we are starting from those conditions, plus MATLAB uses not a knot method, and reached a unique solution to the 2nd derivatives of the four data points, does that mean any cubic function that fits these condition will be equivalent?
 
Last edited:
BearY said:
From what I know, the only (three if count separately) condition is neighbor splines have same value of ##f, f', f''## at the joint. The deriving of spline formula is also solely based on these conditions if I am not mistaken. Since the Lagrange polynomial is a polynomial, it naturally fits these criteria. But does fitting these criteria plus having 4 intersections making the cubic function equivalent?
I think you will need to show that the Lagrange polynomial solution fits the end conditions of the cubic spline, too. If the cubic spline solution is unique, and the (unique) Lagrange polynomial solution satisfies all of its conditions, then it must also be the unique cubic spline solution.
 
  • Like
Likes BearY
tnich said:
I think that is a good place to start. Show that both approaches produce the same equation for the dependent variable. You could do that by brute force, or you could show that the Lagrange polynomial solution satisfies all of the conditions of the cubic spline solution. (The second way is a lot easier.)
tnich said:
I think you will need to show that the Lagrange polynomial solution fits the end conditions of the cubic spline, too. If the cubic spline solution is unique, and the (unique) Lagrange polynomial solution satisfies all of its conditions, then it must also be the unique cubic spline solution.
Yes I see now Thank you.
 
Last edited:
Prove $$\int\limits_0^{\sqrt2/4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx = \frac{\pi^2}{8}.$$ Let $$I = \int\limits_0^{\sqrt 2 / 4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx. \tag{1}$$ The representation integral of ##\arcsin## is $$\arcsin u = \int\limits_{0}^{1} \frac{\mathrm dt}{\sqrt{1-t^2}}, \qquad 0 \leqslant u \leqslant 1.$$ Plugging identity above into ##(1)## with ##u...
Back
Top