Truncation error in solving Differential Equation

188 Views Asked by At

Tomorrow I've got a test for my Numerical Analysis course and there's this one type of question I cant seem to understand. An example:

We have the Differential Equation $u'(t) = f(u(t))$ and we're using the following method to solve it: $$\tilde u_{n+1} = \tilde u_n + \frac{h}{2}(f(\tilde u_n) + f(\tilde u_n+ \frac{2h}{3}f(\tilde u_n)))$$

Show that the truncation error is given by $Ah^2 + \mathcal{O}(h^3)$, give an expression for A.

In the provided answer steps that I found they go through a couple steps. They start with a taylor expression for $u(t+h)$: $$ u(t + h) = u(t) + hu'(t) + \frac{h^2}{2}u''(t) + \frac{h^3}{6}u'''(\tau).$$ To rewriting the DE using the Taylor expression (I dont get how they rewrote $u''(t)$):

$$ u(t + h) = u(t) + hf(u(t)) + \frac{h^2}{2}f'(u(t))f(u(t)) + \frac{h^3}{6}u'''(\tau).$$

And then they combine the method and this expression to get (no idea how this step works):

$$u_{n+1} = u_n + \frac{h}{2}(f(u_n) + f(u_n) + \frac{2h}{3}f'(u_n)f(u_n) + \mathcal{O}(h^2))$$

Any help with understanding these steps would be greaty appreciated, thanks in advance!!