x
0
0
h
0.1
f(x) = cos(x)
Using Forward Finite Difference
f'(
0
) = (f(
0
+h) - f(
0
))/h =
-0.05
True value:
f'(
0
) =
0
Using Backward Finite Difference
f'(
0
) = (f(
0
-h) - f(
0
))/(-h) =
0.05
True value:
f'(
0
) =
0
Using Centered Finite Difference
f'(
0
) = (f(
0
+h) - f(
0
-h))/(2h) =
0
True value:
f'(
0
) =
0