Skip to content

Commit 6ae3db8

Browse files
Technici4nmfherbst
andauthored
Fix #22: Add warning+exercise about higher order (#24)
Co-authored-by: Michael F. Herbst <[email protected]>
1 parent d767d9d commit 6ae3db8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/10_Numerical_differentiation.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,17 @@ For example, based on the interpolated polynomial (9) on the nodal points $x-h$,
917917
\tag{10}
918918
D^2_h f(x) = p_2''(x) = \frac{f(x-h) - 2f(x) + f(x+h)}{h^2}.
919919
```
920-
This formula is also of **second order** as can be checked easily using a Taylor series.
920+
This formula is also of **second order** as can be checked using a Taylor series:
921+
!!! exercise
922+
Prove that $D_h^2f(x)$ approximates the second derivative of $f$ to second order.
923+
"""
924+
925+
# ╔═╡ 2adfac60-ec91-4c70-ae0c-f460f47d37dc
926+
md"""
927+
!!! error
928+
Do not confuse the **derivation order** (how many times we differentiate) and the **approximation order** (the leading power of $h$ in the approximation error).
929+
930+
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.
921931
"""
922932

923933
# ╔═╡ 9c8ad9b0-50eb-478e-b63c-26a868765230
@@ -2823,6 +2833,7 @@ version = "1.4.1+2"
28232833
# ╟─a3ddd54a-0171-4e7f-aa65-11224858f8be
28242834
# ╟─ca3564d3-059e-40ce-bbcd-a04594e8ac24
28252835
# ╟─56368f98-6f51-49be-8333-6fa1b9c64cf1
2836+
# ╟─2adfac60-ec91-4c70-ae0c-f460f47d37dc
28262837
# ╟─9c8ad9b0-50eb-478e-b63c-26a868765230
28272838
# ╟─00000000-0000-0000-0000-000000000001
28282839
# ╟─00000000-0000-0000-0000-000000000002

0 commit comments

Comments
 (0)