Math 126 Calculus II Maple Assignment 3
This worksheet should not require any special help worksheets or hints.Before you begin, evaluate the following. In addition to the usual restart command, there are three other commands. One loads the plots package. One loads the student package, which will give you access to the Maple command for estimating an integral by Simpson's rule. (If you have forgottenSimpson's rule or never learned it, you might want to look at the section about it in the book, pages 350-352. The rule approximates an integral by approximating the function by a quadratic polynomial over a tiny interval and integrating the quadratic polynomial. It is much more accurate than thetrapezoidal rule). The final command allows you to use e for the number e, instead of having to type exp(1) each time. restart;
with(plots):
with(student):
e := exp(1): Calculating eThe real number NiMtJSRleHBHNiMiIiI= is one of the most important numbers in mathematics and its manifold applications. It occurs in the theory of radioactive decay, epidemiology, and finance to mention only a few areas. So it is important to know its numerical value and to be able to calculate it to as many significant figures as needed. (NiMtJSRleHBHNiMiIiI= has an infinite non-repeating decimal expansion, i.e., it is an irrational number, so it can never be known numerically with complete precision.)Of course, we can just punch the exp button on a calculator, or ask a computer to find it for us.The following Maple command gives NiMtJSRleHBHNiMiIiI= to 20 signifcant figures.evalf(e,20);(We shall refer to this value later in the worksheet, so you may want to write it down to avoid scrolling.) This calculation involved some quite sophisticated theory which was hidden from us, so we want in this worksheet to find NiMtJSRleHBHNiMiIiI= by some of the methods discussed in class and in the text. We start with the formula NiMvLSUkaW50RzYkKiYiIiJGKCUieEchIiIvRik7RiglImVHRig=.plot({1/x,[[1,0],[1,1]],[[e,0],[e,1/e]]},
x=.9..2.9,y=0..2,color=green);Our method will be to choose a guess NiMlIkVH for the upper limit, use Simpson's rule to estimate the integral, and continue modifying E until we get an estimate for the integral which is sufficiently close to 1.00000000000...Now let's choose an initial estimate for NiMlIkVH.E := 3;And now let's pick a large value of NiMlIm5H, in this case NiMvJSJuRyIlKzU=, and determine the Simpson's rule approximationfor NiMtJSRpbnRHNiQqJiIiIkYnJSJ4RyEiIi9GKDtGJyUiRUc= and also the error for that NiMlIkVH and that NiMlIm5H.evalf(simpson(1/x,x=1..E,1000),20);Homework Problem 1. (a) Go back and change NiMlIkVH to various different values, e.g., 2.7, and then reexecute the following statement. (Don't change anything else!) Keep trying until the Simpson rule approximation for the integral gives 1.00000 to at least five decimal places after rounding. How many accurate decimal places does this give you for NiMtJSRleHBHNiMiIiI= when compared with the value of NiMtJSRleHBHNiMiIiI= obtained by Maple at the beginning of the worksheet? Put your answers below.(b) (Optional). Since NiMvLSUkaW50RzYkKiYiIiJGKCUieEchIiJGKS0lI2xuRzYjRik=, why don't we use that instead of relying on Simpson's rule to find the integral? If you choose to do this part, you won't lose any credit for a wrong answer. But trying to figure it out may be instructive.An important aside. The above method assumes the estimate by Simpson's rule is correct, but is that in fact true? Recall that the formula for an upper bound on the error in Simpson's rule is NiMqKCUiTUciIiIqJCwmJSJiR0YlJSJhRyEiIiIiJkYlKiYiJCE9RiUqJCUibkciIiVGJUYq , where NiMlIk1H is the maximum of the absolute value of the fourth derivative of the integrand. In this case the integrand is 1/x and its fourth derivative is NiMsJComLSUqZmFjdG9yaWFsRzYjIiImIiIiKiQlInhHRighIiJGLA==, which on the interval NiM3JCIiIiUiRUc= has maximum absolute value NiMtJSpmYWN0b3JpYWxHNiMiIiY= at NiMvJSJ4RyIiIg== . Also, in this case, a = 1 and b = E, and n = 1000, so an upper bound for the error isevalf(5!*(E-1)^5/(180*1000^4));This is more than small enough to ensure that the estimate of the integral will be accurate to at least 10 decimals, and we only wanted to choose NiMlIkVH so that it gave 1.00000 to at least five decimal places.. A second methodAnother way to find NiMtJSRleHBHNiMiIiI= is to use the formula NiMvJSJlRy0lJmxpbWl0RzYkKSwmIiIiRioqJkYqRiolIm5HISIiRipGLC9GLCUpaW5maW5pdHlH .
To this end, we define a function of nP := n -> (1 + 1.0/n)^n;We could of course just ask Maple for the value of NiMtJSZsaW1pdEc2JC0lIlBHNiMlIm5HL0YpJSlpbmZpbml0eUc=, but that would be `cheating' because Maple would use all the facts it knows about exponentials and logarithms to calculate the limit, including the fact that this limit is NiMtJSRleHBHNiMiIiI=, and it knows how to find NiMtJSRleHBHNiMiIiI= to any desired degree of accuracy by advanced methods of its own choosing we know nothing about. So intead, just choose a large value of NiMlIm5H and see what NiMtJSJQRzYjJSJuRw== is for that NiMlIm5H.n:= 100;
evalf(P(n),20);Homework Problem 2. In the above lines, change NiMlIm5H to a larger value, and reexecute the group of statements. Continue doing this until you determine the smallest value of n that gives a NiMtJSJQRzYjJSJuRw== that agrees to within five decimal places after rounding with the value for NiMtJSRleHBHNiMiIiI= that Maple gave us at the beginning of the worksheet. Warning: Start with moderate values of n like n = 1000. If you choose n too large, you will probably exceed the capacity of your computer. If you find that it is taking too long to get a result as you increase n in steps, then content yourself to obtain accuracy to three decimal places after rounding instead. Write your answer below. A third methodNiMlImVH is not a rational number, but we will see in Chapter 12 in formula 12 on page 789 that it is possible to find its value with a computer to as many places as we want with the formula NiMvJSJlRy0lJmxpbWl0RzYkLSUkc3VtRzYkKiYiIiJGLC0lKmZhY3RvcmlhbEc2IyUiakchIiIvRjA7IiIhJSJuRy9GNSUpaW5maW5pdHlH . Another way to find e is to use this formula. We define a function of NiMlIm5H:Q := n -> sum(1/j!,j=0..n);Of course, we could again have Maple evaluate the limit. Instead, we'll choose a large NiMlIm5H andsee what NiMlIlFH is for that NiMlIm5H. evalf(Q(100),20);(This time we didn't first specify a value of NiMlIm5H, then evaluate NiMtJSJRRzYjJSJuRw==. If you try that, you find Maple knows too much about this sum and tries to use an exact formula for it.) Homework Problem 3. In the above line, change NiMlIm5H (the integer which you plug into NiMlIlFH) to a smaller value, and reexecute the statement. Continue doing this until you determine the smallest value of NiMlIm5H that gives a value of NiMtJSJRRzYjJSJuRw== that agrees to within five decimal places after rounding with the value for e that Maple gave us at the beginning of the worksheet.Write your answer below.