We'll do an example of the two-point Gaussian quadrature rules. So the example problem statement
is estimate this particular integral by two-point Gaussian quadrature rule. So
let's look at the solution for this particular problem. We already know that if we have an
integral going from a to b f of x dx, a definite integral. That is approximated by our two-point
Gaussian quadrature rule by c1 times f of x1 plus c2 times f of x2 where these values
of c1, x1, c2, x2 are given in terms of a and B. So for c1 it is b minus a divided by
2, for c2 it is b minus a divided by 2, for x1 it is b minus a divided by 2 times minus
1 divided by square root of 3 plus b plus a divided by 2. And then x2 is b minus a divided
by 2 times 1 divided by square root of 3 plus b plus a over 2. So if that is the case then
all we have to do is to calculate these two weighting coefficients c1 or c2, and these
two arguments of the function x1 and x2 based on the values of a and b which are the lower
and upper limits of integration. So for our case f of x is 5x e to the power of minus
2x, because that is the integrand here; a is 0.1, that is the lower limit here; b is
1.3, which is the upper limit here. So based on that let's go ahead and calculate the value
of c1, c2, x1, x2 for the formula. c1 is b minus a divided by 2 which is 1.3 minus 0.12
over 2 which is 0.6; c2 is b minus a divided by 2, that's 1.3 minus 0.12 divided by 2,
which is also 0.6; x1 is b minus a divided by 2 times minus 1 divided by square root
of 3 plus b plus a divided by 2, so we substitute the values of a and b, 1.3 minus 0.1 divided
by 2, times minus 1 divided by square root of ,3 plus 1.3 plus 0.2. So once we have that,
that number turns out to be equal to 0.35359. So that's the value of x1. For the value of
x2, we'll do the same thing. x2 is b minus a divided by 2 times 1 divided by square root
of 3 plus b plus a divided by 2, the only difference being here is minus 1 divided by
square root of 3 for x1 and here it is plus 1 divided by square root 3 for x2 times 1
divided by square root of 3 plus 1.3 plus 0.1 divided by 2. And this number here turns
out to be 1.0464. So now we have the values of c1, c2 x1, x2, all that we have to do is
to put them back in the formula and we'll be able to get the estimate for the integral.
So let's go ahead and calculate the value of the function at x1. In this case our value
of x1 which we just calculated is 0.35359 and that gives us 5x, which is 0.35359 times
e to the power of minus 2 times x1, which is 0.35359 and this number here turns out
to be 0.87165 calculate the value of the function at x2, and the value of x2 we just calculate
is 1.0464. So that tells me five times 0.1464 times e to the power of minus two times 1.0464.
And that number here turns out to be equal to 0.64532. So now we have all the ingredients
for estimating the value of this integral by using the two-point Gaussian quadrature
rule. So we have integral of 0.1 to 1.3 f of x dx. f of x in our case is 5x e to power
of minus 2x. So that's the integrand which we used to calculate the value of the function
x1, x2; and that will be equal to c1 times f of x1 plus c2 times f of x2; c1 is 0.6,
this is the value of the function at 0.35359 plus 0.6. So that is the function at 1.0464.
We just calculated the value of the function at 0.35359 which is 0.87165 and this one here
is 0.64532 And this number here turns out to be - this should be approximately here
- and this number turns out equal to 0.91018 estimate for the integral by using the two-point
Gaussian quadrature rule. Let's go ahead and see how much relative true error this number
has with respect to the true value. So let's calculate the relative true error. So relative
true error is defined as true value minus approximate value divided by true value, and
wecalculate in terms of percentage, multiplying by one hundred. So the absolute relative true
error will be the true value which is given to us at 0.89387 , you can do that as homework
if you don't know how to do that, minus 0.91018. That's the value which we got by using the
two-point Gaussian quadrature rule, divided by the exact value 0.89387 , we want to calculate
as a percentage, we multiply by 100. I will get that to be 1.8247% that's the amount of
relative true error which we get by using the two-point Gaussian quadrature rule on
this integral right here. And that's the end of this segment