article

Euler’s Method · Foundational

Euler’s Method Follows an ODE One Step at a Time

Build numerical trajectories from local slopes, quantify step-size error, and distinguish accuracy from numerical stability.

A differential equation can describe a solution through its local slope even when no convenient formula for the whole solution is available. Euler’s method turns that slope information into a sequence of approximate points. At each point, it follows the current tangent line for a short step, then recomputes the slope. Repetition produces a numerical trajectory. The method is simple enough to calculate by hand and rich enough to expose the central ideas of numerical simulation.

Simplicity does not make the method automatically trustworthy. Step size controls truncation error, computational work, and sometimes numerical stability. A table printed to many decimal places can still be far from the true solution. A responsible computation therefore includes units, a refinement study, and a check against qualitative behavior. This article develops that reasoning from the initial-value problem through stability analysis.

A smooth solution curve compared with tangent-line Euler steps

Euler’s method begins at a known initial point. It uses the differential equation to find the local tangent slope. A finite step along that tangent predicts the next point. The slope is then recalculated at the predicted point. Curvature creates a gap between the tangent step and the true solution.

State the initial-value problem

Consider the first-order initial-value problem y=f(t,y)y'=f(t,y) with y(t0)=y0y(t_0)=y_0. The prime denotes derivative with respect to tt, so y=dydty'=\frac{dy}{dt}. The function ff supplies the slope at any state point (t,y)(t,y). The initial condition gives one known point (t0,y0)(t_0,y_0) on the desired solution. Together, the rule and point determine the trajectory under appropriate existence and uniqueness conditions.

The independent variable tt often represents time, but it can represent any ordered input. The dependent variable y(t)y(t) is the evolving state. If yy is measured in metres and tt in seconds, then ff has units ms\frac{\mathrm{m}}{\mathrm{s}}. Those slope units become important when the method multiplies by a time step. Dimensional consistency ensures that a state increment can be added to the previous state.

Euler’s method creates grid points tn=t0+nht_n=t_0+nh, where nn is a nonnegative integer and hh is the step size. The approximation at tnt_n is written yny_n. In general, yny_n is not exactly equal to y(tn)y(t_n). The subscript labels a numerical sequence rather than a derivative. Keeping approximate and exact notation distinct prevents circular reasoning about error.

Derive the Euler update

The derivative definition gives y(tn)y(tn+h)y(tn)hy'(t_n)\approx\frac{y(t_n+h)-y(t_n)}{h} for small nonzero hh. Solving this approximation for the future value gives y(tn+h)y(tn)+hy(tn)y(t_n+h)\approx y(t_n)+hy'(t_n). The differential equation replaces y(tn)y'(t_n) with f(tn,y(tn))f(t_n,y(t_n)). Replacing exact states with numerical approximations produces yn+1=yn+hf(tn,yn)y_{n+1}=y_n+hf(t_n,y_n). The time update is tn+1=tn+ht_{n+1}=t_n+h.

The product hf(tn,yn)hf(t_n,y_n) is the predicted change in yy. If hh has seconds and ff has metres per second, the product has metres. Adding it to yny_n is therefore dimensionally valid. A positive product increases the next state, while a negative product decreases it. The method follows the sign and magnitude of the current local slope.

Geometrically, the formula evaluates the tangent line at a horizontal displacement hh. The tangent line through (tn,yn)(t_n,y_n) is L(t)=yn+f(tn,yn)(ttn)L(t)=y_n+f(t_n,y_n)(t-t_n). Substituting t=tn+ht=t_n+h gives the Euler update. The method then discards that line and constructs a new tangent at the next approximate point. It is a piecewise-tangent model of the solution.

Organize computation in a table

A reliable Euler table includes columns for nn, tnt_n, yny_n, slope f(tn,yn)f(t_n,y_n), increment hf(tn,yn)h f(t_n,y_n), and next value yn+1y_{n+1}. Separating slope from increment reduces substitution errors. It also keeps units visible. The next row begins with the previous row’s output. Each step should use the current pair rather than an outdated initial value.

Suppose y=t+yy'=t+y, y(0)=1y(0)=1, and h=0.100sh=0.100\,\mathrm{s}. At (t0,y0)=(0s,1)(t_0,y_0)=(0\,\mathrm{s},1), the slope is f(0,1)=1s1f(0,1)=1\,\mathrm{s}^{-1} if yy is dimensionless. The increment is (0.100s)(1s1)=0.100(0.100\,\mathrm{s})(1\,\mathrm{s}^{-1})=0.100. Therefore t1=0.100st_1=0.100\,\mathrm{s} and y1=1.100y_1=1.100. The reciprocal-second factor cancels the second in the step.

