 Hi, we are learning polynomial interpolations for a given set of data. In this, we have learnt two ways to construct polynomial interpolations. One is using Lagrange form of interpolating polynomials and another one is the Newton's form of interpolating polynomials. In this, we have seen that Lagrange form has a very nice structure and therefore, it is suitable for theoretical studies. However, when it comes to computational purpose, Lagrange's polynomial is not very efficient and therefore, we have also introduced another form of interpolating polynomial that is Newton's form of interpolating polynomial. In the last class, we have seen that even Newton's form in the way we have formulated it is not going to be that efficient when compared to the Lagrange form. This is because the coefficients of the polynomial which we denoted by a case are depending on the polynomials of lower degree and that makes even the Newton's form computationally more expensive. In this lecture, we will introduce a concept called divided differences. These are precisely the coefficients in the Newton's form of the interpolating polynomial which can be written in a rather nice way that can be efficiently coded to get the coefficients more nicely. Let us start our lecture with brief recall of what we learnt in the last class on Newton's form of interpolating polynomial. We are given a data set with nodes x naught x 1 up to x n which are distinct nodes and the corresponding values are given as the y coordinate. Just to introduce the divided differences, notationally it is more convenient to use these values as they are obtained as the function values. This is just for the notational purpose therefore, we will assume that the y values are generated from a function. If you recall the Newton's form of interpolating polynomial for the given set of data is given like this where a case are obtained in terms of the lower degree polynomials. Now, we will just introduce a new notation f of x naught x 1 up to x k for the coefficients a k. This is just a notation with this notation it is more convenient for us to pose the formula that we want that is why we are introducing this notation and with this we can write f of x naught x 1 up to x n which is nothing but our a n in the Newton's form of interpolating polynomial and that can be written in terms of the lower order values and the formula is given like this. We will see this formula in more details in this lecture and we will in fact also derive this formula I am just posing this formula here. There is a easy way to remember it to obtain this quantity what you have to do is you have to take f of x 1 x 2 up to x n that is this minus f of x naught x 1 up to x n minus 1 divided by x n minus x naught. What are these? These are precisely the divided differences you have to start with say f of x naught which is nothing but the function value at x naught and similarly f of x 1 is equal to the function value at x 1 and so on. This is the zeroth order divided difference whereas the first order divided difference f of x naught comma x 1 is written as as per this formula f of x 1 minus f of x naught divided by x 1 minus x naught and similarly you can write f of x 1 comma x 2 and so on. These are the first order divided difference. In this way recursively you can obtain the higher order divided differences starting from the zeroth order divided difference and finally you will reach the nth order divided difference as this is called the nth order divided difference for the function f at these nodes. I hope you got an idea of how to obtain the nth order divided difference you have to start from the zeroth order and you have to step by step compute these divided differences till you reach the higher order and all these divided differences with x naught x 1 up to x k will appear as the coefficients in the Newton's form of interpolating polynomial. Let us see this in more detail. First let us give a formal definition for divided differences. Let x naught x 1 up to x n be distinct nodes and let p n of x be the polynomial interpolating the function f at these distinct nodes then the coefficient of x n in the polynomial p n of x is called the nth order divided difference and it is denoted by this notation. If you recall when we were introducing the Newton's form of interpolating polynomials we have used the notation a n for this but now we have just changed the notation because this notation is more convenient for us to write the formula for this quantity and it is called the nth divided difference of the function f. There is a very interesting and an important property of the divided difference. It is the symmetric property of the divided difference. The divided difference is a symmetric function of its argument. What it means that is suppose you are given n plus 1 nodes say x naught x 1 x 2 x 3 and so on. Let us just for the understanding purpose we will take only 4 nodes. Suppose these are given as say 0.1, 0.7, 0.3 and 0.5 remember if you carefully see the construction of the interpolation whether it is Lagrange or Newton they both never assume that the nodes are given in certain order whether it is a increasing order in their value or decreasing or whatever. You can take this nodes in any order you want just to indicate that I have taken these nodes in our example. Now what we will do is we will simply do a permutation with these nodes. Let us say we just make this permutation 0.3, 0.7 and 0.1 and after doing this permutation let us denote the nodes as z naught, z 1, z 2 and z 3. Now the theorem says that if you calculate the divided difference using these nodes that is the way they are arranged and the divided difference that you calculate using these nodes they both will be equal that is what the theorem says. It may look a bit surprising at the first instance because from here you can see that the divided difference is given by 0.1, 0.7, 0.3 and 0.5 and that is the is equal to f of you have to take from the second to the last 0.7, 0.3, 0.5 minus f of you have to take these nodes 0.1, 0.7 and 0.3 divided by 0.5 minus 0.1. So this is the divided difference coming from the first set of nodes and from the second set of nodes you can see that the divided difference is given by f of 0.5, 0.7 sorry 0.3, 0.7 and 0.1 is equal to 0.5 minus f of 0.3, 0.7, 0.1 minus f of 0.5, 0.3 and 0.7 divided by 0.1 minus 0.5. Now the theorem says that the value that you obtain from this formula is the same as the value obtained from this formula. This may look a bit surprising but this is true how will you show this well it is not very difficult you see you are given these nodes what you did you only made a permutation of these nodes right. You have not changed the value of these nodes therefore here the data set is given by f of 0.1, f of 0.7, f of 0.3 and f of 0.5 and similarly here you have f of 0.5, f of 0.3, f of 0.7 and f of 0.1. Therefore if you see from both of these data sets the polynomial that comes out will be of degree less than or equal to 3 say let us call this as p and the polynomial which comes out of it let us call this as q 3 of x you can clearly see that both this polynomials will have this same set of interpolation conditions right. Their interpolation conditions are not different only the way they are arranged is different but the values are same right. Therefore the interpolation conditions are going to be same both are of degree less than or equal to 3 and therefore by uniqueness of the interpolating polynomial they both have to be equal and hence the coefficient of their nth degree should also be the same that is how you get this result. Let us formally write this proof your nodes z naught z 1 up to z n is just a permutation of the given nodes x naught x 1 up to x n it means that the nodes x naught x 1 up to x n have only been relabeled as z naught z 1 up to z n right. You have not changed their values you just made their positions change here and there and then made a new notation for them that is all and therefore their corresponding function values are not going to change and hence the polynomial interpolating the function f at both these nodes are going to be the same right and if you recall by definition the nth order divided difference f of x naught x 1 up to x n is the coefficient of x n in the interpolating polynomial right and that is going to be the same as the coefficient of x n of the polynomial that is interpolated from the nodes z naught z 1 up to z n ok. You are not going to change anything and that will tell us that both this divided differences are going to have the same value. So, this is a very simple proof, but it is a very important result. Now, let us go to derive the actual formula for the nth order divided difference note that the formula is given like this let us see how to derive this formula. Let us start the derivation of this formula by setting up few notations. Let P n of x be the polynomial interpolated interpolating the function f at the nodes x naught x 1 up to x n and similarly P n minus 1 of x be the polynomial interpolating the function f at the nodes x naught x 1 up to x n minus 1 and now we will also consider another polynomial q of x which is the interpolating polynomial of f, but now with nodes starting from x naught and goes up to x n. Remember this is a polynomial of degree less than or equal to n this is a polynomial of degree less than or equal to n minus 1 and similarly this is also a polynomial of degree less than or equal to n minus 1 because there are only n nodes therefore, its degree should be 1 less right that is how it goes whereas, here you have n plus 1 nodes therefore, its degree is less than equal to n. Now, we will prove the following relation between P n minus 1 P n and q. Let us try to prove this relation that is P n of x remember its degree is less than or equal to n right whereas, this polynomial has degree less than equal to n minus 1 and both this polynomials have degree less than or equal to n minus 1. Now, you are multiplying this polynomial with degree n minus 1 with a x therefore, this entire thing will be a polynomial of degree less than or equal to n right. So, that is the first observation let us see how to prove this relation for time being let us forget this part and just take the right hand side polynomial just now we have seen that the right hand side polynomial is of degree less than or equal to n right. So, that is very clear you can also see that the right hand side polynomial satisfies all the interpolating conditions at x naught x 1 up to x n remember P n of x is the interpolating polynomial of f at these nodes. Now, what we can observe is even this polynomial which is a polynomial of degree less than or equal to n also satisfies the interpolation conditions at these nodes how will you see this well let us take x naught and see what happens take x equal to x naught x equal to x naught you can see that this becomes x naught minus x naught therefore, the entire term goes to 0 at x equal to x naught right. Therefore, you are only left out with P n minus 1 of x naught right and that is actually equal to f of x naught why because P n minus 1 is an interpolating polynomial at x naught also right therefore, this polynomial satisfies the interpolation condition at x equal to x naught. Now, let us take the point x equal to x 1 and see whether this right hand side polynomial satisfies the interpolation condition at x equal to x 1 take x equal to x 1 you can see that this becomes x 1 this becomes x 1 and this is x 1 x 1 now you can see that q is also a polynomial interpolating the function f at x 1 therefore, this will be f of x 1 and P n minus 1 is also an interpolating polynomial for the function f at the point x 1 therefore, this is also equal to f of x 1 right therefore, now this quantity which is in this bracket will become 0 and therefore, this entire thing becomes 0 and you know this is f of x 1 again you can see that the right hand side polynomial satisfies the interpolation condition at x equal to x 1 right at x equal to x naught this term vanished and x equal to x 1 this term vanished similarly from x equal to x 2 to x equal to x n minus 1 you can see that P n minus 1 also satisfies the interpolation condition the same interpolation condition is also satisfied by q of x up to x n minus 1 therefore, just like what happened with x 1 it will also happen with x 2 then x 3 and so on up to x n minus 1. So, you can see that this right hand side polynomial satisfies the interpolation condition at x 1 x 2 up to x n minus 1 therefore, it remains only for us to show the interpolation condition for x equal to x n well if you take x equal to x n you will see that this gets cancelled and you have q of x n P n minus 1 of x n they need not be equal therefore, this may not become 0 no problem, but this will get cancelled with this and you will have q of x n and you see q is an interpolating polynomial at x n also therefore, that will be equal to f of x n. So, even at x n this polynomial is satisfying the interpolation condition therefore, the right hand side polynomial actually satisfies all the interpolation conditions that is what we have shown what does it mean it means the right hand side polynomial is an interpolating polynomial at the points x naught x 1 up to x n remember P n of x is also an interpolating polynomial at x naught x 1 up to x n therefore, by uniqueness they both have to be the same that is how this relation comes. So, we have proved that P n of x is equal to P n minus 1 of x plus x minus x naught divided by x n minus x naught into q of x minus P n minus 1 of x. Now, we are almost done with our derivation of the formula for nth order divided difference it is just one step that we have to complete what is that once if you have this relation you can immediately see that the coefficient of x n from this polynomial is equal to the coefficient of x n coming from this polynomial right both have to be equal because the polynomials are equal. Now, what is the coefficient of x n in P n of x that is from the definition of the divided difference it is nothing, but f of x naught x 1 up to x n right because P n is the interpolating polynomial at the nodes x naught x 1 up to x n therefore, the coefficient of x n in this polynomial is this. And now what is the coefficient of x n in this polynomial let us see the coefficient of x n minus 1 that is the highest coefficient in this polynomial remember this polynomial that is q is a polynomial of degree less than or equal to n minus 1. Therefore, its coefficient is by definition of the divided difference it is equal to f of x 1 x 2 up to x n right because q is interpolated at these nodes that is why by the definition of divided difference the coefficient at the highest degree of q that is x n minus 1 is this. And now you are multiplying x n minus 1 with x therefore, this will become the coefficient of x n. So, I will have this term here that is f of x 1 x 2 up to x n then minus similarly what is the coefficient of x n minus 1 in P n minus 1 of x again by the divided difference formula you can see that it is f of x naught x 1 up to x n minus 1 why it is so P n minus 1 of x is the interpolating polynomial at these nodes right. Now again you will multiply this with x and therefore, this will be the coefficient of x power n right. So, therefore, this will be f of x naught x 1 up to x n minus 1 I am just comparing the coefficient of x n on both sides I am just trying to see what is the coefficient of x n on the right hand side polynomial. Now you have 1 x n minus x naught here that will come here in the denominator x n minus x naught. And this is precisely what we wanted to show as the formula for the nth order divided difference f of x naught x 1 up to x n ok. Next is an interesting concept called divided difference table if you see from the formula of nth order divided difference it recursively depends on the lower order divided differences when you go to compute them especially manually it is quite confusing for us because of this recursive nature of the computation. So, if you want to compute manually what people do is in order to avoid the confusion they put these values in the form of a table. This is also called the central divided difference table similarly you can also form forward divided difference table and backward divided difference table. And we will omit the construction of forward and backward divided difference tables. Let us take the example of having x naught x 1 up to x n to be x 5. And let us try to understand how to construct the divided difference table up to 5th order divided difference first you write the given data in the column wise like this and then you can see that this column represents the divided difference of order 0. Remember this is nothing but f of x naught this is the 0th order divided difference similarly this is f of x 1 and so on. Therefore, this second column is the 0th order divided difference the third column is the first order divided difference where the first term is obtained by taking the difference f of x 1 minus f of x naught divided by x 1 minus x naught. You can go back and just look into the formula that we have derived just now and see how to find this value. You can immediately see that its formula is nothing but f of x 1 minus f of x naught divided by x 1 minus x naught and once you compute this formula you have to write that value in between these two values. So that is the format of the central divided difference table and similarly f of x 1 comma x 2 is obtained by taking the difference between this number and this number divided by this minus this and that has to be written in between these two numbers. Similarly all the other elements should also be computed with the same idea. Now going to the second order divided difference f of dot dot dot ok. So, this is going to be the second order going to be the second order divided difference how will you get this value well this f of x 1 x 2 minus f of x naught x 1 then you go diagonally downwards and similarly diagonally upward till you reach this 0th order and then take just parallely from here. Therefore, this value is computed as f of x 1 comma x 2 minus f of x naught comma x 1 divided by x 2 minus x naught. Similarly how will you get this value it is f of x 2 comma x 3 minus f of x 1 comma x 2 then you go diagonally downwards and then diagonally upwards and then you pick up this value and this value divided by x 3 minus x 1. So, this is how you will compute the second order divided difference. Similarly how to find the third order divided difference for instance this value is computed by taking the difference between this number minus this number minus this number and then you go diagonally downwards up to the 0th order and then pick up the x coordinate parallely similarly this side you go like this and pick up the x coordinate here. So, the denominator is x 3 minus x naught and similarly you can also obtain the value of this by taking this minus this divided by x 4 and similarly this side is x 1 like this it will go similarly you can get the fourth order divided difference and fifth order divided difference. Once you get this table done then it is very easy for you to write down the Newton's form of interpolating polynomial what you do is you pick up all these values at the leading diagonals you take all these values and they will see it as the coefficient in the Newton's interpolating polynomial. Let us see since we have x naught x 1 up to x 5 that is what we have taken in our example. Therefore, we will be constructing the fifth degree interpolating polynomial for the function f and it is given by f of x naught and that is the value obtained here then plus f of x naught comma x 1 into x minus x naught you will not write x minus x 1 here ok. So, this will not come you will only have up to the previous one and that is just obtained from this element similarly f of x naught comma x 1 comma x 2 into x minus x naught into x minus x 1 that is what is sitting here and what is this value this value is precisely coming from here. Then go to the third term the third order divided difference into x minus x naught x minus x 1 and x minus x 2 that is sitting here and what is this third order divided difference that is coming from here similarly the fourth term and the fifth term they are also coming from the top diagonal elements right. So, that is the easy way of remembering the construction of Newton's interpolating polynomial. Now, the advantage of writing the Newton's form of interpolating polynomial in terms of the divided differences is that it is very easy to remember if you understand the divided difference table and also to compute this polynomial on a computer these coefficients can be obtained using a recursive subroutine and therefore, it is very efficient to compute Newton's interpolating polynomial you do not need to remember the lower degree interpolating polynomials in order to get these coefficients. In that way Newton's interpolating polynomial becomes more efficient than Lagrangian interpolating polynomial with this let us finish this lecture thank you for your attention.