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.

A summation symbol with infinity and a smooth series curve.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

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.

SECTION 2

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.

SECTION 3

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.

Euler's Method: Tangent-Line Stepping vs. True Solutionxyy(x) exact(x₀, y₀)(x₁, y₁)(x₂, y₂)(x₃, y₃)(x₄, y₄)x₀x₁x₂x₃x₄slope = f(x₀,y₀)Euler approximationExact solution
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.

SECTION 4

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(xn+h)=y(xn)+h⋅y′(xn)+(h2/2)⋅y″(cn)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

yn+1=yn+h⋅f(xn,yn)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

xn+1=xn+hxₙ₊₁ = 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(xn)−yn∣≤(Mh/2L)(eL(xn−x0)−1)|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.

SECTION 5

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.

Effect of Step Size on Euler Approximation (dy/dx = y, y(0)=1)xy00.51.01.52.012468eˣ (exact)h = 1.0h = 0.5h = 0.25Error at x = 2h=1.0 → y≈4.00 (err≈3.39)h=0.5 → y≈5.06 (err≈2.33)h=0.25→ y≈6.10 (err≈1.29)
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.
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

Convergence of Euler's method for dy/dx = y, y(0) = 1 as h decreases

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⁴).

SECTION 6

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. 1

    Step 0 — Identify Given Values & Set Up

    The 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. 2

    Step 1 — From x₀ = 0 to x₁ = 0.2

    Evaluate 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. 3

    Step 2 — From x₁ = 0.2 to x₂ = 0.4

    Evaluate 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. 4

    Step 3 — From x₂ = 0.4 to x₃ = 0.6

    Evaluate 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. 5

    Step 4 — From x₃ = 0.6 to x₄ = 0.8

    Evaluate 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. 6

    Step 5 — From x₄ = 0.8 to x₅ = 1.0

    Evaluate 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. 7

    Step 6 — Compare with Exact Solution

    The 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

SECTION 7

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.

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.

Strengths and limitations of Euler's method

✦

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.

SECTION 8

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.

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.

Euler's method in the hierarchy of numerical ODE solvers

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.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

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?
Show answer
When the exact solution is concave up, the curve bends upward away from any tangent line drawn at a given point. Euler's method follows the tangent line for the entire step, which lies below the curving solution. At the end of the step, the Euler approximation is lower than the true y-value. Since the next step starts from this already-too-low value, subsequent tangent lines are constructed from a point that is already beneath the curve, causing the underestimate to accumulate. If the curve were concave down, the tangent line would lie above the curve, and Euler's method would overestimate.

Question 2: BASIC 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.
Show answer
We need n = (1 − 0)/0.5 = 2 steps. Step 1: f(0, 1) = 2(0) = 0, so y₁ = 1 + 0.5(0) = 1.0 at x₁ = 0.5. Step 2: f(0.5, 1.0) = 2(0.5) = 1.0, so y₂ = 1.0 + 0.5(1.0) = 1.5 at x₂ = 1.0. The exact solution gives y(1) = 1² + 1 = 2.0. The Euler approximation is 1.5, giving an absolute error of 0.5. This error arises because the parabola y = x² + 1 is concave up, so the tangent-line segments consistently underestimate the true values.

Question 3: INTERMEDIATE

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.
Show answer
Here f(x, y) = −y. Step 1: f(0, 3) = −3, y₁ = 3 + 0.1(−3) = 2.7 at x₁ = 0.1. Step 2: f(0.1, 2.7) = −2.7, y₂ = 2.7 + 0.1(−2.7) = 2.43 at x₂ = 0.2. Step 3: f(0.2, 2.43) = −2.43, y₃ = 2.43 + 0.1(−2.43) = 2.187 at x₃ = 0.3. The exact solution is y = 3e−x3e^{−x}, so y(0.3) = 3e−0.33e^{−0.3} ≈ 3(0.7408) = 2.2225. The Euler approximation is 2.187, giving an absolute error of |2.2225 − 2.187| ≈ 0.0355. Note that (1 − 0.1)³ × 3 = 0.9³ × 3 = 0.729 × 3 = 2.187, confirming the pattern yₙ = 3(1 − h)ⁿ.

Question 4: APPLIED

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?
Show answer
We have f(t, S) = −0.05S, S₀ = 100, h = 2, and we need n = 10/2 = 5 steps. Step 1: S₁ = 100 + 2(−0.05)(100) = 100 − 10 = 90. Step 2: S₂ = 90 + 2(−0.05)(90) = 90 − 9 = 81. Step 3: S₃ = 81 + 2(−0.05)(81) = 81 − 8.1 = 72.9. Step 4: S₄ = 72.9 + 2(−0.05)(72.9) = 72.9 − 7.29 = 65.61. Step 5: S₅ = 65.61 + 2(−0.05)(65.61) = 65.61 − 6.561 = 59.049 kg. The exact solution is S(t) = 100e−0.05t100e^{−0.05t}, so S(10) = 100e−0.5100e^{−0.5} ≈ 60.65 kg. Euler's estimate of 59.05 kg is an underestimate with error ≈ 1.60 kg (about 2.6%). Observe that Sₙ = 100(0.9)ⁿ = 100(0.9)⁵ = 59.049, consistent with the general pattern for linear ODEs under Euler's method.

Question 5: CRITICAL 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.
Show answer
With f(x, y) = y² and h = 0.25: Step 1: y₁ = 1 + 0.25(1²) = 1.25 (exact: 1/(1−0.25) = 1.333). Step 2: y₂ = 1.25 + 0.25(1.25²) = 1.25 + 0.3906 = 1.6406 (exact: 1/(0.5) = 2.0). Step 3: y₃ = 1.6406 + 0.25(1.6406²) = 1.6406 + 0.6729 = 2.3135 (exact: 1/(0.25) = 4.0). Step 4: y₄ = 2.3135 + 0.25(2.3135²) = 2.3135 + 1.3381 = 3.6516 (exact: 1/0 → ∞). The Euler approximation grows but yields a finite value of ≈ 3.65 at x = 1 rather than diverging. This reveals a fundamental limitation: Euler's method cannot detect or faithfully reproduce blow-up singularities because it advances by finite increments. Near a singularity the slope grows explosively, and any fixed step size is too coarse to track the acceleration. Adaptive step-size methods, which shrink h when the slope grows large, handle this situation far more gracefully.

SUMMARY

Lesson Summary

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