in this segment we are going to derive the two-point Gauss quadrature rule for
integration so we going to drive a formula which is going to integrate our
function going from A to B and if we look at the method of undetermined
coefficients we approximate it as c1 times F sub a plus c2 times F sub B for
deriving the trapezoidal rule and when we did that what allowed us to do was to
get the exact value of the integral by using this particular formula as
obtained by integral calculus for a straight line and the reason why we're
only able to choose a straight line is because we have only two values which
are not known C 1 C 2 those are something which are of our choice now
what two-point Gaussian quadrature rule does is that we don't fix these two
numbers we don't fix a and B we say hey let's go ahead and make these also to be
something which I can choose because when I make the choice of this being a
and this being B then I have only two choices but if I make this to be a
choice which I can choose and this to be a choice chiken choose then I'll have
four choices in that case what I can do is I can start the third order
polynomial for which I want the formula to give me the exact value hence that's
why the two-point Gaussian quadrature rule will turn out to be more accurate
than your trapezoidal rule and will give you exact results for up to third order
polynomial as opposed to trapezoidal rule being only for first-order
polynomial so what I'm going to do is I'm going to the two-point Gaussian
quadrature rule they look like this C 1 times f of x1 plus c2 times F of x2 now
so we have four choices c1 x1 c2 x2 the only limitations I'm going to use is
that x1 is somewhere between a and B and X 2 is somewhere between a and B because
you cannot possibly find the value of an integral by choosing points which are
outside of the lower and upper limit range so let's go ahead and see what we
can how we can go about doing that is that I'm going to assume that for a
function which is the third order polynomial like a 0 plus a 1 X plus a 2
X square plus a 3 X cubed that whatever I get by integral calculus will be same
as what I get from the formula which I wrote
so from integral calculus a 2 B f of X DX is a to be a 0 plus a 1 X plus a 2 X
square plus a 3 X cubed DX and that turns out to be a 0 times a B minus a
plus a 1 times B square minus a square by 2 plus a 2 times D cube minus a cubed
divided by 3 plus a 3 times B to power 4 minus 8 power 4 divided by 4 so that's
what I get for the exact value of a third or third order polynomial now what
do I get from substituting from the formula so I want to get exactly the
same result from the formula itself C 1 times f of x1 plus c2 times f of X 2 so
I'll get c1 times a0 plus a1x 1 because that's the value of the function value
of x is x1 plus a2 times x1 squared plus a3 times x1 cubed then from f of x2 I'll
get a 0 plus a 1 times x2 plus a 2 times x2 square plus a 2 times x2 cube and
what I'm going to do is I would separate out the a0 terms I'll get c1 plus c2
like this c1 plus c2 in a1 I'll get c1 x1 plus c2 x2
in a - I'll get c1 x1 squared plus c2 x2 squared and then a3 I'll get c1 x1 cubed
plus c2 x2 cube and all these terms are coming from separating out the einat
terms c1 plus c2 which is here then c1 times x1 c2 times x2 which is right
there and so on and so forth the reason why I'm doing that is because I want to
equate the coefficients of a naught a 1 a 2 and a 3 because I want this formula
to give me exactly the same results as I'm getting from the integral calculus
for any values of a naught a 1 a 2 and a 3 because all these coefficients a
naught a 1 a 2 a 3 are arbitrary if I am choosing any arbitrary third order
polynomial I have no no control on what a person can choose for a naught a 1 a 2
and a 3 so that what that means is that the coefficients of a naught a 1 a 2 and
a 3 in both of these formulas this is the exact exact value of the integral
this is the approximate value of the integral which I'm getting and I want
both of it be same that means that these coefficients should be same so for
example c1 plus c2 here should be same as B minus a and so on and so forth so
let me write down those I'll get the 4 of those I will get c1 I have an
expression for this this this and this so what I'm going to get is as follows
I'm gonna get c1 plus c2 is equal to B minus a then I am going to get c1 times
x1 plus c2 times x2 is equal to B squared minus a squared by 2 then I'm
going to get c1 times x1 square plus c2 times x2 square is equal to B cube minus
a cube divided by 3 then I'm going to add c1 times x1 cube plus c2 times x2
cube is equal to B power 4 minus a to the power 4 divided by 4 so I'm going to
get 4 equations because I'm creating the four coefficients so this is 1 this is 2
this is 3 and this is 4 however what you can see is that these equations are not
simultaneous linear equations but actually they are simultaneous
nonlinear equations so you have to basically choose whatever solution
you're going to get because you can get multiple solutions for solving these
four equations or four unknowns so you have to choose the one which is
acceptable so I'm not going to show you the solution for it but the solution
which turns out to acceptable is C 1 is equal to b minus a divided by 2 C 2 is b
minus a divided by 2 X 1 turns out to be b minus a divided by 2 times minus 1
divided by square root of 3 plus B plus a divided by 2 and X 2 turns out to be B
minus a divided by 2 times plus 1 divided by square root of 3 plus B plus a
divided by 2 so that's what turns out with the value of c1 c2 x1 and x2 as you
can see that these are all in terms of a and B they are a little bit more
complicated than what you get in your trapezoidal rule but that's what you're
going to get so basically what you're saying is that the two segments the
two-point Gaussian quadrature rule gas quadrature rule is giving you the
formula of c1 times F of x1 plus c2 times F of x2 where c1 c2 x1 x2 are
defined by these numbers here and that is going to give you the approximate
value of any integral which you can integrate going from A to B for third
order polynomial s for third order polynomial second-order polynomial first
order polynomial a constant line the formula which you have derived right
here the formula which we have derived here is going to give you exact value
those integrals for any other integral the value which you're going to get will
be approximate so that's the end of the segment