last day (18 days later) » 

17:33
Hello @LutzL !!!
I have to show that the following difference quotients are approximations of $f'''(x)$.

$$\frac{f(x+3h)-3f(x+2h)+3f(x+h)-f(x)}{h^3} \\ \frac{f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h)}{2h^3}$$

Which approximation is more accurate? Justify your answer.


I found the Taylor expansion of $f(x+3h) , f(x+2h), f(x+h)$ and found that

$$\left| \frac{f(x+3h)-3f(x+2h)+3f(x+h)-f(x)}{h^3}-f'''(x) \right| \leq \frac{22}{4} h ||f^{(4)}||_{\infty}$$

Have we shown now that $\frac{f(x+3h)-3f(x+2h)+3f(x+h)-f(x)}{h^3}$ is an approximation of $f'''(x)$?
 
2 hours later…
19:45
One-sided formulas of minimal length are always worse than symmetric formulas. I'd guess that your second error term is wrong, I'd expect that because of the symmetry the error is O(h^2).
f(x+h)-f(x-h) = 2f'(x)h+1/3·f'''(x)h^3+1/60·f^{(5)}(x)h^5+...
f(x+2h)-f(x-2h) = 4f'(x)h+8/3·f'''(x)h^3+8/15·f^{(5)}(x)h^5+...
so in the difference
[f(x+2h)-f(x-2h)]-2[f(x+h)-f(x-h)] = 2·f'''(x)·h^3 + 1/2·f^{(5)}(x)h^5+...

with more careful computation it should be possible to fold the remainder into the 5th derivative, so I'd expect at most a factor of 17/30 for h²·||f^{(5)}||_{\infty}
A ok... I will redo the calculations to make the expansion till the fifth derivative.
@LutzL Do we have to do so also for the first quotient difference?
@LutzL Could you explain me what you mean with "One-sided formulas of minimal length" ?
20:01
The pure one-sided, uncentered powers of the difference operator.
If we have a difference quotient that is symmetric do we expect that the error is O(h^2) and if it is not symmetric that it is O(h) ? @LutzL
Also does this imply: $$\left| \frac{f(x+3h)-3f(x+2h)+3f(x+h)-f(x)}{h^3}-f'''(x) \right| \leq \frac{22}{4} h ||f^{(4)}||_{\infty}$$
that the difference quotient is an approximation of f''' or do we have to say that it tends to 0 while h->0 ? @LutzL
by the extended mean value theorem

[ f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h) - 2h^3·f'''(x) ] / [h^5]
=
[ 8f'''(x+2s)-2f'''(x+s)-2f'''(x-s) + 8f'''(x-2s) - 12 f'''(x) ] / [ 60 s^2]
=
[ [f'''(x+2s)-2f'''(x+s)+f'''(x)] + [f'''(x)-2f'''(x-s)+f'''(x-2s)] + 7[f'''(x+2s)-2f'''(x) +f'''(x-2s)] ] / [ 60 s^2]
=
[ f^{(5)}(x+s+t_1) + 28 f^{(5)}(x+2t_2) + f^{(5)}(x-s+t_3) ] / [ 60 s^2]

with t_{123} \in [-s,s] and s\in [0,h]
last equation line should be

=
[ f^{(5)}(x+s+t_1) + 28 f^{(5)}(x+2t_2) + f^{(5)}(x-s+t_3) ] / [ 60 ]
Both formulas are approximations for f'''(x) (and f'''(x-h) etc.), the first with error O(h), the second with error O(h²).
Yes, with, in that notation, f(a)=0=g(a), f the difference minus the differential, g(h)=h^5, a=0, b=h
20:19
Instead of using the extended mean value theorem can't we just use Taylor expansion?
For the first difference quotient if we would expand till the fifth term, we wouldn't get something that could help us to find the right bound, right? @LutzL
20:38
Yes, the problem is always to assemble the remainder term with the smallest possible coefficient. Taylor for each term separately is too rough for that.
Of course to just get the error order with any coefficient, Taylor is sufficient.
So having done Taylor for both can we say that:

We notice that the order of accuracy of $\frac{f(x+3h)-3f(x+2h)+3f(x+h)-f(x)}{h^3}$ is O(h) and the order of accuracy of $ \frac{f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h)}{2h^3}$ is $O(h^2)$ and thus the second difference quotient is a better approximation.
@LutzL Or could we explain it better?
20:53
Also do you maybe know if having shown that $\left| \frac{f(x+3h)-3f(x+2h)+3f(x+h)-f(x)}{h^3}-f'''(x) \right| \leq \frac{22}{4} h ||f^{(4)}||_{\infty}$
we have shown that $\frac{f(x+3h)-3f(x+2h)+3f(x+h)-f(x)}{h^3}$ is an approximation of $f'''(x)$?
@LutzL Or do we have to do also something else?
Both formulas are approximations for f'''(x) (and f'''(x-h) etc.), the first with error O(h), the second with error O(h²). There is nothing else to prove, the bounding inequalities already contain all this information.
21:18
I found that $\left| \frac{f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h)}{2h^3}-f'''(x) \right| \leq \frac{17}{60} h^2 ||f^{(5)}||_{\infty}$ @LutzL
Yes, that follows from the Taylor formulas. One can get the better coefficient of (16-1)/60=1/4 instead by following my mean-value computation. One can cast that computation in terms of the Taylor formula of g(h)=f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h) where g(0)=g'(0)=g''(0)=0=g^{(2k)}(0)
21:57
@LutzL Great!!! Thanks a lot!!!
Could I maybe also ask you something else? @LutzL
Given the problem $$-u''(x)+q(x)u(x)=f(x), 0 \leq x \leq 1, \\ u'(0)=u(0), \ \ u(1)=0$$ where $f,g$ are continuous functions on $[0,1]$ with $q(x) \geq q_0>0, x \in [0,1]$. Let $U_j$ be the approximations of $u(x_j)$ at the points $x_j=jh, j=0, 1, \dots , N+1$, where $(N+1)h=1$, that gives the finite difference method $$-\frac{1}{h^2}\left (U_{j-1}-2U_j+U_{j+1}\right )+q(x_j)U_j=f(x_j), \ \ 1 \leq j \leq N \\ \frac{1}{h}(U_1-U_0)-U_0=\frac{1}{2}h\left (q(x_0)U_0-f(x_0)\right )$$ where $U_{N+1}=0$.
22:36
I'd guess that you should use a 3 point formula to have the required local approximation order.
What 3 point formula could we use? @LutzL
 
1 hour later…
23:59
The formula from several days ago, with coefficients [3, -4, 1].

  last day (18 days later) »