## Local truncation error is approximately proportional to square of step size in Euler’s method

Question: Show that the local truncation error in Euler’s method is proportional to the square of the step size.

This post is brought to you by

• Holistic Numerical Methods Open Course Ware:
• the textbooks on
• the Massive Open Online Course (MOOCs) available at

## Example: Solving a first order ODE by Laplace transforms

I have a audiovisual digital lecture on YouTube that shows the use of Euler’s method to solve a first order ordinary differential equation (ODE).  To show the accuracy of Euler’s method,  I compare the approximate answer to the exact answer.  A YouTube viewer asked me: How did I get the exact answer?

In this blog, I use the Laplace transform technique to find the exact answer to the ODE.  In a previous blog, I showed how to find the exact answer to the ODE by the classicial solution technique.

The pdf file of the solution is also available.

## Classical Solution Technique to Solve a First Order ODE

I have a audiovisual digital lecture on YouTube that shows the use of Euler’s method to solve a first order ordinary differential equation (ODE).  To show the accuracy of Euler’s method,  I compare the approximate answer to the exact answer.  A YouTube viewer asked me: How did I get the exact answer?

In this blog, I use the classical solution technique to find the exact answer to the ODE.  In a previous blog, I showed how to find the exact answer to the ODE by the integrating factor method.

The pdf file of the solution is also available.

## Example: Solving First Order Linear ODE by Integrating Factor

I have a audiovisual digital lecture on YouTube that shows the use of Euler’s method to solve a first order ordinary differential equation (ODE).  To show the accuracy of Euler’s method,  I compare the approximate answer to the exact answer.  A YouTube viewer asked me: How did I get the exact answer?

In this blog, I use the integrating factor method to find the exact answer, because that is the method the viewer was using to solve the ODE exactly.  So here it is and in two future blogs, I will show the same example being solved by 1) Laplace transforms and 2) the classical (complementary + particular) solution techniques.

The pdf file of the solution is also available.

This post is brought to you by

## Comparing Runge-Kutta 2nd order methods

Many a times, students ask me

Which of the Runge-Kutta 2nd order methods gives the most accurate answer to solving a first order ODE?

dy/dx=f(x,y), y(0)=y0

There is no direct answer, although Ralston’s method gives a minimum bound for the truncation error (Ralston, A., Runge-Kutta Methods with Minimum Error Bounds, Match. Compu., Vol 16, page 431, 1962).

They also ask me if using the first three terms of the Taylor series would give a more accurate answer if we calculate $f^{\prime}(x,y)$ symbolically.

The equations for the four methods are given below

Here is the comparison graph for

dy/dx=sin(5*x)-0.4*y, y(0)=5

with

step size of h=1.1

and

step size of h=0.55

This post is brought to you by Holistic Numerical Methods: Numerical Methods for the STEM undergraduate at http://numericalmethods.eng.usf.edu