Computational Assignment: Numerical Differentiation

Computational Assignment — Numerical Differentiation

Complete the four blanks in the notebook you’ve been given — view it online, run it live in your browser, or go straight to download it as a Jupyter notebook to fill in and submit:

  1. Exercise 1 — implement the forward-difference approximation to a derivative at a single point.
  2. Exercise 2 — implement the centred-difference approximation at the same point.
  3. Exercise 3 — repeat both formulas over an array of shrinking step sizes \(h\), producing the error-vs-\(h\) log-log plot.
  4. Written answer — a required Markdown cell (marked “Double-click this cell and write…”) asking you to read the slopes off the log-log plot and explain what they mean for convergence order.

There’s also an Extension: push \(h\) down to \(10^{-14}\) and explain, in a sentence or two, why the error stops shrinking and eventually grows again.

Run every code cell and fill in every required Markdown cell, then submit this notebook as a .ipynb file on Moodle — the notebook itself, with your code, output, and written answers, is the whole submission.