有限差分は近似である
Agent支援エンジニアリングチェック
前提条件
前の活動を終え、行き詰まったら記載の回復ソースを使うこと。
学習目標
導関数の定義から前進・後退・中心の有限差分を実装し、h を明示したまま解析解と比較する。近似を厳密値として扱わない。
手順
1. 数値を入れる前に、記号の h のまま 3 つのステンシルを書く:前進 [f(a+h) - f(a)]/h、後退 [f(a) - f(a-h)]/h、中心 [f(a+h) - f(a-h)]/(2h)。h の符号を見える形で残す。
2. Day 17 の結果(3 における x^2 の前進差商はちょうど 6 + h)を使い、どのステンシルが f'(3) = 6 に最も近いかを予測する。
3. f(3.1)、f(3)、f(2.9) を一度だけ計算し、その 3 つの値を 3 つのステンシルすべてで使い回す。
4. 各推定値と符号付き誤差(推定値 - 6)を表にする。
5. テイラー展開でパターンを説明する:x^2 では前進誤差はちょうど +h、後退誤差はちょうど -h で、中心ステンシルではこれが打ち消し合う。次の項は f''' を含むが、二次関数ではゼロになる。
6. どの量が厳密(f'(3)、関数値)で、どの量が近似(一般にはステンシルの出力)かを述べ、ここで中心差分が厳密になるのは特殊な場合であって規則ではない理由を説明する。
時間配分(120 分):読解 30 + 演習 55 + 確認 35。 読解:OpenStax 3.1 節(差商の極限としての導関数)と SciPy derivative ページの概要。演習:3 つのステンシル、誤差表、テイラーによる説明。確認:x=2、h=.01 の習熟項目を補助なしで解く。
練習と予測ログ
x=3 の f(x)=x^2 について h=.1 とし、前進 [f(3+h)-f(3)]/h、後退 [f(3)-f(3-h)]/h、中心 [f(3+h)-f(3-h)]/(2h) を計算する。どれが f'(3)=6 に最も近いか予測する。
数値を代入する前にステンシルを書き、h の符号を保つ。回復:数値規約については SciPy の微分リファレンス。オフライン代替はここにある三つの公式と多項式の厳密計算。
f(3.1)=9.61、f(2.9)=8.41。前進=(9.61-9)/.1=6.1、後退=(9-8.41)/.1=5.9、中心=(9.61-8.41)/.2=6.0。ここでは二次関数の三次の剰余項が消えるため中心差分がたまたま厳密になるが、これは普遍的ではない。
独力で f(x)=x^2 の x=2、h=.01 における三つの推定値を計算し、4 と比較して、どの量が厳密でどれが近似かを述べる。
権威ある出典リソースと出典情報
OpenStax Calculus Volume 1
該当セクション・タイムスタンプ: Sections 2.1-2.3 (Functions, Limits, and the Derivative); Sections 3.1-3.2 (Derivative Rules)
検証バージョンと日付: 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.
比較対象候補リソースと選定評価 (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
該当セクション・タイムスタンプ: derivative API: finite differences, step-size iteration, tolerances
検証バージョンと日付: 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.
比較対象候補リソースと選定評価 (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.