 So, we are considering Gaussian integration. Last time, what we have done is we looked at three functions f x is equal to 1, then f x is equal to x and f x is equal to x square for x belonging to interval minus 1 to 1. Then using Gram-Schmidt orthonormalization process, we constructed three orthonormal functions. The third orthonormal function, which is the quadratic function, it is perpendicular to any linear polynomial. This quadratic function, it has got two distinct roots. So, those are known as the Gauss points and then based on that, we fit a polynomial of degree less than or equal to 1 integrate. So, that is our Gaussian integration. So, today we are going to find a formula for these Gaussian integration based on these two points. So, we will be doing it first for the interval minus 1 to 1. We will also find the error in this interval minus 1 to 1. Then using the result on interval minus 1 to 1, we will look at interval a b, general interval a b. After that, we will consider composite Gauss two point rule and then we are going to prove the convergence of Gaussian quadrature. That means, first we are looking at Gaussian integration based on two points. So, we will define the general Gaussian quadrature based on say n plus 1 points and we are going to prove convergence of the numerical quadrature method. So, let us look at the what we did last time. So, our functions were f 0 x is equal to 1 constant function, f 1 x is equal to x and f 2 x is equal to x square on interval minus 1 to 1. From these three functions, we constructed g 0 x to be 1 by root 2, again a constant polynomial, g 1 x to be root 3 by 2 x, a linear polynomial and g 1 x to be root g 2 x to be x square minus 1 third multiplied by this constant. The constant is the normalization factor which makes norm of g 2 to be equal to 1. So, this function g 2, it is perpendicular to constant polynomial g 0, it is also perpendicular to linear polynomial g 1. Then look at x square minus 1 third. So, that is factorized as x plus 1 by root 3 x minus 1 by root 3, because g 2 is perpendicular to the constant polynomial, we get integral minus 1 to 1 x plus 1 by root 3 x minus 1 by root 3 d x is equal to 0 and because g 2 is perpendicular to g 1, we get integral minus 1 to 1 x plus 1 by root 3 x minus 1 by root 3 x d x is equal to 0. So, last time we had seen that when we want to find a numerical quadrature formula of the type w 0 f of x 0 plus w 1 f of x 1, if we want this to be exact for polynomials of degree less than or equal to 3, then our points x 0 and x 1 should be so chosen that integral a to b x minus x 0 x minus x 1 d x is 0 and integral a to b x minus x 0 x minus x 1 x d x is equal to 0. So, this fact now we have achieved on the interval minus 1 to 1. So, our x 0 is going to be minus 1 by root 3 x 1 is going to be plus 1 by root 3. We are going to fit a linear polynomial which is based on interpolation points x 0 and x 1 which is minus 1 by root 3 1 by root 3. We will integrate and we will get a approximate formula and then we will look at the error. Now, let us look at the polynomial f x 0 plus divided difference based on x 0 x 1 into x minus x 0. This is the interpolating polynomial and this is the error divided difference based on x 0 x 1 x x minus x 0 x minus x 1. Let us integrate between minus 1 to 1 f x d x. So, it is integration of f x 0 plus divided difference based on x 0 x 1 into x minus x 0 d x which will be the first term will be give us 2 f x 0. The divided difference f x 0 x 1 is f x 1 minus f x 0 divided by x 1 minus x 0 x minus x 0 square by 2. Evaluate it between minus 1 to 1. Then the integration when you put 1 and minus 1 that will give us the term 1 minus x 0 square by 2 minus minus 1 minus x 0 square by 2. Use the fact that x 1 minus x 0 is going to be 2 by root 3 and that is equal to minus 2 x 0. When you expand this you are going to get minus 2 x 0 then from here also minus 2 x 0 and then divided by 2. So, that is minus 2 x 0 that will get cancelled with x 1 minus x 0 and that gives us f x 0 plus f x 1. Next let us look at the error. So, error has f of x 0 x 1 x multiplied by our function w x d x integral minus 1 to 1. So, as we had done before we will use recurrence relation for the divided difference f x 0 x 1 x. You cannot take out f of x 0 x 1 x as such, but when using recurrence relation we write it as f of say y 0 x 0 x 1 plus some term. Then f of y 0 x 0 x 1 that being a constant it will come out of the integration psi and then we use the fact that our x 0 and x 1 these are some special points. So, using those properties we are going to get our error to be based on divided difference of f with x 0 repeated twice x 1 repeated twice and then some point c and then integral minus 1 to 1 x minus x 0 square x minus x 1 square d x. In order to have this term we will be using the mean value theorem for integral and that will give us a error bound. So, this is our expression for the error we have got integral minus 1 to 1 x minus x 0 x minus x 1 d x is 0 also integral minus 1 to 1 x minus x 0 x minus x 1 x d x is equal to 0. This since it depends on x I cannot take it out of integration, but using the recurrence relation for divided difference we write it as f x 0 x 1 x is equal to f x 0 x 0 x 1 plus divided difference based on x 0 x 0 x 1 x into x minus x 0. You can take this term on the other side and divide by x minus x 0. So, that is the divided difference formula for f of x 0 x 0 x 1 x. Now, again for this divided difference we use a similar formula. So, this is the divided difference we write as it is f of x 0 x 0 x 1 plus you have divided difference based on x 0 x 0 x 1 x 1. So, I am introducing point x 1 multiplied by x minus x 0 plus the term divided difference based on x 0 repeated twice x 1 repeated twice and x multiplied by now we have introduced x 1. So, that is why you have x minus x 0 into x minus x 1. So, this we have obtained using the recurrence formula for divided difference. This expression we will substitute in our error. So, when I substitute this term there is no dependence on x. So, it will come out of the integration sign integral minus 1 to 1 x minus x 0 x minus x 1 d x is 0. So, no contribution from here again this divided difference is independent of x. So, it will come out of the integration sign and you will have x minus x 0 x minus x 0 x minus x 1 d x. Then using these two relations the contribution from this term also will be 0 and you are left with integral minus 1 to 1 the divided difference based on x 0 repeated twice x 1 repeated twice x you will have got x minus x 0 x minus x 1 and here you had x minus x 0 x minus x 1. So, you get x minus x 0 square x minus x 1 square d x. So, this is the error term. Now, in this error term our divided difference is going to be a continuous function provided our function is sufficiently differentiable. We have got our divided difference based on x 0 repeated twice x 1 repeated twice and x and x can take all the values. So, it can take value x 0 it can take value x 1. So, in order that such a divided difference should be defined we will need the function to be three times differentiable. Look at the term x minus x 0 square x minus x 1 square this term is going to be bigger than or equal to 0. So, we have got two functions one function is continuous other function is bigger than or equal to 0 and hence the mean value theorem for integrals it is going to be applicable. So, using the mean value theorem we take out the divided difference term out of the integration as divided difference based on x 0 repeated twice x 1 repeated twice and some point c and then what remains is integral a to b x minus x 0 square x minus x 1 square and then d a. Now, recall our x 0 is minus 1 by root 3 x 1 is plus 1 by root 3. So, when you consider x minus x 0 into x minus x 1 that is x square minus one third we have got x minus x 0 square x minus x 1 square. So, that is going to be x square minus one third whole square and that is something you can integrate between minus 1 to 1 which is what we will do in order to get a formula for the error. Also, the divided difference which is based on five points if our function f is four times differentiable then that divided difference we can write as equal to fourth derivative evaluated at some other point say d divided by four factorial. So, that gives us the error in this Gaussian rule based on two points minus 1 by root 3 2 plus 1 by root 3. So, the integration of minus 1 to 1 x square minus one third whole square d x you will have term x raise to 4. So, its integral will be x raise to 5 by 5 then you have minus 2 by 3 x square that in its integration will be minus 2 by 9 x cube plus 1 by 9 its integration is going to be x. The divided difference we are writing as at f 4 d upon four factorial where d is some point in the interval minus 1 to 1 then you simplify this put 1 and then we put minus by the value obtained by putting minus 1 here. So, that value you can check that it comes out to be 8 by 45 and that gives you the error to be f 4 d divided by 135 and thus the Gauss two point rule is going to be integral minus 1 to 1 f x d x is approximately equal to f of minus 1 by root 3 plus f of 1 by root 3 and the error is going to be f 4 d divided by 135. Now, look at the error term the error term contains the fourth derivative of the function. So, if the fourth derivative is identically 0 which is the case if our function is a cubic polynomial then the error is going to be 0. So, we have got only two function evaluations and then the formula is exact for cubic polynomials. When we had looked at the trapezoidal rule there also we had only two interpolation points the interpolation points where end points point a and point b and in that case the formula was exact for polynomials of degree less than or equal to 1. So, this is the advantage of Gaussian rules. Now, this formula is valid on the interval minus 1 to 1 we want to derive a formula on the interval a to b a general interval. So, what we are going to do is we are going to look at a 1 to 1 on to map from the interval minus 1 to 1 to interval a b and then we will be looking at integral a to b f x d x. So, if you have a map phi from the interval minus 1 to a b then we will do the change of variable formula and then obtain Gauss 2 point rule on a general interval a b and we will also look at the error term in this case our error term is f 4 d divided by 135. When we look at the interval a b then there will be b minus a coming into picture. So, you will have the power of b minus a raise to 5 and then some constant. So, let us now look at 1 to 1 on to a fine map from interval minus 1 to 1 to a general interval a b. This map is given by t plus 1 into b plus 1 minus t into a divided by 2. So, the domain of a is equal to a plus b by 2 plus t into b minus a by 2. So, first of all notice that when t is equal to minus 1 in that case this term will vanish and you will get phi of minus 1 to be equal to a. When you put t is equal to plus 1 no contribution from 1 minus 1 minus t into a. So, you are going to have b then the derivative of phi that is equal to b minus a by 2. So, phi dash of t is going to be strictly bigger than 0 that means phi is a strictly increasing function. So, we have a map from minus 1 taking going to a 1 going to b and it is strictly increasing. So, that is why the range of our phi is going to be closed interval a b which proves that such a map is on to phi dash t bigger than 0 that means it is strictly increasing and hence it is going to be 1 to 1 and it is called a fine because it is of this form. When if you had no constant only t times something that is known as a linear map and this will be a fine map. So, we have got phi double dash t to be equal to 0. So, thus we have 1 to 1 on to map from the interval minus 1 to 1 to interval a b. Now look at integral a to b f x d x, x is varying in the interval a to b. Any point in the interval a b is going to be phi of t for some t in the interval minus 1 to 1. So, we will put x is equal to phi t then d x by d t is going to be phi dash t. So, that phi dash t is b minus a by 2. So, our integration a to b f x d x we will replace it by integration over minus 1 to 1 of the composite map f composed with phi of t and then on minus 1 to 1 we have got our formula for Gauss 2 point integration. Look at integral a to b g x d x that will be equal to integral minus 1 to 1 g of phi t phi dash t d t and this is equal to phi dash t we have seen that it is b minus a by 2. So, it comes out of the integration sign and it is integral minus 1 to 1 f t d t where f is the composite map g composed with phi. Now, integral minus 1 to 1 f t d t is if you approximate it by f of minus 1 by root 3 plus f of 1 by root 3 then the error is given by f 4 d divided by 135 and hence integral a to b g x d x if you approximate it by b minus a by 2 coming from here f and then phi of 1 minus root 3 plus f of phi f composed with phi of 1 by root 3. So, it should be actually g it should be g of phi of minus 1 by root 3 plus g of phi of 1 by root 3 and then the error is going to be b minus a by 2 minus f 4 d divided by 135 look at our Gauss points in the interval minus 1 to 1 the Gauss points where minus 1 by root 3 and 1 by root 3. Then we look at our affine map phi and image of minus 1 by root 3 and 1 by root 3 by this affine map those are going to be Gauss points in the interval a b in the interval minus 1 to 1 the Gauss points minus 1 by root 3 and plus 1 by root 3 they are symmetric about the origin 0. So, 0 was the midpoint of the interval minus 1 to 1. Now, here in the interval a b the Gauss points they are going to be symmetric about the midpoint a plus b by 2 look at our error. Error has got 1 term b minus a by 2 and then fourth derivative of the function that function is f and our f was g composed with phi. So, our g is the function which we are trying to integrate over the interval a b. So, we will like to have the error formula in terms of the derivatives of g. So, this f 4 of d fourth derivative that is going to be g composed with phi its fourth derivative. So, we will use chain rule and then obtain a formula in terms of the derivative of g. So, when we do that in the process we will get powers of b minus a. So, let us do that now. So, this is the error f 4 d upon 135 b minus a by 2 our function f of t is g composed with phi t. So, we use the chain rule. So, the chain rule is f dash of t is equal to g dash of phi t into phi dash t phi dash t is b minus a. So, we get g dash phi t. So, that is the first derivative. Now, look at the second derivative f double dash phi t f double dash at t that will be g double dash phi t and then phi dash t square because we have got here we are differentiating this. So, it will be g double dash phi t into phi dash t square and then we can have g dash phi t and then the derivative of phi dash, but phi double dash t is 0. So, that is why we have got only g double dash phi t and then phi dash t being b minus a it is b minus a by 2 square. When we look at the third derivative f triple dash t that is going to be equal to g triple dash phi t one more b minus a by 2. So, you will get b minus a by 2 cube and then fourth derivative will be fourth derivative of g at phi t b minus a by 2 raise to 4 and hence the error is fourth derivative of g evaluated at some point phi d in the interval a b divided by 135 and then b minus a by 2 raise to 5 and the Gauss two point rule for the interval a b is b minus a by 2 into f by 2. So, f x 0 plus f x 1 where x 0 is the Gauss point a plus b by 2 minus 1 by root 3 into b minus a by 2 and x 1 which is a plus b by 2 plus 1 by root 3 b minus a by 2. So, x 0 and x 1 they are symmetric about the midpoint. The error is fourth derivative evaluated at some point divided by 135 into b minus a by 2 raise to 5. So, we have got only two function evaluations the formula is of the type w 0 f x 0 plus w 1 f x 1 the weight w 0 is equal to w 1 is equal to b minus a by 2 and x 0 and x 1 these are the Gauss points. So, now we have found a basic Gauss two point rule and what we did for the trapezoidal rule Simpson's rule midpoint rule etcetera we considered composite rules. That means, we divided our interval a b into sub intervals of equal length on each interval we applied our basic rule and we added up the result to get integral a to b f x d a. So, now, same thing we are going to do for Gauss two point rule in case of composite rules which we have studied earlier we saw that if you have the b minus a raise to k in the error formula for the basic rule then when you add it up then from each sub interval the contribution is some constant times h raise to k where h is the length of the sub interval. We are adding n such terms and our h is b minus a by n. So, we associate with one h with such a sum of n quantities and then we will get a constant, but in the process we have lost one power of h that cannot be helped in the composite rule that is going to happen. So, here for our Gauss two point rule when we will apply to say interval t i to t i plus 1 of length h then we are going to have a term h by 2 raise to 5 in the basic rule we have b minus a by 2 raise to 5. So, now, it will be h by 2 raise to 5 and 1 h will get lost. So, our composite Gauss two point rule will have the order of convergence to be equal to h raise to 4. Now, this type of argument we have used before. So, I will be quickly going through the argument and showing that in the composite Gauss two point rule our order of convergence is going to be h raise to 4. So, the interval a b consider its uniform partition each sub interval t i to t i plus 1 will be of length h which is b minus a by n. In order to find the Gauss two points in the interval t i to t i plus 1 we have to look at a fine map from minus 1 to 1 that I denote by phi i and value of phi i at t will be given by the midpoint t i plus t i plus 1 by 2 plus t times earlier we had b minus a by 2. So, now, it is going to be t i plus 1 minus t i divided by 2. So, this is nothing but h by 2 then in each interval we are going to have two Gauss points the Gauss two points in the interval t i to t i plus 1 we denote by u 2 i plus 1 which is image of minus 1 by root 3 by this a fine map phi i and u 2 i plus 2 which is image of 1 by root 3 by the same map phi i. So, thus our two Gauss two points in the interval t i to t i plus 1 they are given by the midpoint of the interval minus t i plus 1 minus t i being h minus h by 2 root 3 and t i plus t i plus 1 by 2 plus h by 2 root 3 and i is going to vary from 0 1 up to n minus 1 this n should be n minus 1. So, you are going to have in all two n Gauss points next integral a to b f x d x we split it as integral t i to t i plus 1 f x d x i going from 0 to n minus 1 which is approximately equal to summation i goes from 0 to n minus 1 h by 2 that was our b minus a by 2 that was our b minus a by 2 value of f at u 2 i plus 1 plus value of f at u 2 i plus 2 these are the Gauss two points in the interval t i to t i plus 1 when we look at the error it will be summation i goes from 0 to n minus 1 f 4 d i by 1 35 h by 2 raise to 5 assuming the fourth derivative of f to be continuous we can replace summation i goes from 0 to n minus 1 f 4 d i divided by n by f 4 eta h is b minus a by n. So, that 1 v that n we associate to get f 4 eta. So, we have got b minus a it was h by 2. So, that is why this 135 becomes 270 and 1 h by 2 is gone. So, we have got h by 2 raise to 4. Now, compare this with the composite Simpson's rule in case of Simpson's rule we had got three interpolation points the interpolation points where two end points and the midpoint we fit a parabola. So, as such we expect that the error should be 0 for quadratic polynomial, but it is the property of even degree interpolation that if your interpolation points are chosen symmetrically in that case you get one extra degree of exactness. That means, we expect that there should not be any error for quadratic polynomial, but there is also no error for cubic polynomial. So, for Simpson's rule we achieve the exactitude for cubic polynomials with three points for Gaussian quadrature with two points we achieve that there is no error for cubic polynomials with two points. Now, in each interval we have got two Gauss points. So, total there are two end Gauss points for the Simpson's rule in each interval we have got three points but the two end points are included in the Simpson's point. In case of Gaussian quadrature both the interpolation points those are the interior points in the interval ti to ti plus 1. So, in Simpson's rule because the end points are interpolation points they will be common to the adjoining interval and hence the total number of points which will come into picture for the composite Simpson's rule they are going to be 2 n plus 1 and for Gaussian point we have got 2 n. So, then there is an difference between 2 n and 2 n plus 1 because when you look at the value of n to be large then 2 n and 2 n plus 1 they are considered as the same. So, that means the Simpson's rule and the Gauss 2 point rule they are going to be on par when we compare the order of convergence and the number of function evaluations when we compare two rules that is generally our criteria. How many number of times I need to evaluate the function and then what is the order of convergence and then we saw that in the corrected trapezoidal rule we need also the derivative values. So, that becomes an additional say a criteria. So, whether you need to evaluate only functions or whether you need the derivative values how many function evaluations and the order of convergence. So, based on these criteria the Simpson's rule and Gauss 2 point rules they are going to be on par. Suppose our function if it is continuous as I had remarked in the last lecture that the differentiability properties of function they are assumed for obtaining orders of convergence, but if I am interested only in knowing whether there is a convergence or not. Then in that case we may not need the differentiability like in case of say either composite rectangle rule or composite midpoint rule we saw that our rule is nothing but a Riemann sum and hence we had continuity. Hence we had convergence for continuous function same was the case for trapezoidal rule it is the sum of two we can write trapezoidal rule as a two Riemann sums both of which converge to integral a to b f x dx and then we are dividing by 2. In Simpson's rule also similar thing can be done in all these cases so far what we were doing was we were fixing degree of polynomial and then applying it to small intervals. Now, for the Gaussian rule whether we can increase the degree of the polynomial that means we have found Gauss two points. So, whether there are Gauss three points Gauss four points and so on. So, you increase the degree of the polynomial. So, our method has been replace the function by interpolating polynomial we know how to integrate a polynomial get a numerical quadrature rule and we have no ruled or we do not have a set of interpolation point which guarantee convergence of interpolation polynomials for all continuous functions. Now, the Gauss two points rule like we are going to define what are the Gauss points like we have defined Gauss two points like that we are going to define Gauss k points. So, now we have got a set of rules like for any n we can specify n Gauss points you fit a polynomial. Now, this set of interpolating polynomials will not converge to the given function in the maximum norm for all continuous functions that is not possible. But what we are going to show is even though the interpolating polynomials may not converge our numerical quadrature is going to converge and so on. And in that what the important point is that the weights in the Gauss points they are going to be bigger than 0. So, that is what we are going to show we are going to show that the Gaussian integration it converges for all continuous function just the assumption is that the function f should be continuous. So, for that now we have to first define what are the Gauss points the Gauss two points they were obtained as roots of certain quadratic polynomial and that quadratic polynomial was perpendicular to one and constant polynomial and the polynomial x. So, instead of applying the Gram-Schmidt orthonormalization process to three functions 1 x x square we can apply it to n functions obtain orthonormal polynomial and then look at the roots of such appropriate orthonormal and then look at the roots of such appropriate polynomial those are going to be our Gauss points. So, those are the known as Legendre polynomials. So, recall that x is C a b vector space of continuous functions defined on interval a b taking real values we define inner product f comma g to be integral a to b f x g x d x norm f 2 is the induced norm from this inner product. So, norm f 2 is square root of f comma f positive square root look at the functions f 0 x is equal to 1 f 1 x is equal to x f k x is equal to x raise to k this is Gram-Schmidt orthonormalization process that define g 0 x to be equal to f 0 upon norm f 0 and for k is equal to 1 2 and so on r k is defined as f k minus summation j goes from 0 to k minus 1 inner product of f k with g j g j j going from 0 to k minus 1 and then g k will be equal defined as r k divided by norm of r k. So, it is the same process we had considered before where we had looked at 3 functions f 0 f 1 f 2. Now, we are looking at a infinite set and then we construct such polynomials and then we will see these are known as Legendre polynomials and the 0s of g k they are known as the Gauss points. So, we will show that these polynomials which we construct g k is going to be a polynomial of degree k. So, it is going to have k roots, but what is important is it is going to have k distinct roots those roots or those 0s those are known as the Gauss points and those are going to be our interpolation points for fitting a polynomial of degree less than or equal to k minus 1. Now, because of the orthogonality property our g k is going to be a polynomial of degree k and it is going to be perpendicular to functions 1 x x raise to k minus 1. So, that means our g k is going to be perpendicular to any polynomial of degree less than or equal to k minus 1. As I said g k is going to have k distinct roots. So, I can factorize it and I can write g k x as x minus x 0 into x minus x 1 into x minus x k minus 1 and then multiplied by some constant the leading term. So, the orthogonality property of g k 2 functions 1 x x raise to k minus 1 that means if I look at integral a to b x minus x 0 into x minus x k, if I multiply by constant function 1 and take the integral that will be 0, if I multiply by x and take the integral that is going to be 0 and so on. So, that is the property of interpolation points allows us to obtain exactitude for higher degree polynomial. So, that is what we are going to do next time and then. So, we will we are going to define these Gauss points or we have defined Gauss points we consider Gauss Gaussian integration then in the Gaussian integration we will show that the weights. So, the Gaussian integration formula is of the type summation w i f x i i goes from 0 to n then these weights we will show that they are bigger than 0 and using that we are going to prove the convergence of Gaussian root. So, we are going to do this and then we are going to consider some problems next time. So, thank you.