Loading...
Loading...
Numerical Analysis · Axiom Academy
SUMMARY Numerical Differentiation Key concepts for approximating derivatives from discrete data Forward: Uses f(x) and f(x+h), O(h) error Backward: Uses f(x-h) and f(x), O(h) error Central: Uses f(x-h) and f(x+h), O(h²) error 5-Point: Uses 5 points, achieves O(h⁴) accuracy Error Cancellation: Odd-power Taylor terms cancel Symmetry: Samples equally on both sides Same Cost: Still only 2 function evaluations Quadratic Accuracy: Error ∝ h² instead of h The 2h in the denominator (not h) is crucial for the formula to work correctly! Too Large h: Truncation error dominates Too Small h: Round-off error explodes Sweet Spot: Optimal h balances both errors Central Optimal: h ≈ ε^(1/3) ≈ 10⁻⁵ Idea: Combine two step sizes to cancel leading error O(h²) → O(h⁴): D* = [4D(h/2) - D(h)]/3 Repeatable: Apply again for even higher accuracy Connection: Basis for Romberg integration Example: Applying Central Difference Given: f(x) = e^x, find f'(1) with h = 0.1 Compute: f(0.9) = e^0.9 ≈ 2.4596, f(1.1) = e^1.1 ≈ 3.0042 Apply formula: f'(1) ≈ (3.0042 - 2.4596)/(0.2) = 2.7231 Compare: Exact value e ≈ 2.7183, error ≈ 0.0048 Improve: Richardson with h = 0.05 gives error ≈ 0.00003 Start with Central: Best accuracy for same cost Use h ≈ 10⁻⁵: Good balance for double precision At Boundaries: Fall back to forward/backward Noisy Data: Use larger h to smooth noise Need More Accuracy: Apply Richardson extrapolation For PDEs: Central difference in all spatial dimensions
This is the written version of the interactive lesson above. See the full Numerical Analysis course.