• Support PF! Buy your school textbooks, materials and every day products Here!

Numerical methods

  • #1
1,444
2
given five points of a function one can approximate the derivate of the function at some point. The standard five point formula is

Derive an O(h^4) five point formula to approximate f'(x0) that uses
[itex] f(x_{0}-h), f(x_{0}), f(x_{0} +h),f(x_{0} +2h),f(x_{0} +3h) [/itex].

(Hint:Consider the expression [itex] Af(x_{0} -h) + Bf(x_{0} +h) + Cf(x_{0} + 2h) + Df(x_{0} + 3h) [/itex]. Expand in fourth Taylor polynomials and choose A,B,C and D appropriately.)

im not sure how they expect me to expand that polynomial they gave because it would be a total mess!
how would one go about deriving this formula?
my idea is using taylor polynomials
[tex] f'(x_{0}) = \frac{f(x_{0}) - f(x_{0} -h)}{h} + \frac{f''(x_{0}}{2} h - \frac{f^{(3)}(x_{0})}{6} h^2 + \frac{f^{(4)}(x_{0})}{24} h^3 + O(h^4) [/tex]
but im not sure how ot proceed
what to subsitute... i know its gonna take some algebraic gymnastics to get the answer...
 
Last edited:

Answers and Replies

  • #2
StatusX
Homework Helper
2,564
1
I've never done this type of problem before, but the way I'd approach it, given the hint you have, would be to write:

[tex]\begin{align*}
A f(x_0&-h)+B f(x_0+h)+ C f(x_0+2h) + D f(x_0+3h) = \\
& f(x_0) (A+B+C+D) +\\
& h f'(x_0) (-A+B+2C+3D)+\\
& \frac{1}{2}h^2 f''(x_0) (A+B+4C+9D)+...
\end{align*}[/tex]

Up to the fourth order, and then solve for a set of (A,B,C,D) that makes all the coefficients on the right side vanish except for the coefficient of f'(x_0). This will give you an O(h^4) approximation of f'(x_0).
 
Last edited:
  • #3
1,444
2
hmmm... seems there is no one who is in numerical methods on this site... strange that .. or maybe they just dont like to help on homework?
well anyway... did some googling and got these equations
1)
[tex] f'(x) = \frac{f(x_{0}) - f((x_{0}-h)}{h} + \frac{f''(x_{0}}{2}h - \frac{f^{(3)}(x_{0})}{6}h^2 + \frac{f^{(4)}(x_{0})}{24}h^3 +O(h^4) [/tex]
replace h with -h
2) [tex] f'(x) = \frac{-f(x_{0}) + f((x_{0}+h)}{h} - \frac{f''(x_{0})}{2}h - \frac{f^{(3)}(x_{0})}{6}h^2 - \frac{f^{(4)}(x_{0})}{24}h^3 +O(h^4) [/tex]
in 2 replace h with 2h
3) [tex] f'(x) = \frac{-f(x_{0}) + f(x_{0}+2h)}{2h} - \frac{f''(x_{0})}{2}2h - \frac{f^{(3)}(x_{0})}{3}2h^2 - \frac{f^{(4)}(x_{0})}{3}h^3 +O(h^4) [/tex]
so now the aim is simply to eliminate the second, third nad fourth order derivatives
after a lot of fun (ya right)
[tex] f'(x_{0}) = \frac{ -2f(x_{0} -h) + 6f(x_{0} +h) -11f(x_{0}) - f(x_{0}+2h)}{2h} + \frac{f^{(4)}(x_{0})}{4}h^3 + O(h^4} [/tex]
all i need to do now is get rid of the fourth order derivative
im not sure what to subtract from this equation... any ideas?
 
Last edited:

Related Threads for: Numerical methods

  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
2
Views
5K
  • Last Post
Replies
12
Views
2K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
0
Views
1K
Replies
1
Views
1K
  • Last Post
Replies
3
Views
2K
Replies
1
Views
1K
Top