CALCULUS 2 • DIFFERENTIAL EQUATIONS

Euler's Method — Approximating Solutions Using Euler's Method

A foundational numerical technique for stepping through differential equations when exact solutions are out of reach.

Historical Context & Motivation

Differential equations have been central to the mathematical sciences since Newton and Leibniz first articulated the calculus in the late seventeenth century. Many physical phenomena—planetary motion, fluid flow, population dynamics—are most naturally described by equations relating a function to its derivatives. Yet even in the earliest decades of calculus, mathematicians recognized that most differential equations cannot be solved in closed form. This gap between formulation and solution motivated the search for systematic numerical approximation techniques, of which Euler's method stands as the simplest and most historically significant.

1687
Newton's Principia
Isaac Newton publishes the Principia Mathematica, formulating laws of motion as differential equations and solving them geometrically. The need for general solution methods becomes apparent.
1768
Euler's Institutionum Calculi Integralis
Leonhard Euler publishes his comprehensive treatise on integral calculus, introducing the iterative tangent-line stepping procedure now known as Euler's method. He treats it as a practical tool for constructing approximate solution curves.
1895
Runge–Kutta Methods Emerge
Carl Runge publishes higher-order numerical schemes that dramatically improve accuracy over Euler's basic approach. Wilhelm Kutta refines these in 1901, establishing the family of Runge–Kutta methods that remain industry standards today.
1940s–60s
Digital Computing Revolution
Electronic computers transform numerical methods from pencil-and-paper curiosities into practical engineering tools. Euler's method, though superseded by more accurate schemes, remains the pedagogical foundation for understanding all numerical ODE solvers.
Present
Modern Adaptive Solvers
Software packages like MATLAB's ode45 use adaptive step-size Runge–Kutta methods, but every student of differential equations still learns Euler's method first—its conceptual transparency makes it the gateway to the entire field of numerical analysis.

The central question that Euler's method addresses is deceptively simple: given a first-order initial value problem dy/dx = f(x, y) with y(x₀) = y₀, how can we construct an approximate table of values for y(x) at discrete points when no analytic formula for y is available? Euler's answer—follow the tangent line for a small step, then recalculate the slope—remains the conceptual DNA of every modern numerical ODE solver.

Core Principles & Definitions

Euler's method rests on a small number of foundational ideas that, taken together, transform an abstract differential equation into a concrete computational recipe. Understanding these principles is essential before diving into calculations, because they reveal both the power and the limitations of the technique. At its heart, the method replaces a continuously varying curve with a sequence of short, straight-line segments, each tangent to the solution curve at the left endpoint of the interval.

1

Local Linearization

The derivative dy/dx = f(x, y) gives the slope of the tangent line at every point. Euler's method assumes the solution is approximately linear over each small interval [xₙ, xₙ₊₁], so we 'ride the tangent' from one point to the next.
2

Step Size h

The step size h = Δx is the uniform horizontal distance between successive approximation points. Smaller h generally yields more accurate results but requires more computation. The trade-off between accuracy and effort is central to all numerical methods.
3

Iterative Update Rule

Each new y-value is computed from the previous one via yₙ₊₁ = yₙ + h · f(xₙ, yₙ). This recurrence relation means errors compound—each step builds on an already-approximate value.
4

Initial Condition Anchor

The method requires a known starting point (x₀, y₀). This initial condition anchors the entire approximation. Without it, the differential equation has infinitely many solutions, and the numerical scheme has no definite trajectory to follow.
5

Local vs. Global Error

The local truncation error at a single step is O(h²), but because errors accumulate over n = (x − x₀)/h steps, the global error is O(h). This makes Euler's method a first-order method.
KEY TAKEAWAY
Think of Euler's method like navigating a winding mountain road using only a compass. At each point you check your compass heading (the slope from the ODE), walk a fixed number of paces in that direction (the step h), then stop and re-check your heading. With small enough steps you'll trace a path close to the actual road, but you'll always cut corners slightly on curves. A finer step size is like taking shorter, more frequent compass readings—you hug the true path more closely, but the hike takes longer.

Visual Explanation — Tangent-Line Stepping

The geometric intuition behind Euler's method is best captured by a diagram showing the true solution curve alongside the piecewise-linear approximation. At each step, the method constructs a short tangent-line segment originating from the current approximation point. Because the true curve is generally nonlinear, each tangent segment drifts away from the exact solution, introducing error that accumulates as we march forward in x.

