Numerical Differentiation - Examples & Applications

This section provides practical examples of numerical differentiation techniques, including forward, backward, and centered finite differences, high-accuracy formulas, Richardson extrapolation, unequally spaced data, and partial derivatives.

First-Derivative Finite Differences

The most basic methods for estimating the first derivative are the forward, backward, and centered divided difference formulas, all derived from the Taylor series expansion.

Intermediate: Comparing Forward, Backward, and Centered Differences

Estimate the first derivative of f(x)=0.1x40.15x30.5x20.25x+1.2f(x) = -0.1x^4 - 0.15x^3 - 0.5x^2 - 0.25x + 1.2 at x=0.5x = 0.5 using a step size of h=0.25h = 0.25. Calculate the true percent relative error for the forward, backward, and centered difference approximations. The true value of the derivative is f(0.5)=0.9125f'(0.5) = -0.9125.

Step-by-Step Solution

0 of 4 Steps Completed
1

Higher-Accuracy Differentiation Formulas

By retaining more terms in the Taylor series expansion, we can derive finite difference formulas with higher-order accuracy (e.g., O(h2)O(h^2) for forward/backward, and O(h4)O(h^4) for centered).

Advanced: High-Accuracy Centered Difference

Estimate the first derivative of f(x)=0.1x40.15x30.5x20.25x+1.2f(x) = -0.1x^4 - 0.15x^3 - 0.5x^2 - 0.25x + 1.2 at x=0.5x = 0.5 using the O(h4)O(h^4) centered difference formula. Use a step size of h=0.25h = 0.25. The true value is 0.9125-0.9125.

Step-by-Step Solution

0 of 3 Steps Completed
1

Derivatives of Unequally Spaced Data

When data points are not equally spaced, standard finite difference formulas cannot be used. Instead, a Lagrange interpolating polynomial is fit through the points and then differentiated.

Intermediate: Unequally Spaced Data

Given three unequally spaced points: x0=1,f(x0)=0x_0 = 1, f(x_0) = 0 x1=4,f(x1)=1.386x_1 = 4, f(x_1) = 1.386 x2=6,f(x2)=1.792x_2 = 6, f(x_2) = 1.792 Estimate the derivative f(4)f'(4).

Step-by-Step Solution

0 of 2 Steps Completed
1

Partial Derivatives

Partial derivatives are estimated by holding all other variables constant and applying standard finite difference formulas to the variable of interest.

Intermediate: Numerical Partial Derivative

Let f(x,y)=x2y+3xy2f(x, y) = x^2 y + 3xy^2. Estimate fx\frac{\partial f}{\partial x} at (1,2)(1, 2) using a centered difference with hx=0.1h_x = 0.1.

Step-by-Step Solution

0 of 2 Steps Completed
1

Richardson Extrapolation

Richardson extrapolation uses two derivative estimates computed with different step sizes to obtain a third, more accurate estimate.

Advanced: Richardson Extrapolation

Use Richardson extrapolation to estimate the first derivative of f(x)=ln(x)f(x) = \ln(x) at x=2x = 2. First, calculate centered difference estimates using h1=0.2h_1 = 0.2 and h2=0.1h_2 = 0.1. Then, combine them using Richardson extrapolation to find an O(h4)O(h^4) estimate. True value is f(2)=1/2=0.5f'(2) = 1/2 = 0.5.

Step-by-Step Solution

0 of 3 Steps Completed
1