I would like to understand (in the book by Ralston: A first course in numerical analysis) on the page 173 the denominator $24$ in $(5.3-10)$ in the snippet below. We have $r=3$ and the original formulas $(5.3-4)$ and $(5.3-6)$ say $\frac{1}{r!}$. So how can I get $\frac{1}{(r+1)!}$ in $(5.3-10)$ or $24$ anyway ?
2 Answers
Decomposing the left and right side of the equation into odd and even components around $(k,y_k)$ or $(x,y(x))$ gives coefficients $(1-a)$ and $(1+a)$ in the results. Then one can hope that there is also a correspondence in the truncation error, that computing it for the terms with equal coefficients simplifies the whole calculation.
Practically, after separation insert the Taylor series for $y(x\pm h)$ and $y'(x\pm h)$, this gives for the parts of the equation
left side
$\newcommand{\iv}{{\mathrm{\iota v}}}$ \begin{align} y_{k+1}+(a-1)y_k-ay_{k-1}&=\frac{a+1}2(y_{k+1}-y_{k-1})+\frac{1-a}2(y_{k+1}-2y_k+y_{k-1}) \\[.5em]\hline y(x+h)-y(x-h)&=2hy'(x)+\tfrac13h^3y'''(x)+\tfrac1{60}h^5y^{\rm v}(x)+O(h^7)\\ y(x+h)-2y(x)+y(x-h)&=h^2y''(x)+\tfrac1{12}h^4y^\iv(x)+O(h^6) \end{align}
right side
\begin{align} (5-a)y'_{k+1}+8(1+a)y'_k+(5a-1)y'_{k-1} &=\begin{aligned}[t] &2(1+a)(y'_{k+1}+4y_k+y'_{k-1})\\ &+3(1-a)(y'_{k+1}-y'_{k-1}) \end{aligned} \\[.5em]\hline y'(x+h)+4y'(x)+y'(x-h)&=6y'(x)+h^2y'''(x)+\tfrac1{12}h^4y^{\rm v}(x)+O(h^6)\\ y'(x+h)-y'(x-h)&=2hy''(x)+\tfrac13h^3y^\iv(x)+O(h^5) \end{align}
Comparing the parts in $(a+1)$ and $1-a$ separately gives \begin{align} \frac{y(x+h)-y(x-h)}2&-\frac{2h}{12}(y'(x+h)+4y'(x)+y'(x-h))\\ &=-\frac{1}{180}h^5y^{\rm v}(x)+O(h^7)\\ \frac{y(x+h)-2y(x)+y(x-h)}2&-\frac{3h}{12}(y'(x+h)-y'(x-h))\\ &=-\frac1{24}h^4y^\iv(x)+O(h^6) \end{align}
Combined the error is $$ \frac{a-1}{24}h^4y^\iv(x) - \frac{a+1}{180}h^5y^{\rm v}(x) + O(h^6) = \frac{a-1}{24}h^4y^\iv\left(x-\frac{2(a+1)}{15(a-1)}h\right)+ O(h^6), $$ the second expression is only valid for $a$ not too close to $1$, so that the offset remains smaller than $h$ (or some small multiple) in absolute value.
- 131,652
Distributions, step -1
For the construction of the weight kernel, one can start with the distribution that generates the truncation error as it is when applied to $y$,
$$ G_0=\delta_{x+h}+(a-1)\delta_x-a\delta_{x-h}+\frac{h}{12}\Bigl((5-a)\delta_{x+h}'+8(a+1)\delta_x'+(5a-1)\delta_{x-h}'\Bigr). $$
This gets then treated to partial integration, where one needs the anti-derivatives of the kernel. One can see the Dirac-delta at $x$, $\delta(s-x)=\delta_x(s)$ as second derivative of $(s-x)_ {+} = \max(0,s-x)$ or $(x-s) _ +=\max(0,x-s)$ depending on if one wants the primitives zero to the left or to the right. Your source chose zero to the right. The primitive in increasing order are $\frac{(-1)^{m-1}}{m!}(x-s)_+^m$, for $m=0$ one gets the jump from $-1$ to $0$ at $x$.
Directly to step 2
Without distributions one would recognize that
$$ y(x+h)-y(x-h)=\int_{x-h}^{x+h}y'(s)\,ds =2hy'(x-h)+\int_{x-h}^{x+h}(x+h-s)y''(s)\,ds \\~\\ y(x)-y(x-h)=\int_{x-h}^{x}y'(s)\,ds =hy'(x-h)+\int_{x-h}^{x}(x-s)y''(s)\,ds $$
likewise
$$ y'(x+h)-y'(x-h)=\int_{x-h}^{x+h}y''(s)\,ds \\ y'(x)-y'(x-h)=\int_{x-h}^{x}y''(s)\,ds $$ so that the truncation error can be written as
$$ \tau=\int_{x-h}^{x+h}G_2(s)y''(s)\,ds $$ with $$ G_2(s)=(x+h-s)_ + + (a-1)(x-s)_ + -\frac{h}{12}\bigl[(5-a)(x+h-s)_ +^0 + 8(1+a)(x-s)_ +^0\bigr] $$
The terms outside the integral, which are all multiples of $y'(x-h)$, cancel.
step 3
By partial integration it follows that
$$ \tau=-G_3(x+h)y''(x+h)+G_3(x-h)y''(x-h)+\int_{x-h}^{x+h}G_3(s)y'''(s)\,ds $$ with $$ G_3(s)=-\int_s^{x+h} G_2(t)\,dt=\frac12(x+h-s)_ +^2 + \frac12(a-1)(x-s)_ +^2 -\frac{h}{12}\bigl[(5-a)(x+h-s)_ + + 8(1+a)(x-s)_ +\bigr] $$
And again $G_3(x-h)=G_(x+h)=0$, so only the integral remains.
step 4
Apply again partial integration
$$ \tau=-G_4(x+h)y'''(x+h)+G_4(x-h)y'''(x-h)+\int_{x-h}^{x+h}G_4(s)y^{(4)}(s)\,ds $$ with $$ G_4(s)=-\int_s^{x+h} G_3(t)\,dt=\frac16(x+h-s)_ +^3 + \frac16(a-1)(x-s)_ +^3 -\frac{h}{24}\bigl[(5-a)(x+h-s)_ +^2 + 8(1+a)(x-s)_ +^2\bigr] $$
Trivially $G_4(x+h)=0$, while $G_4(x-h)=\frac{h^3}{6}(7+a)-\frac{h^3}{24}(28+4a)=0$. The error is just the integral.
Step 5
With the next partial integration one gets
$$ \tau=-G_5(x+h)y^{(4)}(x+h)+G_5(x-h)y^{(4)}(x-h)+\int_{x-h}^{x+h}G_5(s)y^{(5)}(s)\,ds $$ with $$ G_5(s)=-\int_s^{x+h} G_4(t)\,dt=\frac1{24}(x+h-s)_ +^4 + \frac1{24}(a-1)(x-s)_ +^4 -\frac{h}{72}\bigl[(5-a)(x+h-s)_ +^3 + 8(1+a)(x-s)_ +^3\bigr] $$
Now $G_5(x-h)=\frac{h^4}{24}(15+a)-\frac{h^4}{72}(48)=\frac{h^4}{24}(a-1)$, so that this step is only useful for $a=1$, as the aim is to retain only one instance of $y$ in the error formula
Conclusion
Apply the mean value theorem of integration to step 4, assuming the check that $G_4(s)\ge 0$ on $[x-h,x+h]$ was carried out. $$ \tau=\int_{x-h}^{x+h}G_4(s)y^{(4)}(s)\,ds = y^{(4)}(\eta)\int_{x-h}^{x+h}G_4(s)\,ds=-[G_5(x+h)-G_5(x-h)]y^{(4)}(\eta)=-\frac{h^4}{24}(a-1)y^{(4)}(\eta) $$
- 131,652
-
Dear Lutz, it is great that you have written a new answer to my question from a different viewpoint. I'll read it carefully. In the meantime could you please explain to me here in the second paragraph what is the purpose, what it is good/how it is used the number $2$ in the denominator $$-\frac{1}{90}\frac{f'''(x_3)-f''''(-x_3)}{2\cdot x_3}$$ and how do we derive the r.h.s. of the formula with $f^{(4)}$ there ? In other words why it wouldn't work without $2$ there ? – user122424 Dec 09 '22 at 15:47
-
The $2$ is for the central difference quotient, as $x_3-(-x_3)=2x_3$. As such the value of the difference quotient is $f^{(4)}(\eta)$ with $\eta$ closer to $0$ than $x_3$, following $\frac{h(b)-h(a)}{b-a}=h'(c)$ with $c$ close to the midpoint $\frac{a+b}2$. – Lutz Lehmann Dec 09 '22 at 15:54
-
I'm unable to confirm that $G_2(x-h)=0$ where $$ G_2(s)=(x+h-s)_ + + (a-1)(x-s)_ + -\frac{h}{12}\bigl[(5-a)(x+h-s)_ +^0 + 8(1+a)(x-s)_ +^0\bigr] .$$ Could you kindly help me to understand this ? I got $G_2(x-h)=0.41666ha-2.083333h.$ – user122424 Dec 10 '22 at 16:38
-
Yes, you are right, that was wrong. But it also was not used, so other than removing it and replacing it with a more relevant statement, nothing else changes. – Lutz Lehmann Dec 10 '22 at 16:52
-
Please, step 2, the last line: outside which integral and what/why are multiples of $y'(x-h)$ ? Also, to help me grasp the entire incredibly complex thing, what are the indices $1,2,3,4$ and $5$ under $G$ intended to mean ? – user122424 Dec 10 '22 at 19:22
-
$G_k$ is the weight function for expressing the error via the integral over $y^{(k)}$. The $y'(x-k)$ appear when you assemble the difference formulas directly above into the correct linear combination. – Lutz Lehmann Dec 10 '22 at 19:31

symmetricandanti-symmetricparts ? – user122424 Dec 04 '22 at 12:42even partand why do you claim that they have to be factors of the middle term, can you please help me to understand this ? – user122424 Dec 18 '22 at 11:46