Introduction

This project will combine and explore methods for approximation of derivatives and integrals, along with methods for estimating errors and using these error estimates to improve accuracy.

We will also compare the performance of various methods: this is often important in making the choice of algorithms for a larger task.

In part, this is an exercise in good written presentation of mathematical and computational results, and as preparation for the second individual project that each of you will do at the end of the semester. The “introduction” and “methods” sections specified below can be quite brief in this project (as many details are specified below) but will be more significant in your final project.

New Due Date for Final Versions: Friday April 9

Some General Advice (updated on April 5)

A) Always put your name and the current version date near the top: see above!

B) When possible, start with test cases for which you know the exact result, and then check the actual errors and include those in the output. (This is mostly relevant to learning about an algorithm and developing code for it.)

C) Initially use the test cases given in Test Cases for Differentiation and Test Cases for Integration; then choose and explore some others.

D) When instead you can get an error estimate, compute that and include it in the output. (This is far more relevant to “real-world” use of an algorithm.)

Note: For a great many methods, there is a useful general strategy for getting error estimates: 1. get two approximations where you have good reason to believe that one is at least about twice as accuarate as the other. 2. Use the difference to estimat the error in th less accurate of the two approximations — this is the “pessimistic” approach recommended above.

For example with errors \(O(h^p)\), \(p \geq 1\), one can use results for \(h\) and \(h/2\) to estimate the error in the first of these; likewise with errors \(O(1/n^p)\), use the approximations for \(n\) and \(2n\) to estimate the error in the former.

E) While testing and demonstrating an iterative method, have a “demonstration” or “testing” mode which gives the option of displaying actual errors and or error estimates at each iteration, to illustrate convergence.

F) In general (but not absolutely always), aim to make functions “self-contained”: - getting all the information they need via input parameters, and - delivering all results through return statements.