At the new point, the slope is f(0.100,1.100)=1.200s1f(0.100,1.100)=1.200\,\mathrm{s}^{-1}. The next increment is 0.1200.120, giving y2=1.220y_2=1.220 at t2=0.200st_2=0.200\,\mathrm{s}. Reusing the original slope would incorrectly turn Euler’s method into one long fixed tangent. Recalculation is what allows the polygonal path to bend. A table makes that repeated logic auditable.

Work the exponential-growth recurrence

Approximate y=yy'=y, y(0)=1y(0)=1, on 0t10\le t\le1 with h=0.250h=0.250. The slope rule is f(t,y)=yf(t,y)=y. Euler’s update becomes yn+1=yn+0.250yn=1.250yny_{n+1}=y_n+0.250y_n=1.250y_n. Each step multiplies the current approximation by 1.2501.250. Four steps reach t=1t=1.

The values are y0=1.000y_0=1.000, y1=1.250y_1=1.250, y2=1.5625y_2=1.5625, y3=1.953125y_3=1.953125, and y4=2.44140625y_4=2.44140625. The exact solution is y(t)=ety(t)=e^t, so y(1)=e2.71828y(1)=e\approx2.71828. The Euler value underestimates by about 0.276870.27687. Relative error is approximately 0.276872.71828×100%=10.2%\frac{0.27687}{2.71828}\times100\%=10.2\%. Printed digits beyond justified accuracy do not repair that discrepancy.

The underestimation can be predicted geometrically. The exponential solution is increasing and concave up. Its tangent line lies below the curve immediately to the right of each contact point. Euler repeatedly steps along those lower tangent lines. The sign of error is therefore connected to curvature, not accidental arithmetic.

A table and graph showing Euler approximations below a convex exponential curve

For y=yy'=y, each Euler slope equals the current approximate height. A step of 0.2500.250 multiplies that height by 1.2501.250. The exact exponential curve bends upward above each forward tangent segment. Euler therefore underestimates in this example. Smaller steps shorten the interval over which each tangent is trusted. The geometric prediction agrees with the computed values.

Explain local truncation error

Taylor’s formula gives y(tn+h)=y(tn)+hy(tn)+h22y(ξn)y(t_n+h)=y(t_n)+hy'(t_n)+\frac{h^2}{2}y''(\xi_n) for some point ξn\xi_n between tnt_n and tn+ht_n+h under suitable smoothness. Euler’s step keeps the first two terms and omits the curvature term. Starting from the exact state, the omitted amount is proportional to h2h^2. This one-step discrepancy is called local truncation error. Its coefficient depends on the second derivative along the solution.

The phrase “proportional to h2h^2” means halving hh reduces a typical local error by roughly a factor of four when the asymptotic regime is reached. It does not mean every problem has the same error constant. Large curvature can make even a small step inaccurate. A nonsmooth solution can invalidate the simple estimate. Error order describes scaling under stated regularity conditions.

Local truncation error is not the same as floating-point roundoff. Truncation comes from replacing a curved solution by a tangent line over finite width. Roundoff comes from representing numbers with finite digits. Reducing hh usually reduces truncation error, while an extremely large number of steps can accumulate roundoff and cost. Numerical design balances these effects rather than assuming smaller is infinitely better.

Explain accumulated global error

Over a fixed interval, reducing hh increases the number of steps roughly like 1h\frac{1}{h}. Each step introduces local error of order h2h^2, and previous errors also influence later slope evaluations. Under standard smoothness and stability assumptions, Euler’s global error is order hh. This means halving the step typically halves the final error. Euler’s method is therefore called a first-order method.

The simple multiplication 1hh2=h\frac{1}{h}\cdot h^2=h offers intuition, but a full proof must control error propagation. If nearby trajectories separate rapidly, earlier errors can be amplified. Lipschitz conditions on ff help bound that amplification. The final constant can grow with interval length and problem sensitivity. Order alone does not give a guaranteed numerical value.

Global error compares yny_n with the exact y(tn)y(t_n) after many steps. It differs from the change between two approximate step sizes. Step refinement provides evidence about error but not an exact answer by itself. When the expected first-order regime holds, the difference between hh and h2\frac{h}{2} solutions is comparable to the finer solution’s remaining error. This makes step halving a practical diagnostic.

Use step halving as evidence

For y=yy'=y, y(0)=1y(0)=1, Euler with h=0.500h=0.500 gives y(1)=1.52=2.25y(1)=1.5^2=2.25. With h=0.250h=0.250, it gives 1.2542.44141.25^4\approx2.4414. With h=0.125h=0.125, it gives 1.12582.56581.125^8\approx2.5658. The values move toward e2.7183e\approx2.7183. Successive changes shrink, which supports convergence.

The errors are approximately 0.46830.4683, 0.27690.2769, and 0.15250.1525. Halving the step does not exactly halve these coarse-grid errors, but the ratio trends toward first-order behavior. Continuing refinement would move into the asymptotic regime more clearly. A table of step size, approximation, and change communicates more than one isolated output. Convergence evidence should accompany a reported numerical result.

