Skip to content

Commit 249dc33

Browse files
committed
Post-lecture corrections
1 parent 6ae3db8 commit 249dc33

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/10_Numerical_differentiation.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,8 @@ of the computed finite-difference approximation to $f'(x)$ as
524524
\tag{6}
525525
\begin{aligned}
526526
|f'(x) - \widetilde{D}^+_h f(x)|
527+
&= \left|\frac{f''(\xi)}{2} h + \frac{ϵ_1}{h}f(x+h) - \frac{ϵ_2}{h} f(x)\right| \\
528+
&≤ \frac{h}{2} |f''(\xi)| + \frac{|ϵ_1|}{h} |f(x+h)| + \frac{|ϵ_2|}{h} |f(x)| \\
527529
&≤ \frac{h}{2} \max_{x \in [a, b]} |f''(x)| + 2 \, \max_{x \in [a, b]} |f(x)| \, \frac{\epsilon_M}{h} \\
528530
&= \underbrace{\frac{h}{2} \|f''\|_\infty}_{\text{trunc. error}}
529531
+ \underbrace{\frac{2 \epsilon_M}{h} \|f\|_\infty}_{\text{round-off error}}
@@ -924,7 +926,7 @@ This formula is also of **second order** as can be checked using a Taylor series
924926

925927
# ╔═╡ 2adfac60-ec91-4c70-ae0c-f460f47d37dc
926928
md"""
927-
!!! error
929+
!!! danger
928930
Do not confuse the **derivation order** (how many times we differentiate) and the **approximation order** (the leading power of $h$ in the approximation error).
929931
930932
In this case, we are approximating a second derivative, so the derivation order is 2, and it turns out that this formula has an approximation error in $\mathcal O (h^2)$ so the approximation order is also 2.

0 commit comments

Comments
 (0)