Problems on Numerical Differentiation
1. Derive the finite divided difference approximations for the first derivative (i) with order of
approximation O(h) using forward and backward difference and (ii) with order of
approximation O(h2) using centered difference.
2. Derive the second finite divided difference approximations (applicable for second
derivatives) (i) with order of approximation O(h) using forward and backward difference and
(ii) with order of approximation O(h2) using centered difference.
3. Derive the first finite divided difference approximations of higher accuracy (i) with order of
approximation O(h2) using forward and backward difference and (ii) with order of
approximation O(h4) using centered difference.
4. Compute forward and backward difference approximations of O(h) and O(h2), and central
difference approximations of O(h2) and O(h4) for the first derivative of y = cos x at x = π/4
using a value of h = π/12. Estimate the true percent relative error εt for each approximation.
5. Compute forward and backward difference approximations of O(h) central difference
approximations of O(h2) for the second and third derivatives of y = cos x at x = π/4 using a
value of h = π/12. Estimate the true percent relative error εt for each approximation.
6. Repeat Prob. 4, but for y = log x evaluated at x = 25 with h = 2.
7. Use centered difference approximations to estimate the first and second derivatives of y =
exat x = 2 for h = 0.1. Employ both O(h2) and O(h4) formulas for your estimates.
8. Use Richardson extrapolation to estimate the first derivative of y = cos x at x = π/4 using step
sizes of h1 = π/3 and h2= π /6. Employ centered differences of O(h2) for the initial estimates.
9. Repeat Prob. 8, but for the first derivative of lnx at x = 5 using h1= 2 and h2 = 1.
10. Using the Lagrangian polynomialbased equation determine the first derivative of y = 2x4 - 6x3
- 12x - 8 at x = 0 based on values at x0 = -0.5, x1 = 1, and x2= 2. Compare this result with the
true value and with an estimate obtained using a centered difference approximation based on
h = 1.
11. Prove that for equispaced data points, the equation based on Lagrangian polynomial reduces
to the centered difference approximation of first derivative with O(h2) atx = xi.
12. Compute the first-order forward and backward difference approximations of O(h2) for each of
the following functions at the specified location and for the specified step size. Also compute
the percentage error using analytical solution, for each case.
(a) y = sin(0.5√x)/x at x = 1, h = 0.2
(b) y = ex+ x at x = 2, h = 0.2
13. Compute the first-order central difference approximations of O(h4) for each of the following
functions at the specified location and for the specified step size:
(a) y = x3+ 4x – 15 at x = 0, h = 0.25
(b) y = x2 cos x at x = 0.4, h = 0.1
(c) y = tan(x/3) at x = 3, h = 0.5
Compare your results with the analytical solutions.
14. The following data were collected for the distance travelled versus time for a rocket:
t, s 0 25 50 75 100 125
y, km 0 3 58 78 92 100
Use numerical differentiation to estimate the rocket’s velocity and acceleration at each time.
15. Develop a user-friendly program to apply a Romberg algorithm to estimate the derivative of a
given function.
16. Develop a user-friendly program to obtain first-derivative estimates for unequally spaced
data. Test it with the following data:
x 1 1.5 1.6 2.5 3.5
f(x) 0.6767 0.3734 0.3261 0.08422 0.01596
where f(x) = 5e-2x x. Compare your results with the true derivatives.
17. The following data are provided for the velocity of an object as a function of time,
t,s 0 4 8 12 16 20 24 28 32 36
v, m/s 0 34.7 61.8 82.8 99.2 112.0 121.9 129.7 135.7 140.4
(a) Using the best numerical method available, how far does the object travel from t = 0 to 28 s?
(b) Using the best numerical method available, what is the object’s acceleration at t = 28 s?
(c) Using the best numerical method available, what is the object’s acceleration at t = 0 s?