00:01
We're going to use the lagrange interpolation to find a quadratic polynomial that fits the following data x0 equal 1 and f at x0 equal 0 x1 equal 4 and f at x1 equal 1 .386294 and x2 equal 6 and its image f at x2 equal 1 .791759.
00:32
So we know having in this case three nodes, three points, the lagrange polynomial, let's call it p2 of x is given the following way.
00:49
We have x minus x1 times x minus x2, that is the only factor we don't use is x minus x0 because we are writing the corresponding lagrange polynomial for x0.
01:09
And this expression is divided by x0 minus x1 times x0 minus x2, that is the polynomial in the numerator evaluated at x0 and that times f at x0 plus now the term corresponding to x1 such that the term x minus x1 does not appear so we get x minus x0 times x minus x2 and so in the denominator we evaluate the numerator, we put the evaluation of the numerator in x equal x1 so we get x1 minus x0 times x1 minus x2 and that multiplied by the image at x1.
02:01
And finally the third term corresponds to node x2 that is we put binomials x minus x0 times x minus x1 divided by the evaluation of this numerator in x equal x2 so we get x2 minus x0 times x2 minus x1 and that multiplied by f at x2.
02:26
In this way we are ensuring that this polynomial passes through the points x0, f at x0, x1, f at x1 and x2, f at x2.
02:42
And the polynomials defined this way, these three polynomials here are the lagrange polynomials that we used to construct the interpolating polynomial under the form of lagrange.
02:56
So we have this and we put the values now.
02:59
So p2 of x is, let's say x minus x1 that is x minus 4 times x minus x2 is 6 over and x0 is 1 so we get 1 minus 4 times 1 minus 6.
03:22
But that's multiplied by f at x0 is 0 so this term is going to nullify.
03:28
We write it down to verify, to know that it's going to be 0 but we wrote it anyway all the terms plus x minus x0 is 1 times x minus x2 is 6 divided by the evaluation at x1 is 4 minus 1 times 4 minus 6 times f at x1 that is 1 .386249.
04:10
Okay plus i'm going to put it right down here x minus x0 is 1 times x minus x1 is 4 divided by the evaluation at x2 which is 6, 6 minus 1 times 6 minus 4 okay times f at x2 is this number here 1 .79175.
05:28
So we get 1 .79175...