In this segment, we'll talk about how to derive the two-point Gauss quadrature rule
of integration. To be able to understand the two-point Gauss quadrature rule derivation,
what we should do is we should start with the trapezoidal rule and derive it by the method
of undetermined coefficients. So, we already know that this is the trapezoidal rule, and what we're
going to do is we are going to use the method of undetermined coefficients by saying that hey
I want my integral to be approximately calculated by taking the function value at A, multiplying it
by some coefficient C1, let’s suppose, finding the value of the function B and multiplying to
some coefficient C2, or a weight, as they may call it. So, C1 and C2 are the weights, and A and B are
the quadrature points. Now, the thing is that how do we derive the trapezoid rule by using method of
undetermined coefficients as follows is that I'm going to say that this formula is going to give
me the exact value if I integrate a function like this one: a straight line. So, I would like the
integral of this function to come to become out to be the same as I would get my exact integral
calculus knowledge as I would get by using this particular formula. So, what that means is that
if I was going to calculate this integral exactly from A to B what I would get is as follows: I
would get A naught X plus A1 X squared by 2 here. Lower limit A, upper limit B, and this will be
A naught times B minus A plus A1 times B squared minus A squared by two. That's what I would get so
that is the case from using the exact integration, what would I get if I use the formula, which I
have started with the assumption that hey C1 times the value the function at A, plus C2 times the
value of the function at B. So, I have C1 times the value of the function at A, plus C2 times
the value of the function at B. So, the function is A naught plus A1X. Remember that. The function
which we assumed for which you will get the same value from integral calculus as we'll get from the
from the formula is A naught plus A1X a straight line with A naught, A1 being arbitrary values. So,
I get A naught plus A1 times A because the value of X is A at the argument A. Same thing here:
we see two times the value of A naught plus A1 times B. Now, this is what I get from the formula:
what I had previously is what I get from, from the exact integration and I want to those to be the
same. So, from the previous formula I got A naught times B minus A plus A1 times B squared minus
A squared by 2, and that I want to be equal to this quantity here: C1 times A naught plus A1 A,
plus C2 times A naught plus A1 times B. However, I have now two unknowns, C1 and C2, but I only have
one equation. How do I go about trying to figure out hey how will I be able to get two questions in
two unknowns is as follows: I'm going to collect the terms of A naught. So, it will be C1 plus C2
will be this term and this term, I'll collect the terms of A1, which is here and here, will be C1 A
plus C2 B. And the only way this can be exactly equal to this for any value of A naught and A1,
is if the coefficients of A naught here is same as the coefficient of A naught here if the quotient
A1 is same to A1 here so what that means the C1 plus C2 is equal to B minus A, and C1 A plus C2 B
is equal to B squared minus A squared by 2. So, since that is the case if you solve these two
equations, and you can do it by simple algebra, you'll get C1 is equal to B minus A divided by 2,
and you’ll get C2 is equal to B minus A divided by 2. And hence, our approximate formula will be
integral of A to B f of X DX is approximately C1, which is B minus A divided by 2, times the value
of the function at A, plus C2, times the value the function at B. And that's same as the trapezoidal
rule. So, let's see how this is related to the derivation of the two-point Gaussian Quadrature
rule is as follows. This is what we started for the trapezoidal rule, that's how we developed the
trapezoidal rule by saying that hey this is my, this formula what values of C1 and C2 should I
choose so that I can get an approximate value for integral. So, we said hey let it at least give us
the exact value for a straight line, and we were able to find C1 and C2. But the two-point Gaussian
quadrature rule now is different is that it's now saying that hey we don't need to necessarily fix A
and B, we're going to choose them to be X1 and X2, with, of course, the restrictions that A has to be
between, X1 has to be between A and B, and, of course, X2 has to be between A and B. And if we,
under these restrictions, X1 X X1 X2 being between A and B, can we find out what the values C1 X1 C2
X2 can be so that we can approximate the value of the integral. Look at this: we have now been
up to able to obtain four choices 1 2 3 and 4 choices here we had only two choices C1 and C2
because we have fixed the quadrature points to be A and B how does it really matter, because,
now, what I can do is if I use this which is the starting point of the derivation of the two-point
Gaussian quadrature rule that's what it starts, it starts right here. What I can do now is that I can
say that is exact for a third-order polynomial. Why can I make that make that a statement? Is
because I have four choices and hence, I can choose third-order polynomial because when I
equate the coefficients of A naught A1 A2 and A3, I'll get four equations. And I have four
unknowns. I could only do A naught plus A1X in the trapezoidal rule because it only had two unknowns.
So, we follow the same procedure as we use for the method of undetermined coefficients for the
trapezoidal rule. We have this as our third-order polynomial. And this is the exact value of the
integral. And this is what we get once we put A and B in it. So, that is what we get from the
exact integral of the function of the third-order polynomial. Let's go and see what we get from
using the formula. In using the formula, which is what we started with, f of X is equal to this,
the third-order polynomial, that's what we chose. So, what is the value of C1 times f of X1 plus
C2 times at f of X2, would be C1, which is right here. Times the value of this particular function
at X1. And the only difference is that it, instead of X, we have X1. Plus C2 times the value of the
function at X2. So, that's what we get by using the formula itself. Now, just like in the method
of undetermined coefficients for trapezoidal rule what I did was I collected the terms of A naught,
A1, A2, and A3, I'll do the same here if you look at the terms of A, A naught here are C1,
C2, which is right here, the terms A1 are C1 times X1 C2 times X2, which is right here, and so on and
so forth. And why do why are we collecting these terms of the, of the A naught, A1, A2, and A3. So,
here what we have is this is what I got by using the exact integration of a third-order polynomial,
this is what I get by using the formula C1 times f of X1 plus C2 times f of X2 and I want both of
them to be the same. And since A naught, A1, A2, and A3 are arbitrary real numbers, we didn't put
any kind of restrictions on the values of the coefficients of the third-order polynomial, what
that simply implies is that, although you might see only one equation and four unknowns,
we actually have four equations and four unknowns. Why is that so? Because the coefficient of
A naught has to be the same, that gives you this. The coefficient of A1 has to be same,
that gives us this. The coefficient of A2 has to be the same as this, that gives you this equation,
and the coefficient of this equation this A3 here is A sub-three is supposed to be the same
coefficient of A sub-three here, and that gives you this equation. So, that's how you are able
to find out these four equations. Now, keep in mind that these four equations which you have,
you have four equations four unknowns, all of these four equations are nonlinear in nature,
except for this one, because here is one unknown multiplied by another,
and here's one unknown multiplied over the squared of another unknown, and so on and so forth. So,
all of these four equations which you have here are nonlinear in nature except for the first
one. So, you basically have a set of simultaneous nonlinear equations. So, there's a possibility of
no solution, possibility for a unique solution, possibility multiple finite number of solutions,
or possibility of infinite number of solutions. And, as you will see, that there are only two
solutions for this set of equations in the next slide. So, we have four simultaneous nonlinear
equations and the two acceptable solutions which we get are these. And this is the only
two acceptable solutions you might say hey we have multiple solutions but act, actually this
solution here is same as this solution here, because these X1 and X2 are interchangeable,
because C1 and C2 are interchangeable, because C1 is B minus A divided by 2, and C2 is B minus
A divided by 2. If you take these values of C1, C2, X1, and X2 right here you get exactly the
same formula as you would get from this solution. So, actually, we have only one solution once we
look at the integral formula. Yes, we have two solutions from the nonlinear equations, but so
far as the formula which we have for integration we have simply one solution where C1 is this,
C2 is this, X1 is this, and X2 is this. So, writing in the compact form this is what we
started with, we were able to find C1 equal to this, X1 equal to this, C2 equal to this,
and X2 equal to this. And if you are, now you should be able to find the approximate value
of integral by using this particular formula by the two-point Gaussian quadrature rule. What this
simply implies is that, if you take a third-order polynomial, any third-order polynomial or less,
and you integrate it by using exact integration, or if you start using this particular formula,
you will get exactly the same result. For any other function, which is not a third-order
polynomial or less, you will get an approximate value. So, keep in mind that, although we are
using the third-order polynomial to figure out what the values C1, X1, C2, and X2 are,
those are just used to derive the method. You can use it for any function you want to. Yes,
surely the answer which you'll get will be approximate. And that's the end of this segment.