CHAPTER 07.03: SIMPSON'S 1/3RD RULE: Multiple Segment: Example: Part 2 of 2

 

So here we get 3.6 divided by 18, and now all we have to do is to substitute the values of the function at those particular points, and what I'm going to do is I'm going to spell it out so that you have a better reference.  So you get 0.2 times e to the power -0.2, because that's the value of the function at 0.2, plus 4 times the value of the function at 0.8, which is 0.8 e to the power -0.8, plus the value of the function at 2, which is 2 e to the power -2, plus the value of the function at 3.2, which is 3.2 e to the power -3.2, plus 2 times the value of the function at 1.4, which is 1.4 e to the power -1.4, plus the value of the function at 2.6, which is 2.6 e to the power -2.6, plus the value of the function at 3.8, which is 3.8 e to the power -3.8.  So that's what we are getting as the . . . as the values there.  And now what we're going to do is we have calculated these values for you, and this is what we're going to get, we're going to get . . . we're going to get 0.6 here.  Is it 0.6?Iit's 3.8 . . . so this is not 0.6, what is it?  3.6 divided by 18 is 0.2, and then multiplied by, we're going to get 0.1637, that's the first value, plus 4 times the following values, 0.3594, the value at 0.8, the value at 2 is 0.2706, and the value at 3.2 is 0.1304. and then plus 2 times the value at 1.4, which is 0.3452, I'm only using four significant digits just to keep things simple, you can use more, if you are using this in a computer program, you'll be using as many as the computer takes, and plus 0.08501, so that is the value at 3.8.  And if you calculate this value here, this turns out to be 0.8733. So this is what we get by using the six segment trapezoidal rule . . . sorry, Simpson's 1/3 rule, which basically implies that you are applying the Simpson's 1/3 rule three times, because you have to apply . . . make each application of Simpson's 1/3 rule over two segments.  Let's go ahead and see what the true error is.  We know that the true value for this particular integral is 0.8751, that is the true value. So the true error in this case is the true value, which is 0.8751, obtained by using integral calculus, minus 0.8733, which we just obtained by using six segment Simpson's 1/3 rule, and this gives us 0.0018, and if I want to calculate the relative true error in this case, I'll get true error, which is 0.0018, divided by the true value, or the exact value, which is 0.8751, times multiply by 100, and this value here turns out to be 0.2057 percent.  So what you are finding out is that once you have started using a six segment rule, you're getting 0.2057 percent, relative true error.  If you want to see that, when we used n equal to 2, the relative true error which we got was 8.73 percent, and when we are using n equal to 6 for this example, now we're getting a relative true error of 0.2057 percent. So you can very well see that by increasing the number of segments, our relative true error is decreasing quite a bit.  Now, what we want to be able to do is that, since, when we are numerically solving such integrals, we won't be privy to what the true value is, just like with the true value here given is 0.8751, we won't have this knowledge, because if we would have this knowledge, we wouldn't be calculating it approximately in the first place, so what we want to be able to do is we want to be able to see that whether we can, by increasing the number of segments, when we are going from two, to four, to six, to eight, let's suppose, can we use that knowledge to be able to figure out how accurate our answer is? So in that case, what I have done is that I have used Simpson's 1/3 rule, multiple segment, and I made a table of what do I get as the value of the integral.  So I have the same integral, 0.2 to 3.8, x e to the power -x dx, and I said, hey, let me see what do I get as the value of this integral, approximate value of this integral for different number of segments. So what is the value?  And then what I do is I calculate the approximate . . . relative approximate error, that's what I do, I calculate the relative approximate error, so nowhere am I using the true value to calculate relative approximate error. So when I had two segments, I got 0.7987, and I cannot calculate the relative approximate error, because there's nothing to compare it with.  When I did four, I got 0.8673, and in this case, the relative approximate error is 7.910 percent.Then when I took six, I got 0.8733, which I just did, and I get a relative approximate error of 0.6870 percent, And then when I took eight segments, I got 0.8747 as the value, and 0.1601 percent as the relative approximate error.  And now what I can do is I can see that, hey, this absolute relative approximate error has turned out to be 0.1601 percent, so it is less then equal to 5 percent.  What that means is that I have one significant digit at least correct, but is it less than 0.5 percent?  Yes it is, so that means that at least two significant digits are correct in my solution, but it's not less than 0.05 percent, so that's where I'll have to stop, so that means that I can trust this 8, and I can trust this 7 in my calculation for eight segments.  So when I am calculating this particular integral by using eight segments, I can say with confidence that the 8 and the 7 in this answer of 0.8747 is correct in my approximation for the integral which is given to me. Now, if you are a little bit rusty about how I found out this number, for example, this relative . . . absolute relative approximate error, I'm going to show it to you here, it is that it is simply the relative approximate error is simply defined as present approximation, minus previous approximation, divided by the present approximation, times 100 if you want to calculate it in percentage.  So if you look at this number here, 7.910, this is my present approximation, and this is my previous approximation.  So the present approximation is 0.8673, minus 0.7987, divided by the present approximation, which is 0.8673, times 100, and this turns out to be7.910 percent. So that's where I am getting those numbers for the absolute relative approximate error. As you can see that nowhere am I using the true value to calculate these numbers, and also come up with a conclusion that how many significant digits are correct in my solution. And that is the end of this segment.