The green piecewise-linear path represents the Euler approximation, while the smooth violet curve is the exact solution. Each cyan dot marks an approximation point (xₙ, yₙ). Notice how the linear segments gradually drift below the true curve—this visual gap is the global truncation error, which accumulates with each step.

In the diagram above, the Euler approximation hugs the true solution fairly well near the initial point but progressively drifts as the number of steps increases. The nature of this drift depends on the concavity of the exact solution: when the true curve is concave up, Euler's method tends to underestimate, and when the curve is concave down, it tends to overestimate. Reducing the step size h brings the approximation closer to the true curve at the cost of more iterations—a fundamental trade-off that motivates the development of higher-order methods studied later in the course.

Mathematical Framework

The mathematical derivation of Euler's method begins with the definition of the derivative and a first-order Taylor expansion. Consider the initial value problem dy/dx = f(x, y), y(x₀) = y₀. The Taylor series expansion of y(x) about xₙ truncated after the linear term gives us the update formula that defines the method.

TAYLOR EXPANSION (TRUNCATED)
y(xₙ + h) = y(xₙ) + h · y′(xₙ) + (h²/2) · y″(cₙ)
where cₙ ∈ (xₙ, xₙ₊₁). The last term is the local truncation error, which is O(h²). Dropping this error term and substituting y′(xₙ) = f(xₙ, yₙ) yields the Euler update rule.
EULER'S UPDATE FORMULA
yₙ₊₁ = yₙ + h · f(xₙ, yₙ)
yₙ₊₁ = approximate y-value at xₙ₊₁; yₙ = current approximate y-value; h = step size (Δx); f(xₙ, yₙ) = slope of the solution at the current point, given by the ODE.
x-VALUE UPDATE
xₙ₊₁ = xₙ + h
The x-coordinates advance uniformly by the step size h. The total number of steps to reach a target x-value x* from x₀ is n = (x* − x₀) / h.
GLOBAL ERROR BOUND
|y(xₙ) − yₙ| ≤ (Mh / 2L)(e^{L(xₙ − x₀)} − 1)
Here M = max|y″| on the interval, L is the Lipschitz constant of f with respect to y, and the exponential factor reflects error amplification over many steps. The key takeaway is that the global error is O(h), meaning halving h roughly halves the error—but doubles the number of steps.
📐 Derivation Note
The transition from Taylor series to the Euler formula is precisely the same logic used in the finite-difference approximation of derivatives: y′(xₙ) ≈ (y(xₙ + h) − y(xₙ)) / h. Rearranging this yields y(xₙ + h) ≈ y(xₙ) + h · y′(xₙ), which is the Euler formula with y′ replaced by f(x, y). Recognizing this connection will help when you encounter backward Euler, the trapezoidal rule, and other implicit schemes in later coursework.

Error Analysis — How Step Size Affects Accuracy

Understanding the relationship between step size and error is crucial for using Euler's method effectively. Since the method is first-order, the global truncation error is proportional to h. This means that reducing the step size by a factor of 10 reduces the error by approximately the same factor—but requires 10 times as many computations. The following diagram illustrates how different step sizes produce approximations of varying fidelity for the same initial value problem.

Three Euler approximations for dy/dx = y, y(0) = 1 are plotted against the exact solution y = eˣ. The red path (h = 1.0) uses only 2 steps to reach x = 2 and shows the largest error. The amber path (h = 0.5) is closer, and the green path (h = 0.25) hugs the exact curve most closely. Halving h approximately halves the global error, confirming the O(h) convergence rate.
Convergence of Euler's method for dy/dx = y, y(0) = 1 as h decreases
Step Size hNumber of Steps to x = 2Euler Approx y(2)Exact y(2) = e²Absolute Error
1.024.00007.38913.3891
0.545.06257.38912.3266
0.2586.10357.38911.2856
0.1206.72757.38910.6616
0.012007.31647.38910.0727

The table confirms the first-order convergence rate: each time h is reduced by roughly a factor of 2, the absolute error decreases by approximately the same factor. Note that going from h = 0.1 to h = 0.01 (a tenfold refinement) reduces the error from about 0.66 to about 0.07—nearly a tenfold improvement—but requires 10 times as many function evaluations. This linear trade-off between computational cost and accuracy is the fundamental limitation that motivates higher-order methods like the fourth-order Runge–Kutta scheme, where the global error is O(h⁴).

Worked Example

Let us apply Euler's method to a concrete initial value problem that has a known exact solution, so we can verify our approximation. Consider the IVP: dy/dx = x + y, y(0) = 1, and use Euler's method with step size h = 0.2 to approximate y(1).

Euler's Method: dy/dx = x + y, y(0) = 1, h = 0.2
1
Step 0 — Identify Given Values & Set UpThe ODE is dy/dx = f(x, y) = x + y. The initial condition is (x₀, y₀) = (0, 1). The step size is h = 0.2 and we want to reach x = 1, so we need n = (1 − 0)/0.2 = 5 steps. The update formulas are: xₙ₊₁ = xₙ + 0.2 and yₙ₊₁ = yₙ + 0.2 · f(xₙ, yₙ) = yₙ + 0.2(xₙ + yₙ).
f(x, y) = x + y; h = 0.2; 5 steps required
2
Step 1 — From x₀ = 0 to x₁ = 0.2Evaluate the slope: f(0, 1) = 0 + 1 = 1. Apply the update: y₁ = y₀ + h · f(x₀, y₀) = 1 + 0.2(1) = 1.2.
y₁ = 1.2000 at x₁ = 0.2
3
Step 2 — From x₁ = 0.2 to x₂ = 0.4Evaluate the slope: f(0.2, 1.2) = 0.2 + 1.2 = 1.4. Apply the update: y₂ = 1.2 + 0.2(1.4) = 1.2 + 0.28 = 1.48.
y₂ = 1.4800 at x₂ = 0.4
4
Step 3 — From x₂ = 0.4 to x₃ = 0.6Evaluate the slope: f(0.4, 1.48) = 0.4 + 1.48 = 1.88. Apply the update: y₃ = 1.48 + 0.2(1.88) = 1.48 + 0.376 = 1.856.
y₃ = 1.8560 at x₃ = 0.6
5
Step 4 — From x₃ = 0.6 to x₄ = 0.8Evaluate the slope: f(0.6, 1.856) = 0.6 + 1.856 = 2.456. Apply the update: y₄ = 1.856 + 0.2(2.456) = 1.856 + 0.4912 = 2.3472.
y₄ = 2.3472 at x₄ = 0.8
6
Step 5 — From x₄ = 0.8 to x₅ = 1.0Evaluate the slope: f(0.8, 2.3472) = 0.8 + 2.3472 = 3.1472. Apply the update: y₅ = 2.3472 + 0.2(3.1472) = 2.3472 + 0.62944 = 2.97664.
y₅ ≈ 2.9766 at x₅ = 1.0
7
Step 6 — Compare with Exact SolutionThe exact solution to dy/dx = x + y, y(0) = 1 is y(x) = 2eˣ − x − 1. At x = 1: y(1) = 2e − 1 − 1 = 2e − 2 ≈ 3.4366. The Euler approximation gives y(1) ≈ 2.9766, so the absolute error is |3.4366 − 2.9766| ≈ 0.4600, a relative error of about 13.4%. Reducing h would improve this significantly.
Exact: y(1) ≈ 3.4366; Euler: y(1) ≈ 2.9766; Error ≈ 0.460

Strengths, Limitations & Practical Considerations

Euler's method occupies a distinctive position in the landscape of numerical ODE solvers: it is the easiest method to understand and implement, yet it is rarely the best choice for serious computation. Appreciating both its strengths and weaknesses is essential for making informed choices about numerical strategies in practice and in subsequent coursework.

Strengths and limitations of Euler's method
AspectStrengthsLimitations
SimplicityOnly one function evaluation per step. The update formula yₙ₊₁ = yₙ + h·f(xₙ, yₙ) is trivial to code in any language.Simplicity comes at the cost of accuracy. A single slope evaluation per step captures no curvature information.
Convergence OrderThe method is provably convergent: as h → 0 the approximation approaches the true solution.First-order (global error O(h)) means very small h is needed for high accuracy, leading to excessive computation.
Pedagogical ValueBuilds geometric intuition—tangent-line stepping—that carries over to all higher-order methods.May give students a false impression that all numerical methods are similarly low-accuracy.
StabilityAdequate for many non-stiff problems with moderate step sizes.For stiff equations, forward Euler requires impractically small h to remain stable. Implicit or backward Euler is needed.
ExtensibilityServes as the building block for improved methods: modified Euler, Heun's method, and general Runge–Kutta schemes.By itself, it lacks adaptive step-size control and error estimation that modern solvers provide automatically.
KEY TAKEAWAY
Euler's method in numerical analysis is analogous to a first prototype in engineering: it demonstrates the core concept—iterative tangent-line stepping—and proves the approach is viable, but it's not what you'd deploy in a final product. Just as an engineer iterates on a prototype to optimize performance, numerical analysts build on Euler's framework to construct higher-order Runge–Kutta and multistep methods that achieve dramatically better accuracy for the same computational budget.

