2

I have asked a similar question elsewhere but there has remained a small gap for me: How can I derive this approximate equation via the Taylor expansion: $$\frac{y(x+h)-y(x-h)}{2}-\frac{2h}{12}(y'(x+h)+4y'(x)+y'(x-h))=-\frac{1}{80}h^5y^{(5)}(x)+O(h^7) \ ?$$ Do we have to assume that $$y(x+h)-y(x-h)=2hy'(x)+\frac{1}{3}h^3y^{'''}(x)+\frac{1}{360}h^5y^{(5)}(x)+O(h^7)$$ or does this follow ? I think that it is too trivial to ask but the calculation doesn't follow for me.

Leucippus
  • 27,174
user122424
  • 4,060

1 Answers1

1

The Taylor expansion reads \begin{eqnarray} y(x+h) &=& y(x) + hy'(x) + \frac{h^2}{2!} y^{(2)}(x)+\ldots \\ y(x-h) &=& y(x) - hy'(x) + \frac{h^2}{2!} y^{(2)}(x)+\ldots \\ \end{eqnarray} So the difference 'kills' the even derivatives and the first term is $$ \frac12 [y(x+h)-y(x-h)] = \color{red}{hy'(x) + \frac{h^3}{3!} y^{(3)}(x)} + \frac{h^5}{5!} y^{(5)}(x) $$

Repeating this for $y'$ yields \begin{eqnarray} y'(x+h) &=& y'(x) + hy^{(2)}(x) + \frac{h^2}{2!} y^{(3)}(x)+\ldots \\ y'(x-h) &=& y'(x) - hy^{(2)}(x) + \frac{h^2}{2!} y^{(3)}(x)+\ldots \\ \end{eqnarray} It follows that \begin{eqnarray} [y'(x+h)+4y'(x)+y(x-h)] &=& 6 y'(x) + 2\frac{h^2}{2!} y^{(3)}(x) + 2\frac{h^4}{4!} y^{(5)}(x) +\ldots \\ \frac{h}{6}[y'(x+h)+4y'(x)+y(x-h)] &=& \color{red}{hy'(x) + \frac{h^3}{3!} y^{(3)}(x)} + \frac{h^5}{3\cdot 4!} y^{(5)}(x) +\ldots \end{eqnarray}

The difference gives $$ \frac{h^5}{4!} y^{(5)}(x) \left[ \frac15 - \frac13 \right] = -\frac{h^5}{180} y^{(5)}(x) + O(h^7) $$ which is the correct result.

Steph
  • 4,140
  • 1
  • 5
  • 13
  • So the answer there $-\frac{h^5}{80}y^{(5)}(x)$ is not correct, right ? What about the other equation, is it correct: $$\begin{align} \frac{y(x+h)-2y(x)+y(x-h)}2&-\frac{3h}{12}(y'(x+h)-y'(x-h))\ &=-\frac1{24}h^4y^{(4)}(x)+O(h^6) \end{align} $$ ? I'm trying to reach the overall error $$\frac{a-1}{24}h^4y^{(4)}\left(x-\frac{3(a+1)}{10(a-1)}h\right)+ O(h^6)$$ ...namely the number $24$ in the denominator. – user122424 Dec 03 '22 at 20:01
  • Please see $(5.3-10)$ here . – user122424 Dec 03 '22 at 20:12
  • Not sure to understand what you request for. I presume that it should be similar to the manipulations I proposed you. Maybe you should ask another question on MSE to make things more clear ? – Steph Dec 04 '22 at 19:37