CHAPTER 02.03: DIFFERENTIATION OF DISCRETE FUNCTIONS: Newton's Divided Difference Polynomial Method: Theory   In this segment, we're going to look at how can we differentiate discrete data? So we want to be able to differentiate discrete data, and we're going to see that how do we go about doing that by, let's suppose, one of the techniques to do it is by using the Newton's divided difference polynomial. So what you basically do is that when somebody's giving you discrete data, you're going to use the polynomial, so let's suppose somebody's giving you y versus x . . . somebody gives you y versus x, and is giving you different data points, and what they want to be able to do is they want to find out what the derivative of y with respect to x is.    So, let's suppose four points are given to you, so you can, what you can do is you can draw a polynomial which goes through those four points, and for that, you will use the Newton divided difference polynomial, and then you will take the derivative of that polynomial to find out the value of the derivative at any point which is of interest to the person.  So that's where this whole thing comes from.  So you're going to take the n, let's suppose somebody gives you n data points, you're going to fit an n-minus-1th polynomial through those data points by using, let's suppose, Newton's divided difference polynomial, then we all know how to take the derivative of a polynomial, that's pretty straightforward, and that's how you can find out how to find the derivative of a polynomial.  So, if you look at, somebody's giving you . . . so somebody's given x0, y0, all the way up to xn, yn, so somebody's given me n plus 1 data points, the Newton's divided difference polynomial, which is explained in a separate segment, is given by this particular formula here. So you have the divided differences which you are using there. So these things which you are finding in the brackets, what some people call square brackets, they're basically actually divided differences, they're not the values of the function at these points, but they are the divided differences. And those are explained in a separate segment, but I will talk about it here also a little bit, and also in the example, henceforth.  So the last part of this one is x0 all the way up to xn, that divided difference which you are getting, times x minus x0, all the way up to x minus x-sub-n-minus-1. So that's how you are able to directly find out what the nth-order polynomial is, through Newton's divided difference polynomial going through n plus 1 data points.  So we want to keep things simple, let's suppose, in order to be able to explain how we're going to find the derivative.  So what that means is that this is the polynomial which will go through the n plus 1 data points, and then you're just going to take the derivative of this polynomial to find out the approximate value of the derivative for discrete data points.  So let's suppose somebody gives us three data points.  So, for example, we are given three data points, x0, y0, x1, y1, x2, y2. How do we go about finding out what the derivative of y with respect to x is at some point which is somewhere between x0 and x2, assuming that these data points are given, x values are given in ascending order?  So what you will get is that you will get that, hey, there's a second-order . . . second-order polynomial which is going to go through those three data points, and that will be given by the Newton's divided difference polynomial expression as f of x0, plus f of x0, x1, times x minus x0, plus f of the, then the divided difference of these three numbers, times x minus x0, times x minus x1.  So, if we we're going to take the derivative of that function, then we should be able to plug in any value of x which we want to, to the time it is is between the smallest value of x and the largest value of x which is given to you, you can find out what the expression will be, so it will be simply, this will be, this is a constant, all these divided differences which you are seeing here, they're all constants, so this will give me 0, this will . . . this is a constant, so this will be outside, and the derivative of x minus x0 is just 1. And then here I'll get the divided difference of x0, x1, x2 here. And then what I can do is, I can, rather than expanding this and then taking the derivative, I'm just going to use d by . . . I'm going to use the formula of d by dx of u v, so that means that's x minus x0, times the derivative of this, which is just 1, plus the . . . times . . . x minus x1, times the derivative of this, which is simply 1.  So you can very well see that what you are doing here is by doing it this way, you don't have to do any kind of expansion, symbolic expansion, you can just use your differential calculus knowledge to write an expression which is simply found out from your original expression. So that's how you'll be able to find out . . . so now, you have this expression, you can find out the values of the derivative of the function at any value of x between the lowest value of x and the highest value of x which is given to you.  So, if you were . . . so where this divided difference, x0, comma, x1, is nothing but the value of the function at y1 minus y0, divided by x1 minus x0, that's what this one stands for.  And the other divided difference which you have here, which is f of x0, x1, x2, the way it is found is that you take the divided difference of . . . you find the divided difference of x1, x2, and then the divided difference of x0, x1, and then divided by x2 minus x0. So, all these are related, so you have divided difference of these three numbers, then it is given in terms of the divided difference of two numbers, and you can go back like a tree on that one, and that again is explained by Newton's divided difference segment. So this one here will become y2 minus y1, divided by x2 minus x1, this one will become y1 minus y0, divided by x1 minus x0, and then divided by x2 minus x0. So that's how this individual number will be calculated, based on the three data points which are given to us, and that's how this number will be calculated, based on the three data points which are given to us, and then all you have to do is substitute them here and here, and put them into this particular formula to be able to calculate the derivative of the function at some point x between the lowest value of x and the largest value . . . and the highest value of x which is given to you.  And that's the end of this segment.