3.6.2

Instructor: Example four-- calculate the absolute and relative error in the estimate of the integral from 0 to 1 of x squared dx using the midpoint rule. 

Well first, from our question earlier, example one, we found an estimate. Our estimate B was 0.328125. However, we also found in that question that the exact value-- the exact value was 1/3. 

So the absolute error, based on this definition here, is the absolute value of A minus B. And it's literally just how far those two are apart. 

So if you say the absolute value of A minus B-- that's the absolute error-- that is going to be 1 over 192, which is 0.-- or approximately 0.0052. 

All right, well, the relative error-- that's the other thing we want to know-- is the error as a percentage of the absolute value-- of the absolute error, and it's given-- it's a percentage of the actual value, the actual value. All right, so it's given by this formula, the absolute value of A minus B over A. 

Well, if we were to do that calculation, which I have already done, that is 1 over 64, but then we want that as a percent so that this is equal to 1.5625%. 

And we'll do the same for the trapezoidal rule at the absolute and relative error in this estimate. Well, again, we've already calculated, found out that the exact value is 1/3, but our estimate-- our estimate from example three, 0.34375. 

So our absolute error, given by absolute value of A minus B is 1 over 96, which is approximately 0.0104. 

Now, let's just compare that point, 0.0104. It's a little bit further away. That is our relative-- our absolute error. 

Now, for our relative error, so once we say-- treat this as a percentage of the actual value, A minus B over A, that is equal to 3.125%.