Approximate the derivative of f(x) using the forward difference formula: D = (f(x+h) - f(x)) / h. Example: f(x)=x², x=3, h=1 gives D=7; true derivative=6, error=1.

The error is O(h) — the approximation improves as h shrinks.

Example

Approximate a derivative using f(x+h) and f(x).

highlighted = computed this step

Step 1 — Set up

Set up the forward difference.

f(x)=x2x=3h=1f(x)= x^{2} \quad x= 3 \quad h= 1

Step 2 — Function values

Evaluate the two function values.

f(x+h)=f(4)=16f(x)=9f(x+h)=f( 4 )= \hl{16} \quad f(x)= \hl{9}

Step 3 — Forward difference

Subtract forward values and divide by h.

D=(169)/1=7D= ( 16 - 9 )/ 1 = \hl{7}

Step 4 — Result

State the forward-difference estimate.

D=7D= \hl{7}
forward-difference The forward difference formula approximates f'(x) using one step ahead: D = (f(x+h) - f(x)) / h