askvity

What is the Finite Difference Formula for Derivatives?

Published in Numerical Methods 3 mins read

The finite difference formulas provide approximations for derivatives of a function using values of the function at discrete points. These formulas are essential in numerical methods for solving differential equations and other mathematical problems. Here are the commonly used finite difference formulas:

Central Difference Approximations

Central difference approximations use function values both before and after the point where the derivative is to be approximated. They generally provide more accurate results than forward or backward difference approximations.

First Derivative Approximation

The central difference approximation for the first derivative of a function y with respect to x at point i is given by:

d y / d x ≈ (yi+1 − yi-1) / (2h)

where:

  • yi is the function value at the current point.
  • yi+1 is the function value at the next point.
  • yi-1 is the function value at the previous point.
  • h is the uniform spacing between points (step size).

This formula utilizes the values from points before and after the current point to compute the derivative.

Second Derivative Approximation

The central difference approximation for the second derivative of y with respect to x at point i is:

*d2y / dx2 ≈ (yi-1 − 2yi + yi+1) / h2**

where the terms are defined as above.

Explanation of Finite Differences

These finite difference expressions replace the derivatives of y in a differential equation. This turns the differential equation into a system of linear equations that can be solved numerically if the differential equation is linear.

For example, consider a simple ordinary differential equation (ODE). To solve it numerically, we approximate the derivatives using finite difference formulas. Then, instead of solving a differential equation, we solve a system of algebraic equations.
The reference states: “These finite difference expressions are used to replace the derivatives of y in the differential equation, leading to a system of n + 1 linear algebraic equations if the differential equation is linear.”

Practical Insights

  • The choice of step size (h) affects the accuracy of the approximation. A smaller h generally leads to more accurate results but requires more computations.
  • Central difference approximations are generally more accurate than forward or backward difference approximations when approximating derivatives.
  • Finite differences are widely used in numerical analysis to solve a broad range of scientific and engineering problems.

Table Summary

Derivative Finite Difference Formula
First Derivative (Central Difference) (yi+1 − yi-1) / (2h)
Second Derivative (Central Difference) (yi-1 − 2yi + yi+1) / h*2

These formulas are powerful tools that allow us to approximate derivatives numerically, enabling us to solve complex problems in mathematics, physics, and engineering.

Related Articles