If successive refinements do not stabilize, several explanations are possible. The step may still be too large, the problem may be stiff, the method may be unstable, or implementation may be wrong. A smaller difference does not prove proximity to the exact solution in every pathological case. Compare qualitative behavior and, when possible, use a higher-order reference method. Numerical confidence comes from converging lines of evidence.

Distinguish accuracy from stability

Accuracy asks how close the approximation is to the exact solution. Stability asks whether numerical perturbations and modes behave in a controlled way under repeated steps. A method can be stable but inaccurate because its step is coarse. It can also be unstable and produce growth even when the true solution decays. These are related but distinct properties.

Apply Euler to the test equation y=λyy'=\lambda y. The update is yn+1=(1+hλ)yny_{n+1}=(1+h\lambda)y_n. The multiplier G=1+hλG=1+h\lambda is called the amplification factor. After nn steps, yn=Gny0y_n=G^ny_0. Numerical decay requires G<1|G|<1.

For real λ<0\lambda<0, the exact solution y(t)=y0eλty(t)=y_0e^{\lambda t} decays. Euler decays only when 1+hλ<1|1+h\lambda|<1. Solving gives 0<h<2λ0<h<\frac{2}{|\lambda|}. The restriction is a stability condition rather than merely a desired accuracy level. Crossing it changes the qualitative numerical behavior.

Diagnose a stability failure

Take y=10yy'=-10y with time in seconds and y(0)=1y(0)=1. The true solution is e10te^{-10t} and approaches zero monotonically. With h=0.100sh=0.100\,\mathrm{s}, the multiplier is 110(0.100)=01-10(0.100)=0. Euler reaches zero in one step, which is stable but not a faithful shape. With h=0.150sh=0.150\,\mathrm{s}, the multiplier is 0.5-0.5, so signs alternate while magnitudes decay.

With h=0.200sh=0.200\,\mathrm{s}, the multiplier is 1-1. The numerical state alternates forever with constant magnitude. With h=0.250sh=0.250\,\mathrm{s}, the multiplier is 1.5-1.5, so oscillations grow. Both results contradict the exact decay. A seemingly modest step can therefore invent instability.

The stability interval is 0<h<0.200s0<h<0.200\,\mathrm{s} because 210s1=0.200s\frac{2}{10\,\mathrm{s}^{-1}}=0.200\,\mathrm{s}. Accuracy may demand a much smaller step than this upper boundary. The condition only prevents unbounded qualitative failure for the test mode. Stiff systems contain fast decaying modes that impose severe explicit-Euler restrictions. Implicit methods are often preferred for those systems.

An amplification-factor number line showing stable, oscillatory, boundary, and growing Euler behavior

The amplification factor is G=1+hλG=1+h\lambda. Numerical decay requires G<1|G|<1. Positive GG below one gives monotone decay, while negative GG above negative one gives alternating decay. At G=1G=-1, magnitude no longer decreases. Outside the interval, Euler invents growth. Stability therefore constrains step size even before fine accuracy is considered.

Interpret Euler steps in a slope field

A slope field draws a short segment with slope f(t,y)f(t,y) at many points. Euler’s method converts those visual directions into a path. Start at the initial condition, follow the local segment for horizontal distance hh, and arrive at the next approximate point. Repeat using the slope field at the new location. The computed polygon should roughly follow the field’s directional texture.

The comparison can reveal errors. If the table says yy increases while the field at that point slopes downward, the slope evaluation or sign is wrong. If a step crosses an equilibrium solution unexpectedly, the step may be too large. If trajectories in the field bend sharply, smaller steps are appropriate. Visual and numerical representations should support each other.

Euler paths do not generally pass through the centers of all drawn segments because the grid and step points may differ. The field is a qualitative sampling of the same function ff. The algorithm evaluates exact slope formulas at its own approximate points. Both representations encode the differential equation rather than the unknown solution formula. Their agreement is a conceptual check rather than an identity of drawings.

Preserve units in applied models

Suppose temperature TT is measured in degrees Celsius and time in minutes. In Newton’s cooling model T=k(TTa)T'=-k(T-T_a), the constant kk has units min1\mathrm{min}^{-1}. The difference TTaT-T_a has degrees Celsius. The right side therefore has Cmin\frac{^\circ\mathrm{C}}{\mathrm{min}}, matching TT'. Multiplying by step hh in minutes produces a temperature change.

