Finite differences are approximations
Agent-Assisted Engineering Check
Prerequisites
Complete the previous activity and use the listed recovery source if blocked.
Learning Objective
Implement forward, backward, and central finite differences from the derivative definition, keep h explicit, and compare them with an analytical answer rather than treating an approximation as exact.
Instructions
1. Write the three stencils with a symbolic h before inserting numbers: forward [f(a+h) - f(a)]/h, backward [f(a) - f(a-h)]/h, central [f(a+h) - f(a-h)]/(2h). Keep the sign of h visible.
2. Predict which stencil lands closest to f'(3) = 6, using Day 17's result that the forward quotient for x^2 at 3 is exactly 6 + h.
3. Compute f(3.1), f(3) and f(2.9) once, then reuse those three values in all three stencils.
4. Tabulate each estimate next to its signed error (estimate - 6).
5. Explain the pattern with a Taylor expansion: for x^2 the forward error is exactly +h and the backward error exactly -h, and in the central stencil these cancel; the next term would involve f''', which is zero for a quadratic.
6. Say which quantities are exact (f'(3), the function values) and which are approximations (the stencil outputs in general), and why the central result here is a special case, not a rule.
Time plan (120 min): reading 30 + exercise 55 + check 35. Reading: OpenStax Section 3.1 (the derivative as a limit of difference quotients) and the SciPy derivative page overview. Exercise: the three stencils, the error table and the Taylor explanation. Check: the mastery item at x=2, h=.01, unaided.
Practice & Prediction Log
For f(x)=x^2 at x=3 and h=.1, calculate forward [f(3+h)-f(3)]/h, backward [f(3)-f(3-h)]/h, and central [f(3+h)-f(3-h)]/(2h). Predict which is closest to f'(3)=6.
Write the stencil before inserting numbers and preserve the sign of h. Recovery: SciPy derivative reference for the numerical convention; offline fallback is the three formulas and exact polynomial calculation here.
f(3.1)=9.61 and f(2.9)=8.41. Forward=(9.61-9)/.1=6.1; backward=(9-8.41)/.1=5.9; central=(9.61-8.41)/.2=6.0. Here central is exact because the quadratic's third-order remainder vanishes, but this is not universal.
Unaided, calculate all three estimates for f(x)=x^2 at x=2 and h=.01, compare with 4, and state which quantities are exact versus approximate.
Authoritative Source Resources & Provenance
OpenStax Calculus Volume 1
Relevant Section / Range: Sections 2.1-2.3 (Functions, Limits, and the Derivative); Sections 3.1-3.2 (Derivative Rules)
Verified Version & Date: 3rd edition, verified 2026-10-30
Open, systematic treatment of the limit definition and derivative rules with stable section locations.
Algebra, coordinate geometry, and function notation
The authored derivations, tables, and exercises in these three Study Days are complete offline recovery material; use the linked section only for optional comparison.
Compared Candidate Sources & Selection Analysis (3)
Strong exercises and transcripts, but the noncommercial share-alike terms and course navigation make OpenStax the primary stable text.
Useful reference, but rights and redistribution terms are less suitable for embedded recovery material.
A primary API reference for numerical derivative step-size behavior; it complements rather than replaces the hand derivation.
SciPy numerical derivative reference
Relevant Section / Range: derivative API: finite differences, step-size iteration, tolerances
Verified Version & Date: SciPy documentation, verified 2026-10-30
Documents numerical differentiation as an approximation with finite step sizes and stopping criteria.
Python arithmetic and the definition of a derivative
The local Day 18 tables and pure-Python snippets reproduce the relevant finite-difference behavior without SciPy.
Compared Candidate Sources & Selection Analysis (2)
Array-oriented gradient estimation on sampled grids; the SciPy derivative reference matches the pointwise finite-difference helper the exercises implement.
Symbolic rather than numerical differentiation; useful for exact cross-checks but not the finite-difference practice target.