0

I have a homework question that I don't know how to answer. It goes like this:

Give complete details on the derivation of the five-point centered approximation to the second derivative of a function $f(x)$ for the example below. Also, give complete details on using Taylor expansions to determine the leading error term, as given in the example below.

With $n = 4$, $m = 2$, and $x = x_2$, and reference interval $x_0 = -2h$, $x_1 = -h$, $x_2 = 0$, $x_3 = h$, $x_4 = 2h$, we have $$f''(x_2) \cong \sum_{i=0}^4 f_i l''_i(x_2)$$ Here $$l_0(x) = \frac{(x - x_1)(x - x_2)(x - x_3)(x - x_4)}{(x_0 - x_1)(x_0 - x_2)(x_0 - x_3)(x_0 - x_4)}$$ $$=\frac{(x - x_1)(x - x_2)(x - x_3)(x - x_4)}{24h^4}$$

Differentiating, and setting $x$ equal to $x_2$, we find $$l''_0(x_2)=\frac{-1}{12h^2}$$ Similarly $$l''_1(x_2)=\frac{16}{12h^2}, l''_2(x_2)=\frac{-30}{12h^2}, l''_3(x_2)=\frac{16}{12h^2}, l''_4(x_2)=\frac{-1}{12h^2}$$

Hence we have the five point finite difference approximation $$f''(x_2)\cong\frac{-f_0+16f_1-30f_2+16f_3-f_4}{12h^2}$$

By Taylor expansion, one can show that the leading error term is $$\frac{h^4f^{(6)}(x_2)}{90}$$

I have no clue how to answer this question. Some help will be much appreciated. Thank you!

Edit: To be clear, I just don't understand what they mean by "give complete details".

David_T
  • 45
  • Find $a,b,c,d,e,n$ so that $\frac{af(x-2h)+bf(x-h)+cf(x)+df(x+h)+ef(x+2h)}{h^n}$ is as close to $f''(x)$ as possible. More precisely, so that it is equal to $f''(x)+O(h^N)$ for as large an $N$ as possible, if $f$ is assumed to be smooth at $x$. – Ian Mar 24 '16 at 20:10
  • Thing is, they don't give us a function. It just says "give complete details". – David_T Mar 24 '16 at 20:13
  • You don't need a particular $f$; the constants will be independent of $f$ as long as $f$ is sufficiently smooth. The point is that you Taylor expand each of these and try to choose the constants to make the $f(x)$ terms add to zero, the $hf'(x)$ terms add to zero, the $h^2f''(x)$ terms add to just $h^2f''(x)$ (so $n$ will need to be $2$). That's three conditions for the five constants: you get two more by requiring the $h^3f'''(x)$ terms and $h^4f''''(x)$ terms to also be zero. This gives five equations in five unknowns. – Ian Mar 24 '16 at 20:14
  • So when it says "give complete details", do I just have to explain what to do? – David_T Mar 24 '16 at 20:17
  • (Cont.) The error term is the remainder from truncating from replacing $f$ with a Taylor polynomial of degree $5$ in each term. – Ian Mar 24 '16 at 20:17
  • I think they mean for you to actually do it, not just explain the procedure. Matlab might be helpful for solving the system. – Ian Mar 24 '16 at 20:17
  • That's going to be a problem haha. But thank you for your input! – David_T Mar 24 '16 at 20:18
  • You can simplify due to symmetry, $e=a$, $d=b$, $2a+2b+c=0$. The last is the first Taylor condition, which follow from constant functions having zero derivatives. – Lutz Lehmann Mar 24 '16 at 20:54
  • I actually misread the question. It says to give details on an example given in the notes. I will post the edit ASAP. – David_T Mar 25 '16 at 14:40
  • I added the example in the edit. I am even more confused and lost than before. – David_T Mar 25 '16 at 15:03
  • They are doing the computation by considering what the coefficients should be in order to get the exactly correct second derivative of the Lagrange interpolating polynomial of $f$ at the given nodes. This approach is great for identifying what the coefficients should be, but it requires a slightly complicated theorem about error for polynomial interpolation in order to actually get the error estimate you wrote. – Ian Mar 25 '16 at 15:16
  • So what are they asking me to do exactly? The teacher isn't great, the class is hard and his notes are horrible. I have no clue what to do for this question. I've been reading it for 2 days and looking at all the answers on this page and I get nowhere. – David_T Mar 25 '16 at 15:18
  • Do you know how to find the Lagrange interpolating polynomial? If so, find it for $f$ at those five nodes, differentiate it twice and plug in (using their notation) $x_2$. What you should get should now depend only on the five numbers $f_i=f(x_i)$ and $h$, and will be your formula for the finite difference approximation. As I said though, the error estimate is not as easy to come by. – Ian Mar 25 '16 at 15:24
  • Alright, I will try that. Thank you so much for your help! – David_T Mar 25 '16 at 15:24
  • So i basically have to find $l_1$, $l_2$, $l_3$ and $l_4$ since $l_0$ is already given to us? But, they already give us the other 4 polynomial. – David_T Mar 25 '16 at 15:29
  • I am still lost unfortunately – David_T Mar 25 '16 at 16:06

0 Answers0