One Point Gauss Quadrature Rule Derivation and Example
|
In this
segment, we will talk about the one-point Gauss quadrature rule Gauss. Gauss
quadrature rule is a way to estimate integrals and we'll take; we'll do the
derivation and also take an example to do so. So, let's go and see how we
derive the um, the one-point Gaussian quadrature. The
one-point Gaussian quadrature rule is basically derived from that hey, we
have an integral going from a to b f of x dx, and it's going to be
approximately equal to c1 times f of x1. And surely, x1 will be some number
between a and b, because we're integrating a and b, and so the unknowns are
c1 and x1. So, if we're able to find c1 and x1, we will be able to figure out
what the approximate value of the integral is. So, how do we find c1 and x1
is that we say that hey, let for this function, that we get the same value as
the estimate as the integral, exact integral, as we get from the formula. So,
what does that mean? That means that if I integrate this function exactly, so
if I use my integral calculus knowledge, this is what I will get. Right, so
this is what I get from the exact calculus, but let's see what do I get from the formula. The formula is saying hey, the
formula will be c1 times f of x1, so it'll be c1 times a naught plus a1 x1. So,
the bottom line is that hey, this is what I’m getting from the exact calculus
for a function like a straight line, or a first order polynomial. This is
what I get from the formula, so I would want this quantity to be exactly same
as this quantity. So, let's go and see then what happens by equating the two. We get, you
know a naught times b minus a, plus a1 times b squared minus a squared by 2 equal to c1 times a naught plus a1 x1. So, one may say
that hey, I got two unknowns. I’ve got c1 and x1 as the two unknowns, but I
only have one equation. So, how I’m going to find those? So, what I can do is
maybe a little bit of manipulation will help, and you'll see why I’m doing
this manipulation. So, I’m going to get the coefficients of a naught from
here, the coefficient of a1 from here, and now what I see here is that since
a naught and a1 are arbitrary. When I chose that function to be a naught plus
a1 x, I didn't put any constraints on a naught and a1. So, since I did not
put any of those constraints on a naught and a1, what that implies is that
this whole expression is gonna be same as this
expression, only if the coefficients of a naught and a1 will be the same. So,
that means that b minus a will have to be equal to c1 and b squared minus a
square by 2 will have to be equal to c1 times x1. So, let's write that down. I’ve
got c1 is equal to b minus a, and I’ll get c1 x1 is equal to b squared minus
a squared by 2. So, this is giving me equation 1 and equation 2. Yeah, of course
this is uh, this may seem to be not, these are nonlinear equations, at least
the second one is a nonlinear equation, but it is very simple to solve
because I already have the value of c1, so I will just put it here. I get b
minus a x1 is equal to b squared minus a squared over 2. How do I find x1? I
will do b minus a x1 is equal to b minus a times b plus a divided by 2. I’ll apply the formula for b squared minus a
squared, factor it out, and this b minus a is cancelled, so x1 is equal to b
plus a divided by 2. So, I obtained hey, where should the function be
calculated, and what way should it be given so that I can approximate value
of the integral by the one-point Gaussian quadrature rule. So, the one-point
Gaussian quadrature rule, which I have is c1 would be equal to b minus a, and
x1 will be b plus a divided by 2. So, what that means that I’m going to get
the integral going from a to b, f of x dx will be approximately c 1 times f
of x1, and that's equal to b minus a times the value of the function at b
plus a divided by 2. And this is the one-point Gaussian quadrature rule. And
since we derived it from saying that hey, the straight line is going to give
us the same answer as the formula, that means that it will be exact for a
first order polynomial. Now, what we're going to do is we're going to take an
example and see how we can apply this formula to calculate, to estimate the
value of an integral. So, the
example we're going to solve is that hey, we are given this particular
integral. Use the one-point Gaussian quadrature rule to estimate the value of
the integral. We're also going to calculate the true error and the absolute
relative true error to see that how well it is working. So, let's go and get
started on that. So, we have
the formula saying that a to b f of x dx integral is approximately c1 times,
let's say, let's write down b minus a which is c1 times the value of the
function at the midpoint. So, since our integral is going from 0.1 to 1.3, then
that will be as follows. Just substituting the value of a and b, so I get 1.2
times the value of the function at 0.6. And since we know that the function
is 5x, here is 0.6, e to the power minus 2 times x, which is 0.6 here. And
this value here turns out to be equal to 1.0357, so that's part a. Let's go
and find out what the true error is and what the relative true error is. So, the
true error will be true value minus the approximate value, and you find the
true value is 0.89286, and you find the true value just by using integration
by parts. So, that should be straightforward. And so, the approximate value was
that, so the true error is now this quantity right here. Now what is the
relative true error? The relative true error will be in the true error
divided by the true value, and let's suppose if we calculate absolute
relative true error, then it is going to be the absolute value of this, if
you're going to calculate as a percentage, then you will multiply by 100. So,
in this case, it is this as the true error, and this has the true value we
multiply by 100 and we get 15.86%. So, that's the amount of true error we're
getting, relative true error we’re getting here. So, one of the things which
you got to recognize, it's not part of the example, but one of the things
which you can recognize is the true error is much less than what we got
before. When we had the trapezoid. So, in the
trapezoidal rule, what we had, if you look at the single application
trapezoidal rule, we have the formula as this. And then if we look at the
formula for the one-point Gaussian quadrature rule is this. So, you can very
well see that both of these formulas, this one is exact for a first order
polynomial, this one is also exact for a first order polynomial. And so, we
will get different answers for the same function integral, whether we're
using this formula or this formula, but for the first order polynomial we'll
get exactly the same value, and it will be the exact value itself. However,
what is the difference? The difference is that here you have to calculate the
value of the function at two points, here you have to calculate the function
value only at one-point, and that is where the Gauss quadrature rule becomes
a favored integration rule over trapezoidal rule. And that's the end of this
segment. |