Let Ta=20.0CT_a=20.0\,{}^\circ\mathrm{C}, T0=80.0CT_0=80.0\,{}^\circ\mathrm{C}, k=0.100min1k=0.100\,\mathrm{min}^{-1}, and h=2.00minh=2.00\,\mathrm{min}. The initial slope is 0.100min1(60.0C)=6.00Cmin-0.100\,\mathrm{min}^{-1}(60.0\,{}^\circ\mathrm{C})=-6.00\,\frac{^\circ\mathrm{C}}{\mathrm{min}}. The first increment is (2.00min)(6.00Cmin)=12.0C(2.00\,\mathrm{min})(-6.00\,\frac{^\circ\mathrm{C}}{\mathrm{min}})=-12.0\,{}^\circ\mathrm{C}. Therefore T1=68.0CT_1=68.0\,{}^\circ\mathrm{C}. Units cancel correctly in the update.

An update that adds a rate directly to a state is dimensionally invalid. The step size supplies the missing independent-variable unit. If hh is given in seconds while kk is per minute, convert one before multiplying. Unit consistency can catch hidden scale factors of 6060. Numerical methods do not suspend physical dimensional reasoning.

Compare Euler with improved methods

Euler uses the slope at the beginning of each step. The midpoint method estimates a slope near the step’s center. Heun’s method averages beginning and predicted-ending slopes. Classical fourth-order Runge–Kutta combines four slope samples. These methods use additional work per step to achieve higher accuracy order.

A higher-order method is not automatically best in every setting. Cost per step, stability, available error control, discontinuities, and model complexity matter. Euler remains valuable for conceptual development, quick estimates, and certain simple simulations. Its limitations are visible and therefore pedagogically useful. It provides the baseline against which improved methods can be understood.

Adaptive methods change hh during computation. They shorten steps where the solution varies rapidly or error estimates grow. They lengthen steps where behavior is smooth. This allocates work according to local difficulty. The fixed-step Euler method introduces the principle before adaptive algorithms automate it.

Follow an error-resistant workflow

First write the differential equation as an explicit slope rule y=f(t,y)y'=f(t,y) and record the initial condition. Choose a step whose units match the independent variable. Determine the number of steps needed to reach the target input. Build a table with current input, current state, slope, increment, and next state. Do not round aggressively inside the recurrence.

At each row, evaluate the slope at the current approximate point. Multiply by hh to obtain a state change. Add that change to obtain yn+1y_{n+1}, then advance time by hh. Check the sign against the slope field or physical model. Repeat until the target is reached exactly or handle a shorter final step explicitly.

Then repeat with a smaller step size. Compare the target values and qualitative trajectory. Check stability conditions when rapid decay or stiffness is possible. Report step size and method with the answer because they define the approximation. A bare decimal without numerical-method context is incomplete evidence.

Repair common misconceptions

Euler’s method does not use the exact future slope. It uses the slope available at the current approximate state. Substituting f(tn+1,yn+1)f(t_{n+1},y_{n+1}) would define a different, implicit method. Reusing f(t0,y0)f(t_0,y_0) for every step follows one tangent forever. Recalculation at each step is essential.

More decimal places do not imply greater accuracy. They may only display arithmetic performed on a coarse approximation. Step refinement or comparison with a higher-order solution provides actual evidence. Another mistake is to equate local h2h^2 error with final h2h^2 error. Euler’s accumulated global order is typically hh over a fixed interval.

Smaller steps usually improve truncation accuracy, but stability and finite precision still matter. A step within the stability interval can remain too coarse for accurate values. A step outside it can create fictitious oscillation or growth. Negative intermediate values are not always errors, but they may violate a model’s physical domain. Numerical output must be interpreted, not merely generated.

Retrieve and connect forward

For y=4yy'=-4y with h=0.500h=0.500, the amplification factor is 14(0.500)=11-4(0.500)=-1. Euler predicts alternating values of constant magnitude. The exact solution y0e4ty_0e^{-4t} decays toward zero. The step lies on the numerical stability boundary. This example separates an algebraically valid recurrence from a physically misleading approximation.

For y=yy'=y, smaller positive steps move the Euler estimate of y(1)y(1) toward ee. The method underestimates because the exact exponential is concave up and tangent steps lie below it. Local truncation error scales like h2h^2, while typical global error scales like hh. A refinement table turns these statements into observable evidence. The calculation should be accompanied by its step size.

Euler’s method converts a slope rule into a trajectory one step at a time. It makes the definition of a differential equation computationally concrete. Error analysis shows why local approximation does not guarantee global accuracy. Stability analysis shows why a decaying differential equation can produce a growing numerical sequence. Higher-order and adaptive methods retain this stepwise logic while using slope information more effectively.

Continue exploring

Connections

Related articles

First-Order ODEsFirst-Order ODEs Model Growth, Decay, and BalanceSlope FieldsSlope Fields Show an ODE Before It Is SolvedOrdinary Differential EquationsFirst-Order Differential Equations

Applications

  • numerical simulation
  • initial-value problems