Chapter 5 - Slope

5.9 Using Excel

The Excel description of functions is via tables of f(x) versus x. These tables can then be graphed. Each entry in the table represents a new point on the graph. Therefore, Excel tables implement the notion of an equally spaced numerical grid. The following tabulates the function

f(x) = sin(x) + cos(x)

in the domain -p to +p and plots it.

The slope can be calculated numerically according to the Backward, Forward, and Symmetric formulae. Each row in the table represents f(x) at x, with the row above and below tabulating f(x-dx) and f(x+dx) respectively. Therefore the finite difference formula applies directly as illustrated below.

Note that the top most and bottom most cells in the table are not necessarily defined since they would need function values outside the range of the table.

Once the top line (second from top) is defined, we can used the fill-down option to fill the table. Note that the bottom most line of cells may not be necessarily defined if they require the function evaluated outside for x > x max.

The following shows the graphs of the slope of the function f(x) calculated via the finite difference formulae. Note that the selection of separated table columns is achieved via pressing the "clover" key on the Mac. You could also select all the columns and later "delete" the un-needed data series.


  Section 5.8 Chapter 5 Exercises       TOC

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu