Single Application Trapezoidal Rule Example
|
In this segment, we'll take an
example of the single application trapezoidal rule. So, this is the example
we're taking; we're asked to integrate a function which looks like this. We’re
asked to use the single application trapezoidal rule find the true error and
find the absolute relative true error. So, let's go and see how we can go
about doing that. So, we have this integral given
to us. We already know that the formula for the single application
trapezoidal rule is given as follows. The general case, so in this case we
have the values of a and b: 1.3 and 0.1. And we're going to calculate the
value of the function at 0.1 and calculate the value at 1.3, and we’ll take
the average value of those two. So, this gives us 1.2 and this one is 5, 0.1
times e to the power minus 2 times 0.1, plus 5, 1.3 e to the power minus 2
times 1.3, divided by 2. And this value here turns out to be as follows once
you do the calculations. So, this is what we get by using the single
application trapezoidal rule as the value of the integral. Now let's go, this
was part a, let’s go to part b where we have to find the true error as well
as the relative true error. To find the true error, we need
the true value and the approximate value which we just calculated in the
previous part. The true value is given to us as 0.89387, and if you are
interested in, you can find the true value by just doing integration by parts.
And approximately, we found out from the previous part was this and this
number here turns out to be 0.35858. Now if we want to find the absolute
relative true error, in that case, it will be the true error divided by the
true value absolute value of that, and we calculate in terms of percentage we
multiply by 100. So here we get this to be this quantity here, which we just
found out. The true value is this quantity, and we multiply 100 and we get a
relative true error of 40.115%, which is huge, but you gotta
understand this is only a single application trapezoidal rule. It’s a little
bit out of the ordinary because of the way the function behaves; because if
you look at the way the function behaves. It’s like this, this is your 0.1,
and that’s your 1.3. As we can see, there's a lot of true error here and
that's the approximate value, the shaded area here like with the crosses, and
this one is the true error. So, that's why I was saying that in this example
here, it's a little bit inflated. I shouldn’t say, call it, inflated but it
is and out of the ordinary example that we're getting this much true error. And
that's the end of this segment. |