|
|
xxxxxxxxxxxxxxxxxxxxx |
New Utility FunctionsIn the manual several functions are defined such TL(a) which computes the tangent line of a predefined function f(x) at the point x = a. In Chapter 5 and later there will be many more such functions which will approximates roots, integrals and solutions to differential equations. To make it easier to compute with these function we have added a utility file add-util.mth with all the functions defined. The way this utility file works is that you simply use the File/Load/Utility menu and select the file add-util.mth. DfW then loads the file "quietly" meaning that just the definitions are entered and nothing is displayed. The file just takes a second or two to load in quiet mode. To make this process easier we suggest having every lab file start out with the add-head.mth at the top and then add your name and lab number in double quotes. See the sample session below where the first four lines are obtained by loading the add-head.mth file, then the file is renamed using the File/Save As menu as LAB3.MTH.
We have changed the names and the way these function work by eliminating the need to predefine a function f(x). For example, if you want to compute a tangent line for say f(x)=x3/3 at x=1 you would Author and Simplify: TANGENT(x^3/3, x, 1) The result will be y = x - 2/3. . We describe the variables for this and the other functions typically as TANGENT( u, x, a) where the u refers to any expression in the variable x and a is a parameter in the function. Example 1. Suppose
that you want to find the tangent line to the function sin
x at the point (0,0) on its graph. Assuming that you have loaded the utility file add-util.mth
as above then just Author Example 2. Suppose
that you want to find the quadratic polynomial ax2 +
bx + c that passes through the three points: (0,0), (1,2) and (2,8). You
load the utility file add-util.mth and then Author CURVEFIT( x, [[0,1], [1,2], [2,8]]). After simplifying the
result will be 2x2. Probably the best way to
do this is to start by defining the 3x2 matrix of points using the matrix button Example 3. Suppose that you want to find the quadratic polynomial ax2 + bx + c that passes through the two points: (0,0) and (1,2). In addition, you want the derivative to be 1 when x=0. You load the utility file add-util.mth and then Author CURVEFIT( x, [[0,1], [1,2]], [[0,1]]). In other words, you enter one matrix for the points satisfied by the function and another matrix for the points satisfied by the derivative. The degree of the answer polynomial is always one less than the total number of equations for both the function and its derivative. Partial List of Utility Functions:
Need to Download add-util.mth?Version 6 The files add-head.dfw (note the new file extension) and add-util.mth are in the folder G:\DfW5\M242L and is a small text file that can be copied onto a floppy disk. Otherwise just click below: add-head.dfw (1KB) Note: In the lab we set the start in directory on the Derive 6 desktop icon to be H:\ so that whenever you start Derive this is where it looks for the file DFW.INI which contains your default settings such as the number of precision digits. We place the add-head and add-util files in the subfolder M242L in the DFW install folder. If you do things differently at home then you will need to modify the LOAD command in your add-head file so that both the lab and home locations will work. We suggest having two load commands as follows: #2: LOAD("G:\Dfw5\M242L\add-util.mth") Here, in line 3 above just use the path on your system where the file add-head.mth is is located.
|