Euler’s Method
students, imagine trying to predict where a moving car will be one second from now when you only know its current speed 🚗. If the road is smooth and the changes are small, you can make a good guess by taking a tiny step forward and repeating the process again and again. That is the basic idea behind Euler’s method, one of the first and most important numerical methods for solving ordinary differential equations (ODEs).
In this lesson, you will learn how Euler’s method works, why it is useful, and how it fits into the broader study of numerical solutions of ODEs. By the end, you should be able to:
- Explain the main idea and terminology of Euler’s method.
- Use Euler’s method to approximate solutions of an ODE.
- Understand local error and global error in simple terms.
- Describe why step size matters for accuracy and stability.
- Connect Euler’s method to the larger topic of Numerical Solutions of ODEs I.
What Euler’s Method Is
Euler’s method is a numerical procedure for approximating the solution of a first-order ODE of the form
$$
$\frac{dy}{dx} = f(x,y),$
$$
with an initial condition such as
$$
$y(x_0)=y_0.$
$$
The exact solution, if it exists, may be hard or impossible to find in a simple formula. Euler’s method avoids solving the equation exactly. Instead, it builds an approximate solution step by step.
The key idea is to use the slope given by the differential equation. At the point $\left(x_n,y_n\right)$, the slope is $f\left(x_n,y_n\right)$. If the graph is locally close to a straight line, then a short move in $x$ gives a predicted new value of $y$:
$$
$y_{n+1}=y_n+h\,f(x_n,y_n),$
$$
where $h$ is the step size and
$$
$x_{n+1}=x_n+h.$
$$
This formula is the heart of Euler’s method. It uses the tangent line at the current point to estimate the next point 📈.
How the Method Works Step by Step
Let’s break the method into a repeated pattern.
- Start with the known initial point $\left(x_0,y_0\right)$.
- Choose a step size $h$.
- Compute the slope at the current point using $f\left(x_n,y_n\right)$.
- Estimate the next value with
$$
$y_{n+1}=y_n+h\,f(x_n,y_n).$
$$
- Increase the $x$-value by $h$:
$$
$x_{n+1}=x_n+h.$
$$
- Repeat until you reach the desired $x$-value.
Because the method uses only the current point to predict the next one, it is very simple to implement by hand, in a calculator, or in software.
A worked example
Suppose we want to approximate the solution of
$$
$\frac{dy}{dx}=x+y,$
$$
with initial condition
$$
$y(0)=1,$
$$
using step size $h=0.1$.
We begin at
$$
$x_0=0,\quad y_0=1.$
$$
The slope at the starting point is
$$
$f(x_0,y_0)=0+1=1.$
$$
So the next estimate is
$$
$y_1=y_0+h\,f(x_0,y_0)=1+0.1(1)=1.1.$
$$
Also,
$$
$x_1=0.1.$
$$
Now use the new point $\left(0.1,1.1\right)$:
$$
$f(x_1,y_1)=0.1+1.1=1.2.$
$$
Then
$$
$y_2=y_1+h\,f(x_1,y_1)=1.1+0.1(1.2)=1.22,$
$$
and
$$
$x_2=0.2.$
$$
This process continues. Each step is only an approximation, but many small steps can give a reasonable numerical picture of the solution.
Why Step Size Matters
The step size $h$ controls how far Euler’s method moves in each step. This is one of the most important ideas in numerical analysis.
- A smaller $h$ usually gives better accuracy because the tangent line is used over a shorter interval.
- A larger $h$ gives a faster but less accurate approximation.
To understand this, think about walking along a curved path and trying to estimate it using short straight pieces 🧭. Shorter pieces follow the curve more closely. Longer pieces can miss important bends.
For Euler’s method, the error in one step is related to how much the true solution curves between $x_n$ and $x_{n+1}$. If the solution bends quickly, a large step may give a poor estimate.
However, using very small step sizes also has a cost. More steps mean more calculations, and in computer work, that can increase runtime. Numerical analysis often involves balancing accuracy and efficiency.
Local Error and Global Error
Euler’s method is simple, but it is not exact. That means error is unavoidable. Two important types of error are local error and global error.
Local error
Local error measures the error made in one step, assuming the starting value for that step is exact. In other words, it asks: if $y_n$ were perfect, how far off would $y_{n+1}$ be after one Euler step?
Euler’s method uses a linear approximation, so the local truncation error is typically proportional to
$$
$h^2.$
$$
That means when $h$ gets smaller, the error from a single step decreases quickly.
Global error
Global error is the total error after many steps. It accumulates the errors from all previous steps, so it is larger than the local error from just one step.
For Euler’s method, the global error is typically proportional to
$$
h.
$$
This tells us that if the step size is cut in half, the overall error is usually reduced by about half, assuming the solution behaves nicely.
Why this distinction matters
Suppose students uses Euler’s method for a long interval, such as from $x=0$ to $x=10$. Even a small mistake at one step can carry into the next step, because every new value depends on the previous one. That is why the global error matters more for final accuracy.
Stability Considerations
Accuracy is not the only issue. A method can also be unstable. Stability refers to whether small errors stay small or grow wildly as the steps continue.
A classic test problem is
$$
$\frac{dy}{dx}=\lambda y,$
$$
where $\lambda$ is a constant. Euler’s method gives
$$
$y_{n+1}=(1+h\lambda)y_n.$
$$
This formula shows how the size of the factor $1+h\lambda$ affects behavior.
- If repeated multiplication makes values shrink when the true solution should shrink, the method is behaving stably.
- If errors grow too much, the method may become unstable.
For example, when $\lambda<0$, the exact solution usually decays toward zero. But if $h$ is too large, Euler’s method can produce values that oscillate or even grow instead of decaying. That is a warning sign that the step size is too big for the problem.
This is why numerical analysts pay attention to stability regions. A method may work well for one equation and fail for another if the step size is not chosen carefully.
Connecting Euler’s Method to the Bigger Topic
Euler’s method is often the first method studied in numerical solutions of ODEs because it makes the central ideas easy to see:
- differential equations describe rates of change,
- numerical methods estimate values step by step,
- step size affects accuracy,
- error accumulates over time,
- stability determines whether approximations behave sensibly.
Even though Euler’s method is not the most accurate method, it is extremely important as a foundation. More advanced methods, such as improved Euler methods and Runge–Kutta methods, build on the same general idea of using slope information to move forward. Euler’s method is the simplest member of this family.
Real-world situations often use the same logic. For example, if a population changes according to a rate rule, or if the temperature of an object changes over time, a numerical method can estimate the future behavior when a neat formula is unavailable 🌍.
Conclusion
Euler’s method is a straightforward way to approximate solutions of first-order ODEs. It works by starting from an initial value and moving forward using the slope given by the differential equation. Its simplicity makes it a key first step in Numerical Solutions of ODEs I.
The most important ideas to remember are the update formula
$$
$y_{n+1}=y_n+h\,f(x_n,y_n),$
$$
the role of the step size $h$, the difference between local and global error, and the importance of stability. students, understanding Euler’s method gives you a strong foundation for learning more advanced numerical methods later.
Study Notes
- Euler’s method approximates the solution of a first-order ODE using slope information at the current point.
- The main formulas are
$$
x_{n+1}=x_n+h$$
and
$$
y_{n+1}=y_n+h\,f(x_n,y_n).$$
- It uses the tangent line at a point to estimate the next point.
- Smaller step sizes usually improve accuracy but require more computations.
- Local error is the error from one step, assuming the starting value is exact.
- Global error is the total error after many steps.
- For Euler’s method, local error is typically proportional to $h^2$ and global error is typically proportional to $h$.
- Stability describes whether errors stay controlled or grow too large during repeated steps.
- For the test equation $\frac{dy}{dx}=\lambda y$, Euler’s method gives $y_{n+1}=(1+h\lambda)y_n$.
- Euler’s method is the simplest numerical method for ODEs and a foundation for more advanced methods.
