# When to use Order Notation? (Error in Finite differences)

1. Dec 8, 2011

### Silversonic

1. The problem statement, all variables and given/known data

I'm having a hard time understanding when we approximate higher order powers by order notation, especially when it comes to working out the Truncation Error for Finite Differences.

My notes say "We use the order notation O($h^{n}$) and write X(h) = O($h^{n}$) if there exists a constant K such that |X(h)| < $Kh^{n}$.

But, for example, my notes say to approximate derivatives $u'(x_{j})$ at a grid point $x = x_{j}$ we write;

$u'(x_{j})$ ~= $\frac{1}{h}\delta u(x_{j})$

where $\delta u(x_{j})$ = $u(x_{j} + h/2) - u(x_{j} - h/2)$

Then my notes say the error in approximating $u'(x_{j})$ by $\frac{1}{h}\delta u(x_{j})$ is;

$e_{j} = u'(x_{j}) - \frac{1}{h}\delta u(x_{j}) = O(h^{2})$

Fair enough, I think, but then it proves this by taylor expanding $u(x_{j} + h/2)$ and $u(x_{j} - h/2)$, where

(This taylor expansion works on the assumption u(x) is smooth, i.e. derivatives of any order exist).

$u(x_{j} + h/2) = u(x_{j}) + \frac{h}{2}u'(x_{j}) + \frac{h^{2}}{8}u''(x_{j}) + O(h^{3})$

Why can we use the Order notation of 3 here? We don't even know what u(x) is, so how can we make the assumption that there is some K such that $|O(h^{3})| < Kh^{3}$?

2. Dec 9, 2011

### HallsofIvy

Whatever u is, its derivatives, evaluated at $x_j$ will be numbers. So the remaining terms in the Taylor series will be number multiplied by powers of x equal to or larger than $x^3$. For x< 1, the largest term will be the $x^3$ term itself. That's why we can say "$O(x^3$".

3. Dec 9, 2011

### Silversonic

Thanks, but the whole thing is being taylor expanded in h. h is definitely less than or equal to one. I agree that u($x_j$) is a number, but so is u'($x_j$) and u''($x_j$) and so on and so on. But we don't actually know the value of u, u', u'', u''', u'''' and so on at any of the $x_j$. It could be that $\frac{h^{3}}{24}u'''(x_{j})$ is much greater than $\frac{h}{2}u'(x_{j})$ at the point $x_{j}$ because, even though we know that $\frac{h^{3}}{24}$ is much smaller than $\frac{h}{2}$, we have no idea of the values u'($x_{j}$) and u'''($x_{j}$) are at any grid point $x_{j}$. So why can we assume?