 Today, first we are going to look at number of computations needed to evaluate polynomial p n interpolating polynomial in the Newton's form. Next, we will look at cubic hermite interpolation where not only function values are interpolated, but the derivative values are interpolated. So, we will look at the existence and uniqueness of a cubic hermite polynomial, the error in it and then I will state a result about the convergence of interpolating polynomial. After that, we are going to look at piecewise polynomial. So, in this lecture, we will consider mainly piecewise linear polynomial. So, a polynomial in Newton's form interpolating polynomial it is given by p n x is equal to f x 0 plus divided difference based on x 0 x 1 into x minus x 0 plus divided difference based on x 0 x 1 x n into x minus x 0 x minus x n minus 1. So, it is a polynomial of degree less than or equal to n which matches with f at x j j going from 0 1 up to n. So, it is of the form a 0 plus a 1 x minus x 0 plus a n x minus x 0 into x minus x n minus 1. So, in order to compute the coefficients a 0 a 1 a n, we will need to calculate the divided differences. So, we will first look at the number of computations needed to calculate these divided differences and then we will consider an efficient way of evaluating p n at a point once we have computed a 0 a 1 up to a n. Now, the recurrence formula for the divided difference based on k plus 1 points is given by f x 1 x 2 x k minus f x 0 x 1 x k minus 1. So, here are k plus 1 points, here are k points, here are k points divided by x k minus x 0. So, in case we have the divided differences based on k points available, then what we need is 1 subtraction here, 1 subtraction here. So, total 2 subtractions and then 1 division. Now, this is for 1 divided difference. So, let us look at the divided difference table. The divided difference table is given by these are our points x 0, x 1, x 2, x n. These are the function values, then f x 1 minus f x 0 divided by x 1 minus x 0 will give us this divided difference and so on and we continue. So, the total number of divided differences which we will need to calculate will be in the first column, there will be n divided differences. In the second column there will be n minus 1 and in the last column 1. So, thus total it is n into n plus 1 by 2 divided differences and for each divided difference we need 2 subtraction and 1 division and thus the total cost for the divided difference table will be for each divided difference 2 subtraction and 1 division and we need to calculate total n into n plus 1 by 2 divided differences. So, it is going to be n into n plus 1 subtractions plus n into n plus 1 by 2 division. So, what is important is power. So, it is going to be of the order of n square. Now, once we have calculated the divided differences we have got the coefficients a 0 a 1 a n and now let us look at the number of computations for evaluating our interpolating polynomial. So, let me first look at a polynomial of degree 2. So, p 2 x is a 0 plus a 1 x minus x 0 plus a 2 x minus x 0 x minus x 1. Let us ignore these subtractions x minus x 0 then x minus x 0 x minus x 1 assume that they are already done. So, here if we directly do it there will be one multiplication here 2 multiplications here. So, 3 multiplications plus 2 additions. Now, in Horner's scheme what we do is we write the same polynomial in the form a 2 into x minus x 1 plus a 1 into x minus x 0 plus a 0. So, it is the same polynomial I am just writing differently. Now, I will I will have one multiplication here one addition here then I will have one multiplication here. So, instead of 3 multiplications I will have 2 multiplications and there will be 2 additions as before. So, for the quadratic polynomial instead of 3 multiplications we have got 2 multiplications, but for a polynomial of degree n the saving is going to be much more. So, here if you have got p n to be a polynomial in the Newton form here if I evaluate p n directly I will have one multiplication here the next one next term will have 2 multiplications and last term will have n multiplications. So, total n into n plus 1 by 2 multiplications and n additions. Now, as we did before if we consider the algorithm b n is equal to a n and then for j is equal to n minus 1 up to 0 you are reducing the values of j to be b j is equal to a j plus b j plus 1 into x minus x j then when we reach b 0 that is going to be p n x here you see that you are doing it for j is equal to n minus 1 up to 0. So, there are going to be n multiplications and n additions. So, instead of n square by 2 multiplications you have reduced it to n multiplications. So, that is a considerable saving and that is known as Horner scheme. Now, next what we want to do is we want to consider cubic hermite interpolation. So, this is part of what is known as osculatory interpolation. What we are going to do is consider a function f defined on closed interval a b and let us try to find a polynomial of degree less than or equal to 3 which interpolates the given function at a and b the two end points and also the polynomial its derivative should approximate or if p 3 is the polynomial p 3 dash at a should be equal to f dash at a where dash means derivative and p 3 dash at b is equal to f dash b. So, we will be interpolating function values and the derivatives values at the two end point and that is the cubic hermite interpolation. We will first prove its existence and then we will prove its uniqueness and after that we will look at the error. Now, the way we are going to write this p 3 is if we know how to write if our points x 0, x 1, x 2, x 3 if these are distinct points then we know how to write p 3 x in the Newton form. Now, the difference we here it will be instead of distinct points you will have x 0 is equal to x 1 is equal to a. So, x 0 and x 1 are identical and x 2 and x 3 are identical, but we will try to write a similar formula as in the case of distinct points and see whether it works. So, assume that f to be defined on interval a, b taking real values and assume that it is it to be differentiable, a means to find a polynomial p 3 of degree less than or equal to 3 such that p 3 at a is equal to f at a, p 3 at b is equal to f of b. The derivative of p 3 at a is equal to f dash a and derivative of p 3 at b is equal to f dash b. Now, let us recall that if x 0, x 1, x 2, x 3 are distinct points then the interpolating polynomial p 3 x is given by value of f at x 0 plus divided difference of f based on x 0, x 1 into x minus x 0 then divided difference based on x 0, x 1, x 2 into x minus x 0, x minus x 1 and the last term is divided difference based on the four interpolation points multiplied by x minus x 0, x minus x 1, x minus x 2. Suppose x 0 is equal to x 1 is equal to a and x 2 is equal to x 3 is equal to b then this f of x 0, x 1 that is going to be f of a, a and then we have we are defining it to be equal to f dash a. Here, this divided difference will be f of a, a, b. So, that will be f of a, b, a and b are distinct minus f of a, a which is f dash a divided by b minus a. So, f of a, a makes sense f of a, a, b makes sense and f of a, a, b, b will be defined in a similar manner. So, here is a divided difference table a repeated twice, b repeated twice these are the function values. The divided difference corresponding to this will be f dash a, the divided difference based on a, b will be f a, b and divided difference based on b, b that is f dash b. Next, f of a, a, b is f of a, b minus f dash a divided by b minus a. Similarly, f of a, b, b will be f dash b minus f of a, b divided by b minus a and the last term will be given by f of a, b, b minus f of a, a, b divided by b minus a. So, this is divided by b minus f of a, b divided by b, b, b, b and divided difference table corresponding to a repeated twice, b repeated twice. So, here one needs to be given function value at a, function value at b, derivative of f at a and derivative of f at b and then our p 3 x is f of a plus f of a, a x minus a plus f of a, a, b x minus a square and this. So, this I write, but now I want to show that this is our desired polynomial, which interpolates the function and derivative values at two end points. So, first of all put x is equal to a, when I put x is equal to a, there is x minus a term here, x minus a term here, x minus a term here. So, p 3 at a will be equal to f at a, take the derivative of p 3. So, this being a constant term, its derivative will be 0. So, you will have f of a, a then derivative of this will be 2 times x minus a into f of a, a, b plus this divided difference and then by product rule, this will be 2 into x minus a into x minus b plus x minus a square. When I put x is equal to a, there is x minus a term here, x minus a term here and x minus a term here. So, p 3 dash at a is equal to f dash at a. So, this p 3, it interpolates the function value at a and its derivative at a. Now, let us look at the case, when x is equal to b. So, when I put x is equal to b, p 3 of b will be f of a, this is f dash a, x is equal to b. So, b minus a plus this will be f a b minus f dash a by b minus a into b minus a square. So, 1 b minus a will get cancelled, then f dash a into b minus a gets cancelled, f of a b is f b minus a upon b minus a. So, this will be f a plus f b minus f a. So, it is equal to f of b. So, thus p 3 interpolates the function value at b and now what remains is the, whether it interpolates the derivative value at point b. So, this is our p 3 dash x, we have seen earlier, put x is equal to b and then you will have f dash a plus 2 times f of a a b into b minus a plus this, this will be nothing but f of a b b minus f of a a b and then divided by b minus a. So, we are putting x is equal to b. So, no contribution from this term and then you have got b minus a. So, this was our p 3 dash b, now we simplified, this will be f dash a, then here you have 2 times f of a a b into b minus a and here it is minus. So, that is going to be f of a a b with plus sign and then this plus f of a b b into b minus a, this will be nothing but f dash b minus f of a b divided by b minus a. So, it will get cancelled here, here it is f of a b minus f dash a. So, again b minus a gets cancelled and then you have got f dash b. So, thus the polynomial of degree less than or equal to 3, which we wrote in a analogous fashion when the interpolation points were distinct, we saw that it is the desired polynomial that means it interpolates the function and derivative values at two end points a and b. Now, we want to show uniqueness. So, for the uniqueness we are going to use the result from the fundamental theorem of algebra that if you have got a polynomial of degree less than or equal to n and if it has got n plus 1 0s. Now, these n plus 1 0s that means counted according to their multiplicities, then such a polynomial has to be 0 polynomial. So, we have let me recall that a simple 0 means f of c is equal to 0 f dash c not equal to 0. A 0 of multiplicity m that means the function value and its derivatives up to m minus 1 they are 0, but f m c not equal to 0. When m is equal to 2, we call it to be a double 0. Now, this is the fundamental theorem or rather consequence of fundamental theorem that a polynomial of degree n has exactly n 0s counted according to their multiplicities. As a consequence of this a non-zero polynomial of degree less than or equal to n it has got at most n distinct 0s and if a polynomial of degree less than or equal to n has more than n 0s then it is going to be a 0 polynomial. So, it is this result that we are going to use to show the uniqueness of cubic hermite polynomial. So, let p 3 and q 3 be 2 polynomials of degree less than or equal to 3 which interpolate the given function and the derivative at points a and b. So, if I look at p 3 minus q 3 that will be a polynomial of degree less than or equal to 3 which will vanish at a vanish at b and also their derivatives will vanish at a and at b. So, if you look at p 3 minus q 3 it will be a polynomial of degree less than or equal to 3 such that the it has got double 0 at a and double 0 at b. That means when we count according to the multiplicity p 3 minus q 3 has got 4 0s, but it is a polynomial of degree less than or equal to 3. So, that means it has to be a 0 polynomial. So, p 3 minus q 3 a polynomial of degree less than or equal to 3 which has got 4 0s that means a double 0 at a and double 0 at b. So, p 3 minus q 3 x has to be identically 0 and that implies that p 3 x is equal to q 3 x. So, now we have proved the existence and uniqueness of cubic hermite polynomial. Now we want to look at the error in it. When we had considered the interpolating polynomial and the interpolation points being distinct points we have got a error formula. The same formula is going to hold even when the points are repeated. When we proved the error formula for interpolating polynomial what we had used was Rolls theorem. So, the proof is similar and what I am going to do is I am going to write the directly the formula the proof is being very much similar I am going to skip it. So, when the interpolation points are distinct say p 3 a polynomial interpolating at x 0 x 1 x 2 x 3 then f x minus p 3 x is this is the error term. The divided difference based on x 0 x 1 x 2 x 3 x and multiplied by function w x where w x is x minus x 0 x minus x 1 x minus x 2 x minus x 3 we have got x 0 is equal to x 1 is equal to a and x 2 is equal to x 3 is equal to b. So, that means the error will be the divided difference and then x minus a square and x minus b square. Now, let us calculate the infinity norm of f minus p 3 that is the maximum norm and that is modulus of f x minus p 3 x it is maximum over the interval a b. This divided difference is going to be fourth derivative evaluated at some point c which depends on x divided by 4 factorial and hence norm of f minus p 3 infinity take the modulus of both the sides and take maximum over interval a b. So, this will be less than or equal to norm f 4 infinity divided by 4 factorial and then maximum of this function. Now, when we want to calculate maximum of this function we want to calculate absolute maximum. So, the absolute maximum is obtained by considering the two end points and the critical point. So, the critical points are the points where the derivative vanishes or it does not exist. So, let me call this x minus a square x minus b square to be function g x its derivative is given by by using product rule it is 2 into x minus a x minus b square plus 2 into x minus a square into x minus b. So, take common x minus a into x minus b and simplify. So, you will get 4 x minus a x minus b x minus a plus b by 2. So, we have got g x is equal to x minus a square x minus b square we are trying to calculate maximum of modulus of g x x belonging to interval a b g dash at a is equal to 0 g dash at b is equal to 0 and g dash of a plus b by 2 is 0. So, we look at the value of g at these 3 points a b and a plus b by 2 and whichever is the maximum that is the absolute maximum. So, when I look at g x g at a will be 0 g at b will be 0 and g at a plus b by 2 will be b minus a by 2 square and hence we will have error in the cubic hermite polynomial to be less than or equal to norm f 4 infinity divided by 4 factorial into b minus a by 2 ratio. So, this is 2 4. So, now, what I am going to do is I am going to look at an example. So, we will consider a specific example calculate its cubic hermite polynomial and then afterwards we will consider the convergence of interpolating polynomial. So, let me just recall that if I want to calculate the cubic hermite interpolating polynomial I need to prepare such a divided difference table. Here a is repeated. So, this entry is f dash a b is repeated. So, this entry is f dash b and f of a a b is the usual recurrence formula. Once we prepare such a divided difference table then p 3 x is f a plus f dash a into x minus a plus f of a a b x minus a square and f of a a b b x minus a square x minus b. This term corresponds to x minus x 0 x minus x 1 our x 0 is equal to x 1 is equal to a. So, look at function f x to be x raise to 4 plus x cube plus x square plus x plus 1. Its derivative will be given by 4 x cube plus 3 x square plus 2 x plus 1. The value at 0 it is going to be f of 0 will be 1 f of 1 is going to be 5. This entry here this is going to be f dash at 0. So, f dash at 0 from this formula it is 1. Then this will be f of 0 1. So, it is 5 f of 0 f of 1 divided by 1 minus 0. So, that is 4 this entry is f dash of 1. So, f dash of 1 is going to be equal to 10 put x is equal to 1 in this formula. Now, this will be 4 minus 1 divided by 1 minus 0. So, that is 3 then 10 minus 4 divided by 1 minus 0. So, that is 6 and finally, this entry is 6 minus 3 divided by 1 minus 0. So, that is 3. Now, our polynomial p 3 x will be 1 plus 1 into x because that is x minus 0 plus 3 into x minus 0 square. So, that is x square plus 3 into x minus 0 square and then x minus 1. So, this is going to be cubic hermite polynomial for this function f x. Now, let me add one more interpolating point. Suppose, I am going to have x minus 0. So, I am going to have x minus 0. So, I want to find a polynomial which interpolates the given function at 0 repeated 1 repeated and 2. So, then this divided difference table we had already calculated. So, we just need to add these entries. So, here is 2 f of 2 is 31 this entry will be 31 minus 5 divided by 2 minus 1. This entry is 16 minus 20 divided by 2 minus 1. So, it is 16 then you have 16 minus 6 divided by 2 minus 0. So, that is why 5 and 5 minus 3 divided by 2 minus 0. So, that is 1 and now p 4 x will be this p 3 x and then you add one more term. The coefficient of that term is 1 and then your interpolation points are 0 0 1 1. So, that is why x square into x minus 1 square when you simplify. So, this was our p 3 x 1 plus x plus 3 x cube x square into x minus 1 square will be x raise to 4 minus 2 x cube plus x square. So, you get back f x which is what it should be. You have got a function f to be a polynomial of degree 4 and you are considering the interpolation from a space of polynomials of degree less than or equal to 4. So, we have seen that the interpolation it reproduces polynomials. So, even when some of the interpolation points are repeated the property will hold and then you will get the interpolating polynomial to be the function itself because we had a polynomial of degree 4 and we had 5 interpolation points 0 repeated twice, 1 repeated twice and 2. So, now that brings me to convergence of interpolating polynomial. So, we have f x minus p n x to be the divided difference multiplied by w x where w x is product of x minus x j, j going from 0 1 up to n. p n is the polynomial which interpolates the given function at n plus 1 points and which has got degree to be less than or equal to n. If your function f is sufficiently differentiable in this case suppose it is n plus 1 times differentiable then the divided difference will be f n plus 1 evaluated at some point c divided by n factorial. So, norm of f minus p n will be less than or equal to norm of f n plus 1 divided by n plus 1 factorial into norm of w. So, w is given by x minus x 0 x minus x n x varies over the interval a b x 0 x 1 x n they are also in the interval a b. So, x minus x j will be at the most b minus a and hence modulus of w x will be less than or equal to b minus a raise to n plus 1. So, look at now the error suppose that this n plus 1 derivative is less than or equal to m for all n this is the same bound for all the derivatives then we will have m into b minus a raise to n plus 1 divided by n plus 1 factorial. Now, no matter how big b minus a is b minus a raise to n plus 1 divided by n plus 1 factorial that will tend to 0 and hence if you have got this condition that your function f is infinitely many times differentiable and the derivatives they are bounded by a constant. In that case your interpolating polyrhythmic normials p n they will converge to f in the uniform norm as n tends to infinity. For example, the function f x is equal to e raise to x sin x the entire functions which are defined on say interval a b. Now, this is a very strong condition what verestras theorem tells that if you have got f to be a continuous function then it is uniformly approximated by polynomials. Now, the verestras theorems says that it is uniformly approximated by polynomials it does not say by interpolating polynomial and in fact, the result is not true. So, here you have got well known example which is known as Runge example that f x is equal to 1 upon 1 plus 25 x square x belonging to minus 1 to 1 and suppose you choose interpolation points to be equidistant points. If you want to consider p 1 you will need 2 points so take them to be minus 1 1 for p 2 you will need 3 points. So, take them to be minus 1 0 1 for p n you will need n plus 1 points. So, divide minus 1 to 1 into n equal parts and look at the partition points then norm of f minus p n infinity norm tends to infinity as n tends to infinity. So, not only it does not tend to 0, but it tends to infinity. So, then one feels that may be something is wrong with the equidistant points that I chose interpolation points to be equidistant points and then my interpolation is interpolating polynomials they do not converge in the norm. So, why not take the Chebyshev points those were in some way optimal it minimized the norm of W, but then there is a result that no matter how you choose your interpolation points there will always exist a continuous function for which you will not have convergence. So, here is a negative result that if I want to approximate f by interpolation points and I am ready to increase the degree, but then no matter how I will choose my interpolation points there will always exist a continuous function for which I will not have convergence. So, this is the drawback of interpolating polynomials, but we had seen that as such one should not go for high degree polynomials because they have got stability problem. So, then what one does is instead of increasing the degree of the polynomial sub divide your interval a degree into n parts and on each interval you approximate or you consider interpolating polynomial of a fixed degree. For example, say polynomial of degree less than or equal to 1. So, what you are doing is you are fixing the degree of the polynomial on each sub interval and you are ready to increase the number of intervals. Now, if you do such a thing then under relatively modest conditions you are going to have convergence. So, from polynomials you are going to piece wise polynomials. Now, there is always a tradeoff in this case we gain in convergence, but there is a loss in smoothness. Polynomials they are infinitely many times differentiable whereas, piece wise polynomials they will their differentiability properties they will get reduced. For example, if you want piece wise linear polynomials then at the most you can have linear overall continuity. If you are considering piece wise quadratic then you can have C 1 continuity. That means you can say. So, what I am saying is on each interval it is a quadratic polynomial or polynomial of degree less than or equal to 2 and then overall it will be differentiable. When you consider in the interior of sub interval there will be no problem it will be infinitely many times differentiable, but you are going to join two quadratic polynomials. When you look at the adjoining intervals you are going to have different quadratic polynomials. So, at the joining point there is going to be you can say only or you can demand only the C 1 continuity. If you say it should be a C 2 continuity it will be a single polynomial on the two intervals. So, here is the Faber's result that you choose interpolation points in any manner you want whatever rule you do there exists a continuous function f for which the interpolation point interpolating polynomials will not converge to f in the maximum norm. Now, this is a negative result there is also positive result and that result is you fix a continuous function then there will always exist a set of points. If you choose those set of points and consider interpolating polynomials then norm of f minus p n infinity norm will tend to 0 as n tends to infinity. Now, there is a catch and the catch is there is a there exists. That means, it is difficult you know like given a continuous function I do not know what there exists, but I do not have a recipe for such interpolation point but anyway it is a positive result that there exists a set of points for which interpolation points they are going to converge to f in the norm. Now, we are going to consider the piecewise polynomials. So, the first thing as I said what we are going to do is we are going to look at piecewise linear polynomial. So, let me first recall the single linear polynomial. If you have got f to be defined on interval a b taking real values x 0 and x 1 these are points in interval a b then p 1 x is equal to f x 0 plus f of x 0 x 1 x minus x 0 plus f of x 0 x 1 x minus x 0 plus f of x 0 x 0 this is polynomial of degree less than or equal to 1. So, p n polynomial of degree less than or equal to 1 and p 1 x 0 is equal to f x 0 p 1 x 1 is equal to f x 1 the error is given by f x minus p 1 x is equal to f of x 0 x 1 x into x minus x 0 x minus x 1. So, this is for one polynomial. Now, what I am going to do is I am going to subdivide my interval into say n equal parts. So, I have interval a b I will subdivide into smaller interval. Now, in each interval I will choose interpolation points. So, suppose I am taking two interpolation points here two interpolation points here and so on. Now, suppose these are the function values then this is going to be linear polynomial interpolating the given function at these two points. If I look at the linear polynomial interpolating the given function at these two points it can be something like this it depends on the function value. So, I may not even have continuity. So, if I want continuity then let me do like this way that this is my interval a b. So, when I consider this point this interval take the interpolation points to be the end points. So, I will have some function now in this interval take these two as the interpolating points. So, this interpolation point is common. So, you are going to have a polynomial here then a polynomial here and so on. So, this will be piecewise linear. Now, these are the corner points where our function is not this one where our function will not be differentiable. If I consider a point here then no problem. So, overall we are going to have only continuity. So, this will be piecewise linear. So, we have say f is from a b to r then consider n to be a natural number h to b b minus a divided by n and T i to be equal to a plus i h i going from 0 1 up to n. So, T 0 is going to be equal to a and T n is going to be equal to a. So, we are going to have a function b equal to b and we try to look at a function g n which is defined on interval a b taking real values such that g n restricted to T i to T i plus 1 is a polynomial of degree less than or equal to 1. So, on each interval it should be a polynomial of degree less than or equal to 1 g n at T i should be equal to f at T i i going from 0 1 up to n. Now, the choice of these interpolation points they will guarantee that g n will be continuous. So, what we have is we have our function defined on interval a b we are looking at the n plus 1 points in the interval a b. So, you are going to have some data some points n plus 1 point if there are n plus 1 points I can fit a polynomial of degree less than or equal to n instead of that we go to piecewise linear and then we join by straight line. So, that is the piecewise linear interpolation. Now, what we want to do is we want to look at the error in the interpolating component polynomial. So, we have in case of linear polynomial interpolation the error is given by norm f double dash infinity divided by 2 into b minus a by 2 square. The way we had seen that the maximum of modulus of x minus a square x minus b square it it was attained at the midpoint a plus b by 2. Similarly, the modulus of this function its maximum will be attained again at the midpoint and then you have got norm of f minus p 1 infinity to be less than or equal to this. Now, when I consider the piecewise linear interpolation then you have g n on the interval t i to t i plus 1 it is polynomial of degree less than or equal to 1. So, using this bound you will get norm f double dash infinity by 2 b minus a is length of the interval now the length of the interval is h. So, it is h by 2 square. Now, what I am doing is here I could have dominated by maximum of the second derivative on t i to t i plus 1, but I dominated by maximum over the whole interval a b. So, that this bound becomes independent of the interval and we will get norm f minus g n infinity norm which is maximum over interval a b that will be less than or equal to norm f double dash infinity by 8 h square and h being b minus a divided by n that will tend to 0 as n tends to infinity. That is about the piecewise linear interpolation. In the next lecture we will discuss the polynomial. We will consider other piecewise polynomials such that piecewise quadratic interpolation, then piecewise cubic hermite interpolation and lastly we will consider cubic spline interpolation which consists of piecewise polynomials of degree less than or equal to 3. So, on each interval it will be a polynomial of degree less than or equal to 3 and overall you will have c 2 continuity that means our piecewise cubic polynomial will be two times continuously differentiable. So, that we are going to do in the next lecture. So, thank you.