ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)
Our notes
1 min readWhy differentiate numerically
When f is known only from data (displacement against time from a sensor) or is too complicated to differentiate by hand, derivatives are estimated from nearby values. Taylor series give the formulas and their errors.
First derivative formulas
- Forward difference: f′(x) ≈ [f(x + h) − f(x)]/h, error about (h/2)f″: first order (error ∝ h).
- Backward difference: f′(x) ≈ [f(x) − f(x − h)]/h, also first order.
- Central difference: f′(x) ≈ [f(x + h) − f(x − h)]/(2h), error about (h²/6)f‴: second order (error ∝ h²).
Worked example. f(x) = eˣ at x = 1, h = 0.1 (true f′(1) = e = 2.718282). e^1.1 = 3.004166, e^0.9 = 2.459603.
- Forward: (3.004166 − 2.718282)/0.1 = 2.858842, error 0.140560.
- Central: (3.004166 − 2.459603)/0.2 = 2.722815, error 0.004533.
The central formula is about 30 times more accurate with the same points.
Second derivative
f″(x) ≈ [f(x + h) − 2f(x) + f(x − h)]/h², second order.
Same data: (3.004166 − 5.436564 + 2.459603)/0.01 = 0.027205/0.01 = 2.7205 (true 2.718282).
Choosing h
Smaller h cuts truncation error, but f(x + h) and f(x) become nearly equal and round-off (subtractive cancellation) grows like ε/h. For double precision with the central formula, h around 10⁻⁵ is a typical good choice; very small h (10⁻¹²) gives garbage.
Richardson extrapolation
Combine two estimates with step h and h/2 to cancel the leading error term. For a second-order formula: D ≈ [4D(h/2) − D(h)]/3, which is fourth order.
Noisy data
Differentiation magnifies noise. Smooth the data first (least squares fit or a moving average), or differentiate a fitted curve.
Exams usually ask: derive forward and central formulas from Taylor series; state their orders; compute derivative estimates from a table; explain the trade-off in choosing h.
Common mistake: dividing the central difference by h instead of 2h. The two points are 2h apart.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Kaw, Numerical Methods with Applications: Differentiation of continuous functions
Textbook chapter (PDF, about 0.9 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: Differentiation of continuous functions, CC BY-NC-ND 4.0 · licence
-
Kaw, Numerical Methods with Applications: Differentiation of discrete functions
Textbook chapter (PDF, about 0.3 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: Differentiation of discrete functions, CC BY-NC-ND 4.0 · licence
-
Numerical differentiation
(opens en.wikipedia.org in a new tab)
Wikipedia, Numerical differentiation, CC BY-SA 4.0 · licence
-
Finite difference
(opens en.wikipedia.org in a new tab)
Wikipedia, Finite difference, CC BY-SA 4.0 · licence
-
Kaw, Numerical Methods with Applications (the whole free textbook)
Every chapter as a separate PDF (0.2 to 1.5 MB each), with videos and quizzes for each method.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications (the whole free textbook), CC BY-NC-ND 4.0 · licence
Watch
-
Chapter 02.02: Numerical Diff of Continuous Functions - First Derivative: Forward Divided Diff
11 min · ≈ 50 MB · about ₦28
(opens youtube.com in a new tab)
-
Chapter 02.02: Numerical Diff of Continuous Functions - First Derivative - Central Divided Diff
11 min · ≈ 50 MB · about ₦28
(opens youtube.com in a new tab)
-
Numerical Differentiation: Finding first and second order derivatives using Numerical Formulae.
34 min · ≈ 153 MB · about ₦86
(opens youtube.com in a new tab)
-
Numerical Differentiation with Finite Difference Derivatives
37 min · ≈ 167 MB · about ₦94
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.