Simplifictaion: Taylor series expansion $U(x,t)$ about point $\bigg(x+\frac{1}{2}h , t\bigg)$

198 Views Asked by At

I am required to expand the $\partial_x^2U(x,y)$ in terms of a finite difference expression about the point (x+\frac{h}{2},t) instead of the usual $(x,t)$ point. This means one will get: $$ \partial_x^2U(x,t) = \frac{1}{2h^2}\left[ U\bigg(x+\frac{3h}{2},t\bigg) - 2U\bigg(x+\frac{h}{2},t\bigg) + U\bigg(x-\frac{h}{2},t \bigg) \right] $$ Now I am fine with expanding each of these 3 terms....but am lazy and would like to seek a better alternative. I've seen books do the following: $$U\bigg( x+\frac{h}{2},t\bigg) = \frac{1}{2}\bigg[ U(x+h,t) + U(x,t) \bigg] $$ The above pretty cool (if true) as one would then be able to write the finite difference expression as: $$ \partial_x^2U(x,t) = \frac{1}{4h^2}\bigg[ U(x+2h,t) - U(x+h,t) - U(x,t) + U(x-h,t)\bigg] $$ by simply noting $$ U\bigg(x+\frac{3h}{2},t\bigg) - 2U\bigg(x+\frac{h}{2},t\bigg) + U\bigg(x-\frac{h}{2},t \bigg) = \frac{1}{2}\bigg( U(x+2h,t) - U(x+h,t) - U(x,t) + U(x-h,t) \bigg) $$ Does this actually work....I don't think so. I wrote a taylor series expansion script using Sympy and it proceeds to show the expansions are note equal. Why is this so? Have I made a mistake? Please help me find the mistake.

I really don't quite fancy expanding the original expression by hand and it would be great if an easier version as the one I proposed exists.

1

There are 1 best solutions below

0
On BEST ANSWER

The equality

$$ U(x + \frac h2, t) = \frac 12 (U(x+h,t)+U(x,t)) $$

does not hold in general, it is just an approximation. You are computing $U(x+\frac h2,t)$ as the average of the values of $U$ in two neighboring points. You can deduce the error introduced by this approximation and incorporate it in the global error but, as you noted, the expressions will not be the same.