Derive forward Euler method for two-variable function

6k Views Asked by At

I need to derive the forward Euler method for solving ODEs and I would like some comments on what I have so far; overdot denote the time derivative: $\dot x \overset{def}{=} dx/dt$.

Say we have $\dot x = f(t, x)$ and want to approximate the solution $x(t)$.

The initial conditions are $x(t_0, x_0)$ and the approximate solution $x_1$ after one time $h$ step is sought, $x_1 \approx x(t_0 + h, x_0)$. $x$ is expanded as a Taylor series in $t$ around $(t_0, x_0)$:

$$ x(t_0 + h, x_0) = x(t_0, x_0) + \dot x(t_0, x_0)h + \frac{1}{2} \ddot x(t_0, x_0)h^2 + \dots\\ % = x(t_0, x_0) + f(t_0, x_0)h + \mathcal{O}(h^2). $$

Discarding anything of order $\mathcal{O}(h^2)$ or higher we are left with the Euler solution:

$$ x_1 = x(t_0, x_0) + f(t_0, x_0)h. $$

It's pretty close to the derivation found on wikipedia; however, wikipedia does not include $x_0$ in the Taylor expansion.

Any comments - is the above correct?

EDIT: typo.

2

There are 2 best solutions below

3
On BEST ANSWER

A different yet very simple and easy derivation of Euler's method is to consider the following $y'=f(x,y)$ (I hope you don't mind me using $x$ and $y$, the diagram for the graphical interpretation is in terms of $x$ and $y$, sorry.) with $y(x_0)=y_0$

If you imagine the graph of $y=y(x)$ (the solution) then $y'=f(x,y)$ is the slope of the tangent to the graph at the point $(x,y)$. The graph also passes through the point $(x_0,y_0)$ from the initial conditions, combining this graphically we get:

As an approximation to $y_1=y(x_1)$, we take $Y_1$ where $(x_1,Y_1)$ is a point on the tangent, using the equation for a straight line $y-y_0=m(x-x_0)$ and substituting the point $(x_1,Y_1)$ gives $$ Y_1=y_0+f(x_0,y_0)(x_1-x_0) $$ Using $h=(x_1-x_0)$ we arrive at the iteration scheme for Euler's method $$ Y_{n+1}=y_n+hf(x_n,y_n) $$ Sorry that this method went off on a bit of a tangent (pardon the pun) to the original problem but I just think it is a great way to derive Euler's method with minimal calculus needed.

0
On

The notation $x(t;t_0,x_0)$ (or similar, for instance $\phi(t;t_0,x_0)$ to use some greek) is used for the flow of the differential equation, i.e., the most general form of a solution.

In an initial value problem, the initial point $(t_0,x_0)$ is fixed, so there is little use in repeating the parameter in the notation of the solution function.

However, in the analysis of the Euler method, one uses all solutions $x(t;t_k,x_k)$ to the initial value problems starting in the iteration point. The long notation then is useful when one estimates how big the gaps are between neighboring trajectories, how the evolution of the gaps is bounded in time and how the single gaps sum up to the global error of the method.