Limits and Spreadsheets
Spreadsheets
Maple has its own spreadsheets that can be inserted into any Maple Worksheet. Such spreadsheets are useful for doing certain of calculations. In particular if one is interested in evaluating a particular expression at lots of different values, spreadsheets are particularly useful. Suppose we want to evaluate the exponential function
at the values
x
= 1.0, 1.1,1.2,...1.9,2.0. We first define our function
| > | f:=x->exp(0.3*x); |
We then go to the menu and select Insert-Spreadsheet.
We begin by labeling the first column as x . We could simply type the values of x in the first column. However it is more convenient to use the Fill command. We put the first value 1.0 in the A2 cell. Note that in order to change the size of a spreadsheet, we can place the cursor in the tiny box in the south-east corner of the spreadsheet and drag the cursor. To display all the rows through row 12 we drag the cursor down. In general you should not make a spreadsheet too big or you may have trouble printing it. For large spreadsheets you should maintain a reasonable viewing window and rely on the scroll bars.
We then put the cursor in the A2 cell and drag it down to the A12 cell to highlight all of the cells between A2 and A10. We then go to the menu item Spreadsheet and choose Fill-Detailed. We specify the direction as Down , the step-size as 0.1 and click on OK . The values of x that we want to use are automatically entered in the first column.
We now label the second column as f ( x ) and then go to the cell B2. Note that we must put f(x) in single quotes to get this label. If we do not put f(x) in single quotes, the formula for f(x) is inserted. In B2 we enter f(~A2) and hit the return key.
We now highlight the cells B2 through B12 by dragging the cursor over these cells. We then select Spreadsheet-Fill-Down. The values of our function are automatically filled in
Note that if we click in the cell B3, the expression in the edit line at the top of the screen is f(~A3). This illustrates an important feature of spreadsheets: if the value in one cell (such as B2) depends on another cell (such as A2) and the first cell is copied to another cell (such B3), then the value in B3 is automatically determined from the value in A3 in the same was the value in B2 was determined from the value in A2. In other words the relative positions of the cell A2 to the cell B2 (one cell to the left) is preserved. Note that filling in a block of cells is merely copying one cell to many cells.
Suppose we wanted to calculate the differences between successive entries in the second column and put them in the the third column. We begin by labeling the third column differences . We then enter ~B3 - ~B2 in the cell C2. Finally we fill in the cells C2 through C11. Note that we cannot fill in C12 since there is no value in B13.
The entries in the third column indicate that as x increases from 1 to 2 in equal increments of 0.1, the differences between the values of our function are becoming larger and larger.
When working in a spreadsheet if a particular cell or block of cells is highlighted, one can open the spreadsheet menu by clicking the right button of the mouse.
The default setting for a spreadsheet is to round floating values to four decimal places. If we want more accuracy, say in columns B and C, we first highlight these columns by dragging the cursor across the cells labeled B and C in the very top row of the spread sheet. We then go to the menu item Spreadsheet-Properties-Precision and set the number of digits used during calculation to 12 and the number of digits displayed to 8. We then click OK.
If one wants more than 10 digits displayed within a spreadsheet, one must increase the number of digits displayed outside the spreadsheet with the Digits: = command. For example to display 20 digits in columns B and C in the above spreadsheet, we first execute the command
| > | Digits:=25; |
We then highlight the entries in columns B and C and open the properties window. In that window we set the number of digits used during calculation equal to 25 and the number of digits displayed equal to 20.
Project
In this project you are going to use Maple spreadsheets to construct numerical values of a function f ( x ) as x approaches 1 from the left and from the right.
Let
k
denote the number of letters in your last name. Define the function
.
1. Construct a spreadsheet that displays the values of your function f ( x ) at the values x = 0.0, 0.1, 0.2,...,0.9 with eight decimal places displayed.
2. Construct a spreadsheet that displays the values of your function f ( x ) at the values x = 2.0, 1.9, 1.8, ...,1.1 with eight decimal places displayed.
You can use different columns of the same spreadsheet rather than two different spreadsheets if you like.
3.Begin by increasing the digits displayed to 25 with the following command.
| > | Digits:=25; |
Construct a spreadsheet that displays the values of your function f ( x ) at the values x = 1.1, 1.01,1.001,...1.0000000001. Set the precision so that 25 digits are used in the calculation and 20 digits are displayed. Note that the values of x are not a constant difference apart so we cannot use a simple fill procedure to get these values in the first column. Here is a trick. Fill in the first column with the integers from 1 to 10. If you have labels in the first row, then the 1 is in the A2 cell. In the B2 cell enter 1.0+10^(-~A2). Note that we use 1.0 instead of 1 so that the number is displayed as a decimal rather than as a fraction. Then fill the cells from B2 through B11. Now you can evaluate your function in the third column.
4. Display the values of your function f ( x ) at the values x = 0.9,0.99,0.999,...,0.9999999999.
5. In the above two cases the values of x approached 1 from either the right or the left. You can make x approach 1 from both sides by entering 1.0+(-1)^(~A2)*10^(-~A2) in the B2 cell and filling in the rest of the values in the second column. Now evaluate your function at these values of x and display the values of your function in the third column.
6. Discuss whether your tables of values indicate that your function
f
(
x
) has a limit as
x
approaches 1. Confirm that indeed your function has a limit as
x
approaches 1 by using the
limit
command from Maple to actually evaluate the limit. Call the limit
L
. Finally make a table of values of
at the values
x =
1.1,1.01,1.001,...,1.0000000001. Note that the absolute value function in Maple is
abs().
Suppose you were only considering values of
x
to the right of 1. Based on your table of values of
, how close to 1 would
x
have to be in order to ensure that
<
? Explain.
7. Make a plot of
and the constant function
on a very small interval centered at
x
= 1. You will need to adjust the viewing windowing of your plot so that you have a good view of these functions. Use the
fsolve
command to determine where these curves intersect. What is the largest interval containing 1 such that
<
?
8. Let
. This time we are interested in whether or not g(
x
) has a limit as
x
approaches 0. Make tables of values similar to those in parts 3,4 and 5 above. Discuss your findings. You might want to make a plot of your function over the interval from -1 to 1. Try to evaluate the limit of g(
x
) with the limit command in Maple. What does the output indicate?
Extra Credit
While tables of values of a function cannot "prove" whether or not a limit exists, they can give a reasonable indication in many cases. In the first part of this lab we used a special set of values of x approaching 1. We can build some randomness into the values of x by using the random number generator in Maple. The function
rand ( ) generates a random integer with 12 digits:
| > | restart:Digits:=20: |
| > | rand(); |
If we multiply this function by
, we get a random number between 0 and 1. Similarly if we multiply this function by
, we get a random number between 0 and 0.1. Continuing to multiply by higher negative powers of 10, we can generate a sequence of random numbers approaching 0 from the right. If we add such a sequence to a number
b
, we generate a random sequence of numbers approaching
b
from the right.
| > | seq(1.0+10^(-11-j)*rand(),j=1..10); |
If we subtract such a sequence of random numbers from b , we generate a random sequence of numbers approaching b from the left.
| > | seq(1.0-10^(-11-j)*rand(),j=1..10); |
We can get random values approaching 1 from both sides by inserting
into our formula:
| > | seq(1.0+(-1)^j*10^(-11-j)*rand(),j=1..10); |
We can easily incorporate this randomness into a spreadsheet. We fill in the integers from 1 to 10 in the first column. We then enter 1.0+(-1)^(_A2)*10^(-11-~A2)*rand() in the cell B2 and then fill down the rest of the second column
If we highlight the cells B2 through B10 and apply Spreadsheet-Evaluate Selection , we obtain a different set of random numbers approaching 1 from both sides. If we want to evaluate a function f ( x ) at these values, we can do this in the third column in the usual way.
Exercise:
Investigate the values of the function
for
x
close to 0. Construct a spreadsheet with random values approaching 0 from both sides and then evaluate f(
x
) for these values. Change the random values for a total of three times and get the corresponding values of f(
x
). What do these values suggest about the limit of f(
x
) as
x
approaches 0? Use the limit command to verify that f(
x
) does indeed have a limit as
x
approaches 0. Make a plot of the function
, where
L
is the limit, on a small interval centered at
x
= 0. Do you notice anything different between this plot and the corresponding plot for the function in the first part of this lab? Explain.
The Most Common Maple Commands
Academic Honesty Statement:
Place the following statement (by copying and pasting) at the end of your report and sign it in ink. Your instructor will not grade your report unless this signed statement appears at the end of your report.
I understand that I may work with others if I give them credit in this statement. I also understand that I am required to write my report--that to copy all or part of someone else's report or to allow someone else to copy all or part of my report constitutes plagiarism, which is a serious violation of academic honesty.
I worked with (replace this parenthetical remark with first and last names of those with whom you worked) on this project. I wrote my own report. I did not copy any of this report from anyone else and I did not allow anyone else to copy any of this report.
Signed: