Learn Without Walls
← Lesson 3 Lesson 4 of 4 Practice Problems →

Lesson 4: Euler's Method for Numerical Approximation

Estimated time: 30-35 minutes

Learning Objectives

By the end of this lesson, you will be able to:

Why Numerical Methods?

Most differential equations that arise in practice cannot be solved analytically. Even a simple-looking equation like dy/dx = e-x² + y has no closed-form solution. Numerical methods let us compute approximate values of the solution at discrete points.

Euler's method is the simplest numerical method. While more sophisticated methods (Runge-Kutta, etc.) are used in practice, Euler's method beautifully illustrates the core idea that all numerical ODE solvers share.

The Euler Iteration

Euler's Method: Given the IVP dy/dx = f(x, y), y(x0) = y0, and a step size h:

xn+1 = xn + h

yn+1 = yn + h · f(xn, yn)

Starting from the known point (x0, y0), each step follows the tangent line for a distance h to produce the next approximate point.

Geometric Interpretation

At each step, Euler's method approximates the true solution curve with a straight line (the tangent). You walk along the tangent for a short distance h, arrive at a new point, recalculate the slope, and repeat. Smaller h means shorter tangent segments and a better approximation of the curve.

Worked Examples

Example 1: Euler's Method with h = 0.1

Approximate y(0.3) for the IVP: dy/dx = x + y,   y(0) = 1, using h = 0.1.

Solution: We need 3 steps to go from x = 0 to x = 0.3.

nxnynf(xn,yn) = xn+ynh · f
0010 + 1 = 10.1
10.11.10.1 + 1.1 = 1.20.12
20.21.220.2 + 1.22 = 1.420.142
30.31.362----

Euler approximation: y(0.3) ≈ 1.362.

The exact solution is y = 2ex - x - 1, giving y(0.3) = 2e0.3 - 0.3 - 1 ≈ 1.3997. The error is about 0.038, or roughly 2.7%.

Example 2: Euler's Method with h = 0.5

Approximate y(1) for the IVP: dy/dx = y,   y(0) = 1, using h = 0.5.

Solution: We need 2 steps.

nxnynf = ynh · f
00110.5
10.51.51.50.75
21.02.25----

Exact: y(1) = e1 ≈ 2.7183. Euler gives 2.25. Error ≈ 0.47 (17%). The large step size produces a poor approximation.

With h = 0.1 (10 steps), Euler gives y(1) ≈ 2.5937, much closer. With h = 0.01 (100 steps), y(1) ≈ 2.7048. Smaller h gives better accuracy.

Example 3: More Steps for Better Accuracy

For dy/dx = -2xy, y(0) = 1, approximate y(0.2) using h = 0.1 (2 steps).

Solution:

Step 0: (x0, y0) = (0, 1). f(0, 1) = -2(0)(1) = 0.

y1 = 1 + 0.1(0) = 1.   x1 = 0.1.

Step 1: f(0.1, 1) = -2(0.1)(1) = -0.2.

y2 = 1 + 0.1(-0.2) = 1 - 0.02 = 0.98.   x2 = 0.2.

Euler approximation: y(0.2) ≈ 0.98.

The exact solution is y = e-x², giving y(0.2) = e-0.04 ≈ 0.9608. The Euler estimate is close.

Error and Step Size

Euler's method has a local truncation error of order O(h²) per step. Over a fixed interval, the accumulated global error is O(h). This means:

Check Your Understanding

1. Use Euler's method with h = 0.1 to take ONE step for dy/dx = 3x², y(1) = 2. Find y1.

Answer: f(1, 2) = 3(1)² = 3. y1 = 2 + 0.1(3) = 2.3. x1 = 1.1.

2. For dy/dx = y, y(0) = 1, with h = 1 (one step), what is the Euler estimate for y(1)?

Answer: y1 = 1 + 1 · f(0,1) = 1 + 1(1) = 2. The exact answer is e ≈ 2.718, so this single giant step is quite inaccurate.

3. If you halve the step size in Euler's method, roughly by what factor does the global error decrease?

Answer: The global error is O(h), so halving h roughly halves the error. (It takes twice as many steps, but each step is more accurate.)

4. Use Euler with h = 0.5: dy/dx = -y, y(0) = 4. Find y(1) in 2 steps.

Answer: Step 0: f(0,4) = -4. y1 = 4 + 0.5(-4) = 2. Step 1: f(0.5, 2) = -2. y2 = 2 + 0.5(-2) = 1. (Exact: y(1) = 4e-1 ≈ 1.472.)

5. What is the geometric interpretation of one Euler step?

Answer: One Euler step follows the tangent line to the solution curve at the current point for a horizontal distance h. The new y-value is the tangent-line approximation evaluated at x + h.

Key Takeaways

Module 1 Complete!

Practice Problems

Test your skills on all Module 1 topics with 10 practice problems.

Practice Problems

Module Quiz

Ready for the quiz? 10 questions covering the entire module.

Take Quiz

Study Materials

Review with the study guide and quick reference card.