Wednesday, 2 October 2013

calculus - Lagrange 2nd dregree interpolating polynomial



Given these set of points:

enter image description here



I must find the interpolating polinomial and find the value 0.32



Using the Lagrange formula, I did:



P(x)=a(x0,3)(x0,4)(a0,3)(a0,4)+b(x0,3)(x0,4)(b0,3)(b0,4)


*where a and b are the respective values of y for x=0,3 and x=0,4



Since he asks for a 2 degree polynomial, then I think he's asking me to pick the 2 closest points to x=0,32 and interpolate it. I did it and arrived at a 2nd degree polynomial. But when I try online interpolation generators I always end up with a line equation. So, here's what I did:




P(x)=0,067x20,7x+0,12(0,0670,3)(0,0670,4)0,376x20,7x+0,12(0,3760,3)(0,3760,4)



P(x)=0.067x20,7x+0.12(0.233)(0.333)0.376x20,7x+0.12(0.676)(0.776)



P(x)=0.86352(x20,7x+0.12)0.71676(x20,7x+0.12)=


0.14676(x20,7x+0.12)



Is my idea right? I didn't check the numbers, but am I doing it right?




In the other exercise, he asks me to find P3(0,32) (which I think is the third degree polynomial evaluated at 0,32). So I shluld pick another close point, in this case x=0,1 and to the process?



UPDATE: Just figured out I did the ring thing: this polynomial is 0 for 0.3 and 0.4, I'm dumb. How do I make it to be 1 for these values?


Answer



The nth degree Lagrange interpolating polynomial Pn(x) for the points x0,x1,,xn is given by Pn(x)=ni=0f(xi)nk=0ki(xxk)(xixk)


Notice thus, that in order to get an nth degree Lagrange interpolating polynomial, we need (n+1) distinct points.



Thus, for the second degree polynomial to we require three points (the ones closest to 0.32). Thus we choose the points 0.1   0.3   0.4



So we get

P2(x)=f(0.1)(x0.3)(x0.4)(0.10.3)(0.10.4)+f(0.3)(x0.1)(x0.4)(0.30.1)(0.30.4)+f(0.4)(x0.1)(x0.3)(0.40.1)(0.40.3)



Now, to answer your last question for P3(x) we need four points. We will must thus use all of them and get
P3(x)=f(x0)(xx1)(xx2)(xx3)(x0x1)(x0x2)(x0x3)+f(x1)(xx0)(xx2)(xx3)(x1x0)(x1x2)(x1x3)+f(x2)(xx0)(xx1)(xx3)(x2x0)(x2x1)(x2x3)+f(x3)(xx0)(xx1)(xx2)(x3x0)(x3x1)(x3x2)



I will leave it to you to substitute in the appropriate values.


No comments:

Post a Comment

real analysis - How to find limhrightarrow0fracsin(ha)h

How to find limh0sin(ha)h without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...