Connection to Higher-Order & Implicit Methods

Euler's method is the first rung on a ladder of increasingly sophisticated numerical ODE techniques. Understanding where it fits in this hierarchy illuminates why it's taught first and what improvements are possible. The key idea is that higher-order methods evaluate f(x, y) at multiple points within each step interval, capturing curvature information that Euler's single-point evaluation misses entirely.

Euler's method in the hierarchy of numerical ODE solvers
MethodFunction Evaluations per StepGlobal Error OrderKey Idea
Forward Euler1O(h)Single tangent-line step using slope at left endpoint.
Improved Euler (Heun)2O(h²)Average the slopes at both endpoints of the interval (predictor-corrector).
Midpoint Method2O(h²)Use Euler to step to the midpoint, then use the midpoint slope for the full step.
Classical RK44O(h⁴)Weighted average of four slope estimates (beginning, two midpoints, endpoint).
Backward Euler (Implicit)1 (+ solve)O(h)Evaluate slope at the next point: yₙ₊₁ = yₙ + h·f(xₙ₊₁, yₙ₊₁). Superior stability for stiff problems.

The progression from Euler's method to RK4 illustrates a general principle in numerical analysis: accuracy can be purchased by sampling the vector field at more points within each step. The classical fourth-order Runge–Kutta method achieves an error of O(h⁴), meaning that halving the step size reduces the error by a factor of 16—a massive improvement over Euler's factor of 2. Meanwhile, implicit methods like backward Euler trade algebraic simplicity for unconditional stability, making them indispensable for stiff systems arising in chemical kinetics, circuit analysis, and other applications where explicit methods would require prohibitively small step sizes.

🔭 Looking Ahead
In your Differential Equations or Numerical Analysis course, you will likely encounter both Runge–Kutta methods and multistep methods (Adams–Bashforth, Adams–Moulton). All of these can be understood as sophisticated extensions of the tangent-line stepping idea you've learned here. Mastering Euler's method now gives you a solid conceptual anchor for these more powerful techniques.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words why Euler's method tends to underestimate the true solution when the exact solution curve is concave up (y″ > 0). What happens geometrically at each step?
PROBLEM 2BASIC CALCULATION
Use Euler's method with step size h = 0.5 to approximate y(1) for the IVP: dy/dx = 2x, y(0) = 1. Compare your result with the exact solution y = x² + 1.
PROBLEM 3INTERMEDIATE
Apply Euler's method with h = 0.1 to the IVP dy/dx = −y, y(0) = 3, and compute y₃ (the approximation at x = 0.3). Then find the exact value y(0.3) and compute the absolute error.
PROBLEM 4APPLIED
A tank initially holds 100 kg of salt dissolved in water. Fresh water flows in and the well-mixed solution flows out, so the salt mass satisfies dS/dt = −0.05S (kg/min), S(0) = 100. Use Euler's method with h = 2 min to estimate the salt remaining after 10 minutes. How does this compare to the exact value?
PROBLEM 5CRITICAL THINKING
Consider the IVP dy/dx = y², y(0) = 1, whose exact solution y = 1/(1 − x) blows up at x = 1. If you apply Euler's method with h = 0.25, what approximate values do you get at x = 0.25, 0.50, 0.75, and 1.0? Does the Euler solution capture the blow-up behavior? Discuss what this reveals about the reliability of Euler's method near singularities.

Lesson Summary

Euler's method is the simplest numerical technique for approximating solutions to first-order initial value problems of the form dy/dx = f(x, y), y(x₀) = y₀. The method works by local linearization: at each point, it follows the tangent line for a small horizontal distance h, producing the update rule yₙ₊₁ = yₙ + h · f(xₙ, yₙ). Because it uses only a single slope evaluation per step, its global truncation error is O(h), making it a first-order method. Halving the step size approximately halves the error but doubles the computational work.

While rarely used for production-level computation, Euler's method provides the essential conceptual foundation for all higher-order numerical ODE solvers, including the Runge–Kutta family and multistep methods. Understanding its geometric interpretation—stepping along tangent lines—its error behavior, and its limitations with stiff equations and singularities prepares you to make informed choices among the more powerful numerical tools available in modern scientific computing.

Varsity Tutors • Calculus 2 • Euler's Method — Approximating Solutions Using Euler's Method