Question: Python programming help: Exercise 4.3: Calculating derivatives Suppose we have a function f(x) and we want to calculate its derivative at a point x. We
Python programming help:

Exercise 4.3: Calculating derivatives Suppose we have a function f(x) and we want to calculate its derivative at a point x. We can do that with pencil and paper if we know the mathematical form of the function, or we can do it on the computer by making use of the definition of the derivative df lim f (x + )-f(x) n the computer we can't actually take the limit as goes to zero, but we can get a reasonable a) Write a program that defines a function f (x) returning the value x(x -1), then calculates Calculate the true value of the same derivative analytically and compare with the answer approximation just by making small. the derivative of the function at the point x-1 using the formula above with 10 your program gives. The two will not agree perfectly. Why not? b) Repeat the calculation for 10-4, 10-6, 10-8, 10-10, 10-12, and 10-14. You should see that the accuracy of the calculation initially gets better as gets smaller, but then gets worse again. Why is this? We will look at numerical derivatives in more detail in Section 5.10, where we will study tech- niques for dealing with these issues and maximizing the accuracy of our calculations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
