Exploring errors

a) Write a program that defines a function $f(x)$ returning the value $x(x-1)$, then uses the backwards difference method to calculate the numerical derivative of $f(x)$ at the point $x=1$, with $h=10^{-2}$.

b) Calculate the exact value of the derivative and compare this to the answer your program gives. The two will not agree perfectly - why not?

c) Repeat the calculation for $h=10^{-2},10^{-4},10^{-6},10^{-8},10^{-10},10^{-12},10^{-14}$. What do you observe about the accuracy of the calculation? Why does it behave in this way?