Verilog Lecture
Verilog Lecture
Department of Mathematics
Lecture No. # 12
So, we are going to have, i going from 0 to n. So, in total we have got 2 n plus 2
constants to be determined. Now these we will try to determine, so that, there is no error
for polynomials of degree less than or equal to 2 n plus 1.
(Refer Slide Time: 01:47)
So, that is the idea of gauss integration. So, when we fix points x 0 x 1 x n in the interval
a b and look at p n x to be equal to summation f x i l i x i goes from 0 to n where l i is the
Lagrange polynomial. So, it is product j goes from 0 to n x minus x j divided by x i
minus x j, j not equal to i; this is Lagrange polynomial.
Now, what you have to note is that l i x the Lagrange polynomial, it depends only on the
interpolation points x 0 x 1 x n. So, there is no function f coming in to picture there; it is
a polynomial of degree n.
So, you can integrate. So, you integrate and then you are going to get the weights w i. So,
we have this to be equal to summation i goes from 0 to n f x i w i. So, these are real
numbers independent of our function f. Now this is going to be our starting point.
So, we want that there should not be any error, if our function f is a polynomial of degree
2 n plus 1. This can be achieved provided there is no error for functions 1 x, x square, up
to x raise to 2 n plus 1 because any polynomial of degree 2 n plus 1 is going to be
combination of this functions 1 x, x square, x raise to 2 n plus 1.
So, let us look at some special cases. So, suppose we are taking n is equal to 0; that
means, we have got x 0 is 1 point and w 0 is the weight.
We want integral a to b f x d x, is equal to w 0 f x 0 is f is a polynomial of degree 1
which we mean that once take function f x is equal to 1 then take f x is equal to x, you
will get 2 equations and from that we will try to determine w 0 and x 0.
So, this imposes the condition that w 0 should be equal to b minus a. So, which means
that if I choose w 0 to be equal to b minus a and x 0 to be any point in the interval a b,
then the formula w 0 f x 0 is going to be exact for constant polynomials.
So, now we want our formula to be exact for linear polynomials. So, we will impose one
more condition for f x is equal to x. So, w 0 we have already determined the condition f x
is equal to x that will determine our point x 0.
So, we have f x is equal to x; in this case also no error that will happen, provided integral
a to b x d x is equal to w 0 x 0, which will imply b square minus a square by 2 which is
the integral a to b x d x should be equal to w 0 is b minus a multiplied by x 0.
So, this means x 0 should be equal to midpoint a plus b by two. So thus, integral a to b f
x d x if you approximate it by b minus a into f of a plus b by 2 this is going to be exact
for linear polynomials.
And this is nothing, but the midpoint rule. So thus, we have solved a problem for case n
is equal to 0. Now let us look at the case n is equal to 1.
So, when you put n is equal to 1 you are trying to approximate integral a to b f x d x by a
formula of the type w 0 f x 0 plus w 1 f x 1, unknowns w 0 w 1 x 0 x 1 we will like to
determine in such a manner that now our rule is exact for polynomials of degree less than
or equal to 3.
This will be achieved provided there is no error for 4 functions which are 1 x, x square x
cube any cubic polynomial is going to be of the form a 0.
Plus a 1 x plus a 2 x square plus a 3 x cube. So, if there is no error for the 4 functions 1 x,
x square, x cube there will not be any error for a cubic polynomial a general cubic
polynomial.
So, let us equate and get the 4 equations. So, we have integral a to b f x d x is
approximately equal to w 0 f x 0 plus w 1 f x 1. First put f x is equal to 1 then we want b
minus a should be equal to w 0 plus w 1.
So, that is the first condition. Then f x is equal to x. So, that is going to be b square
minus a square by 2 it is the integral a to b x d x and on the right hand side it is going to
be w 0 x 0 plus w 1 x 1. Next look at the function f x is equal to x square, its integral is x
cube by 3. So, this is going to be b cube minus a cube by 3, on the right hand side it will
be w 0 x 0 square plus w 1 x 1 square and f x is equal to x cube that will be b raise to 4
minus a raise to 4 divided by 4 is equal to w 0 x 0 cube plus w 1 x 1 cube. So, let me call
these 4 equations 1 2 3 4.
How I should choose the weights w i’s and the interpolation points x i’s in such a manner
that I have no error for as high degree polynomial as possible.
So, that is why we will not do manipulation for this, but look at a general case. Now for
the general case, the method which we are going to use, I am going to explain again for
this particular case n is equal to 1 and then we will see how to generalize.
So, the first thing we are going to do is, we are going to obtain the conditions on x 0 x 1
which will guarantee that if you interpolate, if you choose x 0 x 1 in a certain manner, fit
a linear polynomial, integrate then the formula which you are going to get it will be exact
for cubic polynomial.
So, let us derive the condition which the interpolation points x 0 and x 1 should satisfy.
Once we find this condition there are going to be 2 conditions; then we will see, how to
choose x 0 and x 1.
So, that these conditions are satisfied. So, first we are finding the conditions which the
interpolation points x 0 and x 1 should satisfy and then find the points x 0 x 1 which
satisfy this condition.
So, let us look at 2 points x 0 and x 1, fit a linear polynomial no matter how you choose
your 2 points x 0 and x 1 if you fit a linear polynomial then the interpolating polynomial
is same as the function if the function is a linear polynomial. So, there will not be any
error in our integration formula for linear polynomials, but we want something more we
want that the error should not be there or error should be equal to 0 for cubic polynomial.
(Refer Slide Time: 16:10)
So, this is our polynomial p 1 x and this is our error and hence integral a to b f x d x will
be equal to integral a to b p 1 x d x plus integral a to b f of x 0 x 1 x x minus x 0 x minus
x 1 d x. So, this is going to be the error in the integration. Now we have used this
technique beforehand. If your points x minus x 0, if your points x 0 and x 1 are such that
integral a to b x minus x 0 x minus x 1 d x is equal to 0.
Then we will like to make use of this relation, in order to manage our error we had done
this for the midpoint rule; in the case of midpoint rule we had integral a to b x minus a
plus b by 2 b x is equal to 0. So, our error formula has got 2 parts; it has got a divided
difference and then you are multiplying by the function w i. So, this divided difference in
the error formula it depends on x. So, we cannot take it out of the integration sign.
But if I replace this divided difference which is based on x by a divided difference which
is independent of x and then plus extra term then I can take the divided difference out.
So, let us look at the error.
So, now look at the error; error has a divided difference based on 4 points that is f of y 0
x 0 x 1 x if your function f is a quadratic polynomial then this divided difference will be
0 and that means, error will be 0. So, if our points x 0 and x 1, if they are such that
integral a to b w x d x is equal to 0 then we get the formula to be exact for quadratic
polynomial. So, earlier we had only exactitude for linear polynomials, now we got for
quadratic polynomial with 1 condition integral a to b w x d x. Now we will use the same
technique again and then obtain another condition which will give us the error to be 0 for
cubic polynomials.
Now, if this is equal to 0 then this will be the expression for the error. If integral a to b w
x d x is 0 and integral a to b w x multiplied by x minus y 0 is equal to 0. If both the
conditions are satisfied our error is integral a to b divided difference based on 5 points
the points are the divided difference is based on y 1 y 0 x 0 x 1 and x. So, we have got 5
points.
If f is a polynomial of degree 3 then this divided difference will be equal to 0. So, our
error is integral a to b, a divided difference multiplied by w x into x minus y 0 x minus y
1 d x if the divided difference term is 0 error is going to be equal to 0.
So, thus we obtain 2 conditions, which guarantee that there is no error for cubic
polynomials and those 2 conditions are integral a to b w x d x is equal to 0 and integral a
to b w x into x minus y 0 d x is equal to 0.
So that means, this condition will reduce to integral a to b w x x d x is equal to 0. So, the
conditions which we get are integral a to b w x d x should be equal to 0 and integral a to
b w x multiplied by x d x is equal to 0.
So, we have to choose x 0 and x 1 such that these 2 conditions are satisfied and then for
the error our y 0 and y 1 they can be any points in the interval a b. So, we can choose our
y 0 to be equal to x 0 y 1 is equal to x 1 and we will get integral a to b f of x 0 repeated
twice x 1 repeated twice x x minus x 0 square x minus x 1 square d x.
Now, the reason for writing in this manner will be; now we have got a divided difference
which is going to be continuous provided your function f is sufficiently differentiable,
your multiplying by a function x minus x 0 square x minus x 1 square. So, this function
is always bigger than or equal to 0. So, we can apply mean value theorem for integrals
and then the divided difference we can take it out as divided difference based on x 0
repeated twice x 1 repeated twice and some point c, multiplied by integral a to b x minus
x 0 square x minus x 1 square d x.
We can integrate this and then obtain a more precise bound as compare to, if we had
dominated the x minus x 0 and x minus x 1 by b minus a. So, now, our problem is we
have reduced our problem to finding x 0 and x 1 such that x minus x 0 x minus x 1 its
integral is 0 and if you multiply x minus x 0 x minus x 1 by x.
Then that integral also should be 0 now as I said we want to have a general method; that
means, here we have taken only n is equal to 1. So, we have got 2 interpolation points x
0 and x 1, but whatever we want to do we want to do it that, you should be able to extend
it for the more general case like when you have got n plus 1 points then how I should
choose my n plus 1 points
So, that we have got exactitude for polynomials of degree less than or equal to 2 n plus 1.
So, in order to do that what we are going to do is we are going to recall what is the inner
product. So, on our space c and d it is the vector space of continuous real valued
functions defined on interval a b, on this we will define a inner product as integral a to b
f x into g x d x once we have inner product we can talk of 2 functions being
perpendicular.
So, if the inner product is equal to 0 we say that f is perpendicular to g look at our
condition which we want; it is integral a to b x minus x 0 x minus x 1 d x should be equal
to 0; that means, we want our function w x to be perpendicular to the constant function 1
and second condition tells us that our w x should be perpendicular to the function f 1 x is
equal to x.
So, we will start with 3 functions function constant 1 then x and then x square to this we
will apply gram-Schmidt orthonarmalisation process and get a quadratic polynomial
which is perpendicular to constant function 1 and function x; this quadratic polynomial,
look at the roots of this, if the roots are x 0 and x 1 those are going to be our desired
point and what we will do is inner product we will defined on c a b, but in order to find
the points x 0 and x 1.
We will first consider the interval minus 1 to 1 and then we will look at a map from
minus 1 to 1 to the interval a b which is 1 to 1 on to n a fine and using this map we will
transfer the results to interval a b. So, let us look at the inner product on c a b.
So, this is inner product; its properties are inner product of f with itself is going to be
bigger than or equal to 0 because we will be looking at integral a to b f square x d x f is a
real valued function then f comma f is equal to 0 if and only if the function f x is
identically 0
So, this is the first property. Second property is inner product of f with g it is same as
inner product of g with f and that is because our multiplication of real numbers is
commutative and third property which is known as linearity, f 1 plus f 2 its inner product
with g will be inner product of f 2 with g plus inner product of f 2 with g and alpha times
f comma g will be alpha times f comma g where alpha is a real number.
So, these are the properties of inner product. So, we have defined the inner product and
now we are going to look at the 3 functions
This is going to be bigger than or equal to 0. So, it is going to be greater than or equal to
0 we can take its positive square root and this is generally denoted by norm f 2.
So, this has properties that norm f 2 is bigger than or equal to 0 it is equal to 0 if and only
if f x is identically 0. Second, norm of alpha f will be equal to mode alpha times norm f
where alpha belongs to r and the third one is norm of f plus g is less than or equal to
norm f plus norm g, this is known as triangle inequality and triangle inequality is proved
using Cauchy Schwarz inequality, which is modulus of inner product of f with g that is
less than or equal to norm f into norm g.
So, we have, look at the 3 functions 1 x x square from this we want to construct 3 other
functions which I will denote by g 0 g 1 g 2 which will have property that if you look at
the norm of each function, it is going to be equal to 1 and if you consider any 2 distinct
functions like if you consider g 0 and g 1 its inner product will be 0, inner product of g 0
with g 2 will be 0 and inner product of g 1 with g 2 is equal to 0.
So this, the way we are going to do that is known as gram Schmidt orthonormalization
process, we will do it for the 3 functions, but then one can define it for n functions.
(Refer Slide Time: 37:59)
So, which will imply the f 0 x, which will imply that norm g 0 2 norm is going to be
equal to 1. Next look at r 1 x to be equal to f 1 x minus inner product of 1 with g 0
multiplied by g 0. So, this is my definition; if I look at inner product of r 1 with g 0, it is
going to be inner product of f 1 minus inner product of f 1 with g 0 g 0 and then g 0.
Now, we use linearity of inner product to write this as inner product of f 1 with g 0
minus this is going to be a scalar. So, it will come out of the inner product. So, it will be f
1 g 0 and what is left is inner product of g 0 with g 0; now our norm g 0 2 is positive
square root of inner product of g 0 with itself.
So, this is going to be equal to 1 and then this will get cancelled. So, you will get r 1 g 0
to be equal to 0, now when you look at r 1 we have got f 1 x is equal to x, this is going to
be some scalar g 0 x is going to be multiple of 1. So, this is going to be a linear
polynomial
F 2 x is our function x square. So, from this function we will sort of subtract the
component of our f 2 in the direction of g 0 and in the direction of g 1.
So, we will construct our r 2 in such a manner that r 2 is perpendicular to both g 0 and g
1 our r 2 is going to be a quadratic polynomial which will be perpendicular to g 0 and g 1
When you look at inner product of r 2 with g 0 that will be inner product of f 2 with g 0
minus inner product of f 2 with g 0 into inner product of g 0 with itself minus inner
product of f 2 with g 1 and then inner product of g 1 with g 0 using the linearity of inner
product.
This is 1, this is 0. So, this gets cancelled and then you get r 2 comma g 0 to be equal to
0; then you look at inner product of r 2 with g 1 that will be inner product of f 2 with g 1
minus inner product of f 2 with g 0 the coefficient and inner product of g 0 with g 1
minus inner product of f 2 with g 1 and inner product of g 1 with itself.
So, this is going to be equal to 1, this is equal to 0, these 2 will get cancelled and then
you get r 2 comma g 1 is equal to 0. Next define g 2 to be equal to r 2 upon norm r 2. So
this will imply that norm of g 2, 2 norm is going to be equal to 1.
So, this is the procedure for constructing g 0 g 1 g 2, 3 ortho normal functions which we
have obtained from the functions 1 x x square this was the general procedure.
Now, let us look at the interval to be minus 1 to 1 and find explicit expression for g 0 g 1
g 2. So, when you look at the interval minus 1 to 1 our
Now, what will be norm r 1? So, norm r 1 2 norm will be integral minus 1 to 1 x square d
x raise to half. So, this is going to be square root of 2 by 3 and that will give us g 1 x to
be root 3 by 2 x and now the third one
(Refer Slide Time: 46:25)
So, let us look at r 2 x. So, r 2 x is going to be equal to x square minus inner product of f
2 with g 0 into g 0 minus inner product of f 2 with g 1 g 1 where our f 2 x is x square, g 0
x is 1 by root 2 and g 1 x is equal to root 3 by 2 x. So, inner product of f 2 with g 0 this
will be integral minus 1 to 1 x square by root 2 d x.