00:01
We will estimate the interval from negative 1 to 1 of cosine of x square by the midpoint estimate with 4 sub intervals par a, trapezoidal rule with 8 sub intervals par b, and simpson's rule 4 sub intervals par c.
00:20
All the results will be rounded off to 4 decimal places.
00:26
So let's start by defining the integrant function.
00:30
That is f of x equal cosine of x square on the closed interval from negative 1 to 1.
00:55
So in part a we are going to use midpoint estimate, which is given in general as mn equal b minus a over n times the sum of the images of the midpoints.
01:09
First one is x0 plus x1 over 2 plus and the last one is f at x n minus 1 plus x n over 2 that is the sum of the images of the midpoints of this will be intervals so in this case we're going to use n equal 4 here and for n equal 4 we can calculate the step size h which is the common distance between any two consecutive notes that is calculated as b minus a over n that is the length of the interval of integration over the numbers of intervals that is 1 minus negative 1 over 4 that is 2 over 4 that is 1 half so the step size age is equal to 1 half and with that we can write the expression for the notes x i equal the left standpoint of the interval of integration is negative one plus i times h that is negative 1 plus i over 2 and if we do this sum of fractions here we get i minus 2 over 2 that for i from 0 up to 4 that is we can write all the values of the index i 0 1, 2, 3, and 4.
02:58
And we need the midpoints.
03:00
We're going to develop a formula for them 2.
03:03
The midpoints determined by the nodes are, let's say, xi bar, and is the average between xi and xi plus 1.
03:17
And that is, using the formula we got here for the nodes, is i minus 2 value over 2 plus for x i plus 1 we replace i in the general formula here by i plus 1 we get i plus 1 minus 2 is i minus 1 over 2 and that divided by 2 so we calculate the numerators we get 2 i minus 3 and that divided by 4.
03:53
And the index in this case, i goes from 0 up to 3, 0, 1, 2, and 3.
04:04
So there are 4 midpoints.
04:08
And then we can say that the trapezoidal, sorry, the midpoint rule with 4 sub -intervals is equal to h, this factor here, b minus 8.
04:23
A over n is just the value h times the image of the first midpoint is x0 bar plus f at x1 bar plus f at x2 bar plus f at x2 bar plus f at x3 bar so that's the midpoint before so intervals and then we put the values h is we found here is one half times f at the first midpoint remember the midpoints are given by this expression here and the first one x0 bar will be calculated by this expression with i equal zero we get negative 3 over 4 next 1 we calculated for i equal 1 we get 2 minus 3 over 4 that is negative 1 over 4 plus f at for i equal 2 we get 4 minus 3 over 4 that is 1 over 4 plus f at 3 times 2 is 6 minus 3 is 3 over 4 and then the midpoint estimate with 4 sub intervals is 1 1 1 half times and here we apply the function is cosine of the square of negative 3 -folds is 9 over 16 plus cosine of the square of negative 1 -4th is 1 over 16 plus cosine of square of 1 -4th is 1 over 16 plus cosine of the square of 3 -4th is 9 over 16 so we can see there are these factors are the same and these factors are the same so we can say that m4 is one half times two cosine of 9 over 16 plus 2 cosine of 1 over 16.
06:51
These two here get out as a common factor and cancel out with the 2 in the denominator here.
06:58
So you can say this is exactly equal to cosine of 9 over 16 plus cosine.
07:07
Of 1 over 60.
07:10
And for that we use a calculator and we found that m4 that is a midpoint estimate with four sub intervals is about 1 .8 440 that using 4 decimal places.
07:34
And in part b we use trapezoidal rule with eight sub intervals.
07:41
The general expression is the end that is trapezoidal rule.
07:45
With n sub intervals is b minus a over 2n times f at first note x0 plus 2 f at x1 plus of 2 to 2 f at x n minus 1 plus f at x n so if you use n sub intervals the step size h is b minus a over n and that is 1 minus negative 1 over 8 that is 1 minus negative 1 over 8 that is 2 over 8 which is 1 over 4 so the step size is 1 fourth in this case and with that we can write the nodes they are given us x i equal the left and point of the interval of integration is negative 1 plus i times h and that give us negative 1 plus i over 4 and this is the same as i minus 4 over 4 and that 4 the index i equal 0 1 up to 8 so then we can write the trapezoidal rule with 8 of intervals and we see that this factor b minus a over 2n is one half of this term this value age so is age over 2 times f at the first note is x0 plus 2 f at x1 and up to 2 times f at x n minus 1 will be here x7 plus the image of the last node x8 so this is the specific formula for trapsider rule using 4 8 of intervals and then we put the values and t 8 is equal h is 1 4 over 2 times f at the first node is this formula here for i equal 0 we get negative 1 plus 2 f at x1 this formula again with i equal 1 is 1 minus 4 over 4 is negative 3 over 4 we can let's put this the next 1 to be sure we are understanding everything for i equal 2 we get 2 minus 2 over 2 over 4 is negative 2 over 4 is negative 1 1 1 1 1 1 1 1 1 1 1 1 1 and we go on this way up to when i equals seven we get seven minus four over four is three over four and the last note is x8 which is one okay so this is expression we got to calculate so t8 is 1 is 1 over 8 times and here we apply the function we have cosine of negative 1 square is 1 plus 2 cosine of negative 3 fourth square is 9 over 16 plus 2 times cosine of negative 1 1 half square is 1 4th and we go on like that up to 2 times cosine of 3 4th square is 9 over 16 plus cosine of 1 square is cosine of 1 and here we use the calculation calculator and we found that the traps of the rule with eight sub intervals is approximately equal to 1 .7 -915.
12:22
Remember we are rounding off the results to four decimal places.
12:31
Now in part c we use simpson's rule with four sub intervals.
12:44
We remember the general expression of simpson's rule with n sub -interables.
12:48
Intervals is equal to b minus a over 6n times the image of the first node x 0 plus the image of the last node x n plus 2 times the sum of the images of x1 up to f xn xn plus 4 times the some of the images of the midpoints.
13:33
So this is a general expression for simpson's rule with ends of the intervals and now as we said here you got to use force of intervals but that was the same numbers of intervals we use in part a and for that we calculated already the notes and the midpoints and h so we put the results directly here so h is one half and notes are given by x i equal i minus 2 over 2 4 index i equal 0 1 2 and 4 and the midpoint x i bar are given by 2 i minus 3 over 4 for for the index i equal equal 0 0 0 0 0 0 0 0 0 0 0 0 0 0 one, two, and three...