WEBVTT
00:00:01.000 --> 00:00:08.200
In this video, weβll learn how to approximate definite integrals using the trapezoidal rule and estimate the error when using it.
00:00:08.770 --> 00:00:20.430
Youβve probably already seen that the exact area between a curve and the π₯-axis can be found by performing a definite integral of the function that describes that curve between the two points youβre interested in.
00:00:20.960 --> 00:00:25.570
When approximating the integrals and therefore the area, we commonly use rectangles.
00:00:25.740 --> 00:00:28.410
These are known as midpoint sums and Riemann sums.
00:00:28.770 --> 00:00:38.390
In this video, weβre going to investigate how using trapezoids can actually often give a better approximation than rectangular sums that use the same number of subdivisions.
00:00:38.680 --> 00:00:43.230
And then derive a formula for what is commonly known as the trapezoidal rule.
00:00:44.110 --> 00:00:53.220
Letβs imagine weβre wanting to approximate the area between the curve given by the function π of π₯ equals eight minus two π₯ squared plus three π₯ and the π₯-axis.
00:00:53.500 --> 00:00:57.300
Bounded by the lines given by π₯ equals zero and π₯ equals two.
00:00:57.880 --> 00:01:00.110
At this point, we have a few different methods.
00:01:00.250 --> 00:01:04.490
We might use a midpoint sum, whereby we break the area up into rectangles.
00:01:04.490 --> 00:01:11.250
Letβs say two of these and to find the height of the rectangle as the value of the function at the midpoint of each interval.
00:01:11.660 --> 00:01:13.160
Well, that is one method.
00:01:13.160 --> 00:01:15.120
But letβs consider the shape of the curve.
00:01:15.350 --> 00:01:18.460
Wouldnβt it make sense to choose a different shape than a rectangle?
00:01:18.770 --> 00:01:21.170
Well, we can actually try trapezoids.
00:01:21.530 --> 00:01:24.490
Letβs assume we want to use four subintervals now.
00:01:24.850 --> 00:01:28.050
Our trapezoids would look a little something like this.
00:01:28.290 --> 00:01:32.890
Notice that this does indeed appear to give a better approximation than using rectangles.
00:01:33.170 --> 00:01:39.440
And we can use the formula for the area of the trapezoid to calculate the total area between the curve and the π₯-axis.
00:01:39.720 --> 00:01:43.570
This is a half times π plus π times β.
00:01:43.640 --> 00:01:47.060
Where π and π are the lengths of the parallel sides of the trapezoid.
00:01:47.290 --> 00:01:48.830
And β is the height between them.
00:01:49.030 --> 00:01:55.060
We can see by observation that the height of each of our trapezoids is equal to the width of the subinterval.
00:01:55.430 --> 00:01:58.000
Here, thatβs 0.5 units.
00:01:58.380 --> 00:02:02.970
We can use the equation of our curve to work out the lengths of each of the parallel sides.
00:02:03.160 --> 00:02:05.760
And it can be useful to include a table at this stage.
00:02:05.910 --> 00:02:11.420
Somewhat counterintuitively with four subintervals, weβll have five columns.
00:02:11.610 --> 00:02:13.270
And in fact, thatβs always the case.
00:02:13.270 --> 00:02:16.890
We will always have one more column than the number of subintervals.
00:02:17.150 --> 00:02:22.410
The length of the first parallel side in the first trapezoid is given by π of zero.
00:02:22.410 --> 00:02:26.780
Thatβs eight minus two times zero squared plus three times zero, which is eight.
00:02:27.250 --> 00:02:35.580
The second parallel side in this first trapezoid is eight minus two times 0.5 squared plus three times 0.5, which is nine.
00:02:36.220 --> 00:02:43.510
π of one is eight minus two times one squared plus three times one, which, despite a poorly drawn graph, is also nine.
00:02:43.980 --> 00:02:48.450
And in a similar way, we obtain π of 1.5 to be this height here.
00:02:48.480 --> 00:02:49.230
And thatβs eight.
00:02:49.500 --> 00:02:51.510
And π of two to be this height here.
00:02:51.570 --> 00:02:52.430
And thatβs six.
00:02:52.640 --> 00:02:55.390
Weβll now calculate the area of each of the trapezoids.
00:02:55.670 --> 00:03:04.430
The first trapezoid has an area of a half times eight plus nine times 0.5, which is 4.25 square units.
00:03:04.770 --> 00:03:11.660
The second has an area of a half times nine plus nine times 0.5, which is 4.5 square units.
00:03:12.100 --> 00:03:18.190
The third has an area of a half times nine plus eight times 0.5, which is once again 4.25.
00:03:18.610 --> 00:03:26.550
And our final trapezoid has an area of a half times eight plus six times 0.5, which is 3.5 square units.
00:03:26.680 --> 00:03:29.540
The sum of these is 16.5.
00:03:29.750 --> 00:03:34.320
And we know that we commonly use definite integration to evaluate the area under the curve.
00:03:34.470 --> 00:03:44.550
So we can say that an approximation to the definite integral evaluated between zero and two of eight minus two π₯ squared plus three π₯ is equal to 16.5.
00:03:45.070 --> 00:03:46.540
Well, this is all fine and well.
00:03:46.540 --> 00:03:50.960
But you might be thinking, surely there must be a quicker way of performing this calculation.
00:03:51.470 --> 00:03:53.220
And youβd be in luck; there is.
00:03:53.460 --> 00:03:58.040
Letβs take a generic function π of π₯ and split it into π subintervals.
00:03:58.400 --> 00:04:02.470
Weβll say that the height of each trapezium is Ξπ₯.
00:04:02.750 --> 00:04:11.420
We saw that the lengths of the parallel sides of the first trapezoid are found by substituting our first value of π₯ and our second value of π₯ into the function.
00:04:11.720 --> 00:04:17.610
So we can say that π one is equal to a half times π of π₯ nought plus π of π₯ one times Ξπ₯.
00:04:17.820 --> 00:04:24.530
Similarly, our second trapezoid will have an area of a half times π of π₯ one plus π of π₯ two times Ξπ₯.
00:04:24.890 --> 00:04:30.010
Our third will have an area of a half times π of π₯ two plus π of π₯ three times Ξπ₯.
00:04:30.260 --> 00:04:39.100
And only continue until the πth trapezoid, which will have an area of a half times π of π₯ π minus one plus π of π₯ π times Ξπ₯.
00:04:39.240 --> 00:04:47.120
The total area under the curve and therefore an estimate for the definite integral of π of π₯ between the first π₯-value and the last π₯-value is the sum of these.
00:04:47.370 --> 00:04:50.430
When finding their sum, we can factor a half and Ξπ₯.
00:04:50.560 --> 00:04:58.680
And we obtain the total area of the trapezoids to be Ξπ₯ over two times π of π₯ nought plus π of π₯ one plus another π of π₯ one.
00:04:59.000 --> 00:05:04.460
Plus all the way up to π of π₯ π minus one plus another π of π₯ π minus one plus π of π₯ π.
00:05:04.830 --> 00:05:11.120
Now we can simplify this a little further to obtain the general formula for the trapezoid rule using π subintervals.
00:05:11.270 --> 00:05:17.830
We combine all the π of π₯ ones, all the π of π₯ twos, all the way through to all the π of π₯ π minus ones.
00:05:18.080 --> 00:05:24.180
The rule is Ξπ₯ over two times π of π₯ nought plus π of π₯ π plus two times everything else.
00:05:24.210 --> 00:05:27.840
π of π₯ one plus π of π₯ two all the way through to π of π₯ π minus one.
00:05:28.280 --> 00:05:30.710
And Ξπ₯ can be obtained really easily.
00:05:30.710 --> 00:05:35.530
Itβs π minus π divided by π, where π and π are the beginning and end of our interval.
00:05:35.810 --> 00:05:41.810
And our values for π₯ subscript π are found by adding π lots of Ξπ₯ to the lower limit of our interval.
00:05:41.810 --> 00:05:43.650
Thatβs π plus πΞπ₯.
00:05:44.250 --> 00:05:46.830
Weβre now going to have a look at the application of this rule.
00:05:47.520 --> 00:05:56.300
Use the trapezoidal rule to estimate the definite integral between zero and two of π₯ cubed with respect to π₯ using four subintervals.
00:05:56.770 --> 00:06:13.140
Remember, the trapezoidal rule says that we can find an approximation to the definite integral between the limits of π and π of π of π₯ by using the calculation Ξπ₯ over two times π of π₯ nought plus π of π₯ π plus two lots of π of π₯ one plus π of π₯ two all the way through to π of π₯ π minus one.
00:06:13.410 --> 00:06:16.300
Where Ξπ₯ is equal to π minus π over π.
00:06:16.480 --> 00:06:20.670
And π₯ subscript π is equal to π plus π times Ξπ₯.
00:06:20.870 --> 00:06:24.440
Letβs break this down and just begin by working out the value of Ξπ₯.
00:06:24.620 --> 00:06:28.260
Contextually, Ξπ₯ is the width of each of our subintervals.
00:06:28.360 --> 00:06:30.540
In this case, weβre working with four subintervals.
00:06:30.540 --> 00:06:32.360
So we could say that π is equal to four.
00:06:32.800 --> 00:06:34.740
π is the lower limit of our integral.
00:06:34.770 --> 00:06:37.770
So π is equal to zero, where π is the upper limit.
00:06:37.800 --> 00:06:38.750
And thatβs equal to two.
00:06:39.190 --> 00:06:44.490
Ξπ₯ is therefore two minus zero over four, which is one-half or 0.5.
00:06:44.970 --> 00:06:49.550
The values for π of π₯ nought and π of π₯ one and so on require a little more work.
00:06:49.770 --> 00:06:52.680
But we can make this as simple as possible by adding a table.
00:06:52.830 --> 00:06:57.970
Itβs useful to remember that there will always be π plus one columns required in the table.
00:06:58.170 --> 00:07:00.890
So here, thatβs four plus one, which is five.
00:07:00.890 --> 00:07:02.600
We have five columns in our table.
00:07:02.850 --> 00:07:04.640
The π₯-values run from π to π.
00:07:04.640 --> 00:07:05.750
Thatβs zero to two.
00:07:05.970 --> 00:07:11.430
And the ones in between are found by repeatedly adding Ξπ₯, thatβs 0.5, to π, which is zero.
00:07:11.820 --> 00:07:14.810
Thatβs 0.5, one, and 1.5.
00:07:14.930 --> 00:07:18.590
And that gives us our four strips of width 0.5 units.
00:07:18.860 --> 00:07:22.250
Weβre then simply going to substitute each π₯-value into our function.
00:07:22.660 --> 00:07:24.020
We begin with π of zero.
00:07:24.020 --> 00:07:25.950
Thatβs zero cubed, which is zero.
00:07:26.520 --> 00:07:29.000
Next, we have π of 0.5.
00:07:29.000 --> 00:07:32.690
Thatβs 0.5 cubed, which is 0.125.
00:07:32.980 --> 00:07:35.680
π of one is one cubed, which is still one.
00:07:36.020 --> 00:07:38.930
And we obtain the final two values in a similar manner.
00:07:38.960 --> 00:07:41.680
π of 1.5 is 3.375.
00:07:41.860 --> 00:07:43.320
And π of two is eight.
00:07:43.730 --> 00:07:45.120
And thatβs the tricky bit done with.
00:07:45.250 --> 00:07:49.360
All thatβs left is to substitute what we know into our formula for the trapezoidal rule.
00:07:49.690 --> 00:07:57.520
Itβs Ξπ₯ over two, which is 0.5 over two, times the first π of π₯ value plus the last π of π₯ value.
00:07:57.520 --> 00:08:00.400
Thatβs zero plus eight plus two lots of everything else.
00:08:00.400 --> 00:08:05.010
Thatβs two times 0.125 plus one plus 3.375.
00:08:05.350 --> 00:08:08.030
And that gives us a value of 17 over four.
00:08:08.430 --> 00:08:17.630
So using four subintervals, the trapezoidal rule gives us the estimate to the definite integral of π₯ cubed between zero and two to be 17 over four.
00:08:18.100 --> 00:08:20.740
Now where possible, this can be checked in a number of ways.
00:08:20.740 --> 00:08:25.370
You could evaluate a Riemann or midpoint sum or here simply perform the integration.
00:08:25.780 --> 00:08:30.260
When we integrate π₯ cubed, we get π₯ to the fourth power divided by four.
00:08:30.510 --> 00:08:39.290
Evaluating this between the limits of zero and two gives us two to the fourth power divided by four minus zero to the fourth power divided by four, which is 16 over four.
00:08:39.290 --> 00:08:44.540
And thatβs really close to the answer we got, suggesting weβve probably performed our calculations correctly.
00:08:46.850 --> 00:08:50.410
Weβll now consider an example which involves a consideration on accuracy.
00:08:51.180 --> 00:09:00.520
Estimate the definite integral between the limits of one and two of π to the power of π₯ over π₯ dπ₯, using the trapezoidal rule with four subintervals.
00:09:01.000 --> 00:09:03.760
Approximate your answer to two decimal places.
00:09:04.040 --> 00:09:21.220
Remember, the trapezoidal rule says that we can find an estimate for the definite integral of some function π of π₯ between the limits of π and π by performing the calculation Ξπ₯ over two times π of π₯ nought plus π of π₯ π plus two times π of π₯ one plus π of π₯ two all the way through to π of π₯ π minus one.
00:09:21.380 --> 00:09:25.740
Where Ξπ₯ is π minus π over π, where π is the number of subintervals.
00:09:25.880 --> 00:09:28.870
And π₯ π is π plus π lots of Ξπ₯.
00:09:29.050 --> 00:09:32.060
Weβll begin then just simply by working out Ξπ₯.
00:09:32.370 --> 00:09:35.420
Contextually, Ξπ₯ is the width of each of our subinterval.
00:09:35.570 --> 00:09:37.750
Here weβre working with four subintervals.
00:09:37.750 --> 00:09:39.050
So π is equal to four.
00:09:39.470 --> 00:09:40.890
π is equal to one.
00:09:41.010 --> 00:09:42.590
And π is equal to two.
00:09:43.080 --> 00:09:48.790
Ξπ₯ is therefore two minus one over four, which is a quarter or 0.25.
00:09:49.280 --> 00:09:52.460
Thatβs the perpendicular height of each trapezoid.
00:09:52.760 --> 00:09:57.170
The values for π of π₯ nought and π of π₯ one and so on require a little more work.
00:09:57.170 --> 00:10:00.360
But we can make this as simple as possible by including a table.
00:10:00.580 --> 00:10:06.360
We recall that there will always be one more π of π₯ value than the number of subintervals.
00:10:06.520 --> 00:10:11.190
So here, thatβs going to be four plus one, which is five π of π₯ values.
00:10:11.390 --> 00:10:14.040
The π₯-values themselves run from π to π.
00:10:14.040 --> 00:10:15.550
Thatβs here from one to two.
00:10:16.100 --> 00:10:22.450
And the ones in between are found by repeatedly adding Ξπ₯, thatβs 0.25, to π, which is one.
00:10:22.810 --> 00:10:27.070
So these values are 1.25, 1.5, and 1.75.
00:10:27.240 --> 00:10:31.150
And that gives us our four strips of width 0.25 units.
00:10:31.290 --> 00:10:34.560
Weβre then going to substitute each π₯-value into our function.
00:10:34.940 --> 00:10:37.760
Here, weβre going to need to make a decision on accuracy.
00:10:38.040 --> 00:10:43.090
Whilst the question tells us to use an accuracy of two decimal places, thatβs only for our answer.
00:10:43.400 --> 00:10:46.550
A good rule of thumb is to use at least five decimal places.
00:10:46.740 --> 00:10:48.220
We begin with π of one.
00:10:48.250 --> 00:10:54.740
Thatβs π to the power of one over one, which is 2.71828, correct to five decimal places.
00:10:55.160 --> 00:11:00.960
We have π of 1.25, which is π to the power of 1.25 divided by 1.25.
00:11:01.290 --> 00:11:05.310
Thatβs, correct to five decimal places, 2.79227.
00:11:05.600 --> 00:11:07.870
We repeat this process for 1.5.
00:11:08.090 --> 00:11:11.120
π of 1.5 is 2.98779.
00:11:11.470 --> 00:11:14.950
π of 1.75 is 3.28834.
00:11:15.400 --> 00:11:20.860
And π of two is 3.69453 rounded to five decimal places.
00:11:21.210 --> 00:11:25.180
All thatβs left is to substitute what we know into our formula for the trapezoidal rule.
00:11:25.650 --> 00:11:27.140
Itβs Ξπ₯ over two.
00:11:27.140 --> 00:11:30.630
Thatβs 0.25 over two times π of one.
00:11:30.630 --> 00:11:34.400
Thatβs 2.71828 plus π of two.
00:11:34.400 --> 00:11:39.200
Thatβs 3.69453 plus two lots of everything else essentially.
00:11:39.200 --> 00:11:45.540
Thatβs 2.79227, 2.98779, and 3.28834.
00:11:45.830 --> 00:11:52.270
That gives us 3.0687, which, correct to two decimal places, is 3.07.
00:11:52.770 --> 00:11:58.770
Itβs useful to remember that we can check whether this answer is likely to be sensible by using the integration function on our calculator.
00:11:58.950 --> 00:12:02.530
And when we do, we get 3.06 correct to two decimal places.
00:12:03.120 --> 00:12:07.630
Thatβs really close to the answer we got, suggesting weβve probably performed our calculations correctly.
00:12:08.230 --> 00:12:16.440
And so an approximation to the integral evaluated between one and two of π to the power of π₯ over π₯ dπ₯ is 3.07.
00:12:17.280 --> 00:12:21.160
In our final example, weβre going to look at how to find the error in our approximation.
00:12:21.830 --> 00:12:24.700
Itβs outside the scope of this video to look at where this comes from.
00:12:24.940 --> 00:12:27.130
But the formula weβll use is given by.
00:12:27.620 --> 00:12:34.130
The absolute value of the error is less than or equal to π times π minus π cubed over 12π squared.
00:12:34.220 --> 00:12:37.910
And this could be used when the second derivative of the function is continuous.
00:12:37.980 --> 00:12:43.530
And π is an upper bound for the modulus of the second derivative over the closed interval π to π.
00:12:44.140 --> 00:12:52.900
a) For π equals four, find the error bound for the trapezoidal rule approximation of the definite integral of one over π₯ evaluated between one and two.
00:12:53.340 --> 00:13:05.460
And b) How large should we take π in order to guarantee that the trapezoidal rule approximation for the integral of one over π₯ between one and two is accurate to within 0.0001?
00:13:05.980 --> 00:13:12.420
We can see that weβre going to need to work out π double prime of π₯, the second derivative of the function one over π₯.
00:13:12.620 --> 00:13:16.260
Letβs alternatively write π of π₯ as π₯ to the power of negative one.
00:13:16.600 --> 00:13:21.470
Then π prime of π₯, the first derivative, is negative π₯ to the power of negative two.
00:13:21.840 --> 00:13:27.690
And π double prime of π₯ is two π₯ to the power of negative three or two over π₯ cubed.
00:13:27.890 --> 00:13:32.180
We know that π₯ is greater than or equal to one and less than or equal to two.
00:13:32.580 --> 00:13:36.230
And that tells us that one over π₯ must be less than or equal to one.
00:13:36.540 --> 00:13:41.850
So letβs consider what this tells us about the absolute value of the second derivative of π of π₯.
00:13:42.070 --> 00:13:45.240
Well, itβs the absolute value of two over π₯ cubed.
00:13:45.430 --> 00:13:49.910
So that must be less than or equal to two over one cubed, which we know is two.
00:13:50.210 --> 00:13:57.320
So weβre going to take π as being equal to two since this is the upper bound for the second derivative in this question.
00:13:57.560 --> 00:13:59.440
π is one and π equals two.
00:13:59.750 --> 00:14:02.180
And weβre told in the question that π is equal to four.
00:14:02.530 --> 00:14:14.260
And this means the absolute value of our error is less than or equal to two times two minus one cubed over 12 times four squared, which is roughly equal to 0.01041 and so on.
00:14:14.650 --> 00:14:22.110
We can therefore say that the absolute value for the error is less than 0.01042, correct to five decimal places.
00:14:22.420 --> 00:14:25.680
Then, for part b of this question, weβre going to use what we did in part one.
00:14:26.080 --> 00:14:28.390
This time though, weβre trying to work out the value of π.
00:14:28.590 --> 00:14:38.320
So we say that the absolute value of our error is less than or equal to two times two minus one cubed over 12 times π squared, which simplifies to one over six π squared.
00:14:38.610 --> 00:14:41.920
We need this to be less than 0.0001.
00:14:42.360 --> 00:14:47.650
So we form the inequality one over six π squared is less than 0.0001.
00:14:47.850 --> 00:14:48.840
And we solve for π.
00:14:49.220 --> 00:14:55.640
By rearranging, we obtain the inequality π squared is greater than one over 0.0006.
00:14:55.840 --> 00:14:57.770
And then we find the square root of both sides.
00:14:57.920 --> 00:15:03.170
We donβt here need to worry about the negative square root of one over 0.0006.
00:15:03.340 --> 00:15:05.940
As we know, by definition, that π must be a positive number.
00:15:06.150 --> 00:15:09.490
So we obtain π to be greater than 40.824.
00:15:09.770 --> 00:15:18.200
For us to be able to guarantee that the approximation is accurate to within 0.0001, weβre going to let π be equal to 41.
00:15:19.600 --> 00:15:24.540
In this video, weβve learned that the trapezoidal rule approximation could be used to approximate definite integrals.
00:15:24.790 --> 00:15:28.930
We obtained the formula for the trapezoidal rule approximation as shown.
00:15:29.260 --> 00:15:35.880
And we saw that, under certain circumstances, we can establish the error involved in these approximations by using this formula.