First Principles
Home ] Up ]

Welcome to the Teachers' Choice Software web site.
Our FREE on line mathematics 'How-To' library is open 24 hours a day. 
The ever-growing library now has 71 helpful topics, and every topic includes a free download!

This is a sample from the Maths Helper Plus on-line help applications...

Differentiate from first principles

This topic shows how to use Maths Helper Plus to differentiate a function y = f(x) numerically from first principles.

The derivative of a function y = f(x) at the point (x,f(x)) equals the gradient of the tangent line to the graph at that point. It can be defined as:

where 'h' approaches zero as a limit. This diagram illustrates this concept graphically:

The derivative formula (above) gives the gradient of the secant line between the two points. As the value of 'h' gets smaller, the two points get closer and the gradient of the secant approaches that of the tangent line to the curve at (x,f(x)):

1. Load the 'Differentiate from first principles.tpl' template file

Note: It is recommended that you begin with an empty Maths Helper Plus document before proceeding further. You can create a new empty document by holding down a Ctrl key and pressing the 'N' key.

From the 'File' menu, select the 'Use Template' command.

Choose the 'Differentiate from first principles.tpl' template file, then click the 'Open' button.

2. Enter the function to differentiate

Press the F5 key to display the parameters box.

Click in the f(x) edit box, and type your function. (Leave off the 'y=' part. Just type the right side of the equation of the function.) Click the 'Update' button to update the data sets.

Tip: The graph scale is already set up for the function y = x - 2x + 1. If you just want to see the demonstration, then leave this function as it is.

3. Calculate the derivatives

Symbols from the gradient formula used in this demonstration:

  1. 'A' is used for: 'h'

  2. 'X' is used for 'x'

Data sets are as follows:

y = f(x)

This data set plots a graph of the original function defined in the parameters box.

(X,f(X)) (X+A, f(X+A))

These two (x,y) points draw the secant line on the graph, and display a table of calculations which include the gradient of the secant. Ignore all but the top row of values in the table.

y = (f(x+A) - f(x))/A

This data set plots a graph of gradient values calculated all along the y=f(x) curve. Small 'x' is used because we are not restricting the plot to just one 'x' value.

Demonstration: In the parameters box, click on the 'A' edit box, then on the slider. Now use the up arrow and down arrow keys on the keyboard to change the value or 'A'. Note the effect on the derivative approximations when 'A' is: large, small, positive, negative, and zero.

Return to step '2' above and enter other functions. Investigate the form of the derivative graph and how it relates to the original function. Examples of functions to investigate would be: y=x, y=sinx, y=cosx.