 Hi, we are learning polynomial interpolation for univariate functions. In this we have learned the existence uniqueness results and also we learn two ways to construct polynomial interpolation. In this lecture, we will start our study on errors involved in polynomial interpolations. We will study in detail the mathematical error involved in the polynomial interpolation in this class. There are two levels of errors involved in the polynomial interpolation. We will quickly see what are they? You are given a function f defined on the interval a b and you are given also n plus 1 nodes in the interval a b. Generally, we take x naught as a and x n as b and now we have generated this data set by taking the function values at the node points x naught x 1 up to x n and we know that we can find a unique interpolating polynomial for this data set. Let us call it as p n of x. Now, the question is if we want to use the polynomial p n of x as an approximation to f of x, then how good the approximation is? Well, this leads to the analysis of interpolation errors. Let us go one step closer and see what are all the levels of errors that are involved in the polynomial interpolation. You are given the function f which we want to approximate. From there, we have generated a data set like this and then we have constructed an interpolating polynomial p n of x. But generally we do this construction on a computer. Therefore, the first step of this is to feed in our data set. When we feed in the data set in a computer, the computer mostly will not take the function values exactly because it will do the floating point approximation when evaluating the value of the function at the node points. In that way what we get is an approximate value of the function at the node points. Well, the computer will also take the node points in the floating point approximation. But to some extent this error can be minimized because the node points are chosen by the user. You may choose the node points conveniently so that the floating point approximation that is the rounding error involved in the node points are minimized. In that way, we will always assume that node points are exactly represented whereas the rounding error or the arithmetic error is involved only in the function values. And thereby we are having the data set like this which is clearly different from the data set that we want to work with. Therefore, the computer will generate a polynomial interpolation which is different from what we want to consider. Let us denote this polynomial interpolation generated from the data set with floating point approximation as P n tilde. And therefore, there are two levels of errors involved in the output of the polynomial interpolation. What is the output that we get? We get this polynomial as the output for the approximation of the function f. But we want this one which we will never get if we go to compute the polynomial interpolation on a computer. The first level of the error is the mathematical error which is nothing but the difference between the exact value and the polynomial that we want to construct. So, this is typically the error involved due to the mathematical derivation of this approximation method. So, we will call this error as mathematical error. The next level of error is purely because of the computational factor. That is nothing but the difference between the polynomial that we want and the polynomial that the computer has given to us. And therefore, we will call this error as arithmetic error. Now, what is the total error? Well, total error is nothing but the sum of the mathematical error and the arithmetic error. In other words, the total error is actually what we are interested in minus what we finally got. So, this is the total error involved in this computation. And that can be obtained by adding P n of x and subtracting P n of x and subtracting P n of x. And that can lead to the mathematical error plus the arithmetic error. And that is the final expression for the total error. Therefore, in order to understand total error, we have to understand mathematical error as well as the arithmetic error. In this class, let us understand the mathematical error. Well, we have given the definition of mathematical error here as f of x minus P n of x. Now, we will try to derive an expression for the mathematical error. Let us state this expression in the form of a theorem. Here, we need to assume that f is a C n plus 1 function defined on the interval a b. What it means? It means f is continuously differentiable up to the order n plus 1. It means f is continuous and f dash exists. f dash is also a continuous function. Similarly, f double dash also exists. f double dash is also a continuous function and so on till f n plus 1 derivative also exists and it is also a continuous function. That is what is meant by saying that f is a C n plus 1 function and notationally it is written like this. Now, of course, we are given n plus 1 distinct nodes x naught x 1 up to x n all like this or in the interval a b with understanding that x naught is equal to a and x n equal to b although it is not strictly necessary to assume this, but in most of our analysis we will assume this at least when we are working with equally spaced nodes. Once we are given the nodes and the function, you can generate the data set and then you can construct the interpolating polynomial for the data set which we will call as the interpolating polynomial or polynomial interpolating the function f. Then the mathematical error involved in p n of x when compared to the exact value f of x is given by this expression. You can see that the mathematical error will be a function of x because you have the function f and suppose you are trying to get a polynomial like this then at every point you can see that the mathematical error will be different. It depends on the point x. So, here the mathematical error at this point x is given by this say is different from the mathematical error at this point say y. Therefore, the mathematical error is a function of x that is why we write this notation m e stands for mathematical error and it depends on x and also it is the mathematical error in the interpolating polynomial of degree n. So, this suffix n is also used in the notation and that is given by the n plus first derivative of f evaluated at an unknown point xi and this xi depends on the point x at which we are interested in seeing the mathematical error divided by n plus 1 factorial into this product. Let us try to derive this formula or expression for the mathematical error. For this remember we have to derive this formula for every x in the interval a, b. For that we will choose a x arbitrarily in the interval a, b and well there are two possibilities now x may coincide with one of the node points right because we are choosing x arbitrarily it may happen that the choice of x is in such a way that it coincides with one of the nodes. If that is so, then there is nothing to prove why because if x is a node then the mathematical error is equal to 0 because of the interpolating condition right. Therefore, there is nothing interesting for us to prove in this case mathematical error should become 0 and of course, it can also be seen from this expression. If x is equal to one of these x i's then that term will become 0 and therefore, this entire product will become 0 hence the mathematical error will be equal to 0 for any choice of xi x right. Well f n plus 1 is a continuous function defined on the closed and bounded interval therefore, it is a bounded function therefore, a finite number into 0 will come and that is obviously 0. So, there is nothing really interesting for us to prove because the expression is automatically giving us that the mathematical error should be 0 if x is one of the nodes. We will assume that x is not equal to any of the nodes that we have chosen to construct p n of x. In this case we have something non trivial to prove therefore, let us see how to derive the mathematical error formula in this case. The first step is to consider a function like this where this lambda is something which we will now choose in such a way that psi of x is equal to 0. You can see that by taking t equal to x in this expression you will see that the right hand side becomes 0 if you choose your lambda like this that is why we have inserted a parameter lambda here and then we have chosen it conveniently like this. Well we have seen that x is a 0 for the function psi you can also see that all the nodes x naught x 1 up to x n are also 0's of the function psi why it is so when you take t is equal to x i then this term will go to 0 for any i equal to 0 1 2 up to n. Any such choice will make this term to be 0 and this will be f of x i and well this is a interpolating polynomial at the node points there will be therefore, this will also be equal to f of x i thanks to the interpolation condition. Therefore, psi will vanish at all the node points therefore, how many 0's are there for the function psi you can see that there are n plus 1 0's coming from the nodes plus 1 0 that is coming from the point x that we have chosen arbitrarily to derive the mathematical error. So, there are totally n plus 2 distinct nodes now you have to go back to our mathematical preliminaries chapters exercise problems there is a exercise problem which says that a function psi has n plus 1 0's then psi dash will have at least n 0's at least that is very important n 0's why it is so it can come from the rolls theorem. So, if you have 2 0's say x 1 and x 2 then rolls theorem says that there is at least 1 point in between these 2 0's x 1 and x 2 let us call this as psi 1 where psi dash of psi 1 equal to 0. Therefore, if you have 2 0's then you have at least 1 0 in between that suppose you have 3 0's then you have at least 2 points at which psi dash will vanish. So, in general if you have n plus 2 distinct 0's then you have at least n plus 1 distinct 0's in the interval a comma b. Now, you apply the same idea to psi dash and try to see how many 0's are there in psi double dash will psi double dash will have at least n distinct 0's. Similarly, psi 1 equal to psi triple dash will have at least n minus 1 distinct 0's and so on at the end you can see by applying the rolls theorem repeatedly n plus 1 times on the function psi. We can conclude that the n plus first derivative of the function psi has at least 1 root. So, that is what you can conclude from the rolls theorem. Let us call this root as psi of x. Why this suffix x? Because psi depends on x as a parameter. Therefore, by changing this x your definition of psi will change and therefore, the 0 of the function psi n plus 1 will also change. To denote that this psi x is going to depend on x we have used this notation. Let us summarize we have chosen a point x arbitrarily in the interval a b in such a way that it does not coincide with any of the node points and then we defined this magic function psi of t and we have chosen this lambda in such a way that psi has at least n plus 2 roots. So, once we have this result by applying rolls theorem repeatedly we saw that the n plus first derivative of psi has at least 1 0 in the interval a b and we have denoted that 0 by psi of x. This is what we have done so far. Now, what is the next step? Well we have this expression we will differentiate this function n plus 1 times we will get an expression out of that right. Substitute t is equal to psi of x in that expression and equate it to 0 and let us see what is happening. So, we will go to differentiate this function n plus 1 times with respect to t note that in this differentiation x is considered to be a constant because it is used only as a parameter in psi right. So, it will not be a variable it is treated as a constant and we are differentiating psi only with respect to t. You can see that in the first term we will get f n plus 1 t right and in the second term when you go to differentiate the polynomial p n of t remember p n is a polynomial of degree less than or equal to n. Therefore, it is n plus first derivative is equal to 0 then we are not going to differentiate lambda because it is independent of t. Then we will have to differentiate this product and that will give us n plus 1 factorial. Now after all this of course we have to keep in mind that psi n plus 1 of psi x is equal to 0. Now let us put all this into this expression and see what happens well 0 is equal to psi n plus 1 of psi of x. On the right hand side we have differentiated this expression and that is given by this and we have substituted t is equal to psi of x in that right. What is lambda? Well lambda is given by this expression. You can see that this is precisely the definition of the mathematical error that we want to understand right. So, that is what is sitting here and this is nicely sitting in this expression. Let us plug in that and see we have f n plus 1 of psi of x that is kept as it is instead of lambda I am putting this expression and then of course n plus 1 factorial is kept as it is. Now you see instead of this I am just putting the notation of the mathematical error that is all. Now you have this expression where you can now keep m e n of x on the left hand side take all the other terms on the right hand side and you can go back to the statement of the theorem and see that you will get the precise expression for the mathematical error by doing this and that completes the proof of our theorem. Well we got a nice expression for the mathematical error however it cannot be used to quantify the mathematical error exactly. Why? Because this part is still unknown to us right. However one can use this expression to obtain some estimates on mathematical error. Well such an estimate will depend on the problem that we are working on. Here we will now try to consider few simple examples through which we will try to get an idea of how to estimate the mathematical error using the expression that we have derived. For this we need a notation called infinite norm this is not something new to us. If you recall in the matrix norms we have come across such concept L infinity norm right the same idea is here also but now we are applying this idea to define norm for a function. So, let us consider a continuous function on a closed interval a b why am I considering a continuous function because we know that a continuous function on a closed bounded interval is bounded and therefore it attains its maximum in the interval. And now the infinite norm of f which is denoted by this notation is nothing but you take the absolute value of f evaluated at each point in the interval a b and then take the maximum. That maximum is what we will call as infinite norm this is the notation therefore wherever I put this notation you have to understand that I am taking maximum over modulus of f of x in the interval a b. With that in mind let us see two examples where we estimate the mathematical error using the expression that we derived in the previous theorem. As a first example let us consider the most simplest polynomial that is the linear interpolating polynomial of a function f well we are taking two node points x naught and x 1 from there you can generate the linear interpolating polynomial p 1 of x right. Now the question is what is the mathematical error involved in it well that is nothing but f of x minus p 1 of x. And we now have an expression for that you go back to this previous theorem and see how to write the mathematical error expression involved in p 1 of x that is given by this expression where xi x is an unknown lying between the nodes x naught and x 1. Now if you want to find an estimate for this error the first step is take modulus on both sides and then you just split this modulus. Now you see you have two problems involved in it one is you have to eliminate or dominate this variable x remember now x is the variable and also this xi of x which is the unknown depending on the variable x right all this has to be dominated and we should get an upper bound where the upper bound is a fixed number which can be computed with our known information of course we will assume that f double dash is known to us with that in mind we will do or at least we will know the upper bound of f double dash that is what we will assume to derive this estimate. Now the first step is to take this function f double dash by our assumption f double dash is a C 2 function and therefore f double dash is a bounded function in the interval x naught x 1 and that shows that its maximum is achieved in the interval x naught x 1. So you can replace this term by its maximum right remember we have given a notation for that maximum therefore I will use that notation to denote that I am replacing f double dash of xi x by its maximum and thereby we are just freezing the unknown xi x by putting this known quantity and for that we have to also replace equal to symbol by less than or equal to symbol because we are replacing mod f double dash of xi by the maximum right that is why this happens now we have to only deal with this term now how to deal with this well you can see that it is nothing but the modulus of a quadratic polynomial and you can easily see where the maximum is achieved in the interval x naught and x 1 you can see that the maximum of this function is achieved at the point x naught plus x 1 by 2 that is at the midpoint of the interval x naught and x 1. So from here you can see that this function which is sitting here is less than or equal to this quantity that is we are evaluating this function at the point where it achieves its maximum therefore this function is less than or equal to this maximum value. So you can now substitute this value into this expression and thereby you can also eliminate x or dominate this term by its maximum. So that is what precisely we have done here well by this we got an upper bound for the mathematical error at the point x and this upper bound is independent of x what it means it means this inequality holds for all x in the interval x naught x 1 and that implies that even if you take the maximum norm of this mathematical error that will also satisfy this inequality therefore finally we will consider this as the estimate for the mathematical error what it says it says that whatever may be the mathematical error we do not know that but the worst case of the mathematical error because we have taken the maximum of it right therefore that is the worst mathematical error that we will come across in the linear polynomial interpolation and that will be surely less than or equal to this number you can see that if f double dash is something known to us or at least its maximum is known to us then the right hand side is fully known to us right. So in that way we obtained an estimate for the mathematical error let us give a more precise example in this case we will take the function f of x equal to sin x and let us restrict ourselves to the interval 0 comma 1 well now we will consider 10 node points in the interval 0 comma 1 and the corresponding values of the sin function at these nodes and thereby we can construct the ninth degree interpolating polynomial for this data set. Now our question is what is the estimate of this mathematical error well for that we have to first find the upper bound for this function and also we have to find the upper bound for this part right well let us go and take the modulus on both sides that is the easiest first step that we can do now we have to estimate this term and we have to estimate this term well this term in this particular example is not something difficult because it is just cos x and we can just put this over estimate for this because we know whatever may be x cos x surely going to lie between minus 1 and 1 right. Therefore we can in fact put this over estimate we can also make a better estimate by taking the fact that x lies between 0 and 1 remember x should be taken in radiance and you have to compute cos x and see where it attains its maximum in the interval 0 1 well it happens to be 1 only therefore this is actually not a bad estimate in this particular example but how to get the upper bound for this function well this is the absolute value of the tenth degree polynomial if you go to find the maximum of this function that may sound a bit difficult but what you can do is a clever observation that whatever may be x and x i they both are going to lie in this interval 0 comma 1 therefore their value at least the absolute value is going to be less than or equal to 1 right therefore whatever may be the maximum of this term its maximum is surely not going to exceed 1 right therefore I can use this over estimate for the second term and thereby I can say that the mathematical error involved in the ninth degree interpolating polynomial of the sine function is surely going to be less than or equal to 1 by 10 factorial which is approximately less than or equal to 2.8 into 10 to the power of minus 7 and remember this holds for all x in the interval 0 1 therefore you can replace mod m e 9 of x by its maximum norm also because it holds for all x and the upper bound is independent of x therefore this will even hold for that x at which m e 9 attains its maximum right therefore this is the final estimate that we want to get again you can see that whatever may be the worst case mathematical error for the ninth degree interpolating polynomial it is surely going to be less than 2.8 into 10 to the power of minus 7 that is what our analysis says now if you think that you can tolerate this much error then you can happily go for the ninth degree polynomial interpolation for your function. So, this is one illustration where you can use the expression for mathematical error to estimate your error. Let us have a visual feeling for the example that we have considered in this left side graph we have plotted the sine function with red solid line in the interval 0 to 1 and the blue dotted line indicates the linear interpolation polynomial for the function sine x at some points where the nodes are taken as 0 and 1 you can see the error is shown on the right side plot in the blue solid line well although I have written here as a mathematical error strictly speaking it is not the mathematical error because we have computed it on a computer, but still at the first degree polynomial level the arithmetic error is negligible. Therefore, we may still see this graph as the graph of the mathematical error let me go to increase the degree of the interpolating polynomial now I am considering the quadratic interpolating polynomial with nodes as 0.5 that is this point and 1 that is this point you can see that the error is now reduced literally little bit and also you can see the interesting part is that the error is touching the line y equal to 0 at the node points why because of the interpolation conditions right. Now I am just going to show you the plot of the ninth degree interpolating polynomial for which we have obtained an estimate using the theoretical result here I have taken 10 nodes x naught x 1 up to x 10 what all the values of this nodes well you can see the error plot and try to guess what are all the node points that we have taken precisely these are the points where the graph of the error hits the x axis right and the interesting part is what is the maximum value of this error in the interval 0 1 it is something very near to 1.8 into 10 to the power of minus 12 right that is the maximum that we have obtained in this particular example we can see explicitly what is that error if you go back what the theoretical estimate gave us theoretical estimate gave us 2.8 into 10 to the power of minus 7 therefore computationally the error that we have attained is much less than the theoretical estimate and hence our theoretical estimate is working well in this particular example with this our discussion on mathematical error is done thank you for your attention.