Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 18 of 24

Turn an ODE slope into a controlled first-order step

Derive explicit Euler and separate one-step defect from accumulated global error.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

For y′=y with y(0)=1, explicit Euler follows the current slope for one step: yₙ₊₁=yₙ+h yₙ. With h=1/2, the values at t=0,1/2,1 are 1,3/2,9/4. The exact solution at t=1 is e, so the two-step result underestimates it. The update is exact for the chosen tangent-line model, not exact for the curved solution.

Predict

Predict whether making one step twice as small halves or quarters the immediate defect. Starting from the exact solution, Taylor’s theorem gives a defect proportional to h², so halving h quarters that local defect. But reaching the same final time then requires twice as many steps. Global error therefore has a different order, and propagation through the dynamics must also be controlled.

Experiment

Compare final-time approximations for the same problem.

hSteps to t=1Euler valueExact recurrence
1/229/4(1+1/2)²
1/44625/256(1+1/4)⁴

Compute the errors against e using a supplied high-precision reference. The recurrence validates the implementation independently of the continuous exact solution, which measures discretization error.

Understand

For y′=f(t,y), Euler uses yₙ₊₁=yₙ+h f(tₙ,yₙ). If the exact solution is C², Taylor expansion gives y(tₙ+h)=y(tₙ)+h f(tₙ,y(tₙ))+dₙ, with |dₙ|≤Mh²/2 for a bound M on |y″|. Here dₙ is the unscaled one-step defect; some texts divide it by h and call that quantity local truncation error, so state the convention. If f is Lipschitz in y with constant L on a region containing exact and numerical trajectories, the global error obeys |eₙ₊₁|≤(1+hL)|eₙ|+Mh²/2. A geometric sum over a fixed interval bounds it by a constant times h when the initial error is zero.

Apply

The recurrence also explains why consistent local slopes are not enough without stability. For y′=λy, Euler multiplies by 1+hλ each step. If λ<0, the true solution decays, but a large h can give amplification magnitude greater than one. Even a magnitude below one can alternate signs, violating positivity while remaining stable in norm. For nonlinear problems, ensure the iterates remain in the region where derivative and Lipschitz bounds hold. A theorem about a small neighborhood cannot justify a trace that has already left it.

For the linear decay equation, the exact one-step factor is e^(hλ), while Euler uses its first-degree approximation 1+hλ. Expanding their difference gives (hλ)²/2+O(h³) for fixed λ. This directly confirms the local-defect order and reveals why the constant grows with |λ|². A step small relative to the final time may still be large relative to a fast decay timescale. Step size should therefore be judged against the dynamics, not merely the number of digits in the time variable.

Continue

Implementation should bound the number of steps, use the old state for all components of one Euler update, and handle a final shortened step explicitly. A vector update performed component by component with overwritten values is generally a different method. Report local-defect convention, final-time error, step size and evaluation count. Next, Runge–Kutta methods combine several slope evaluations to cancel leading errors, improving order without automatically solving stiffness or event-detection problems.

Review calculus and linear algebra when a prerequisite needs practice. Continue to Combine slopes to cancel leading error terms.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

For y′=−2y, y(0)=3 and h=1/4, compute one explicit Euler step.

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

For y′=y, y₀=1 and h=1/2, compute y₂.

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Derive the one-step defect for exact starting data when the solution is C².

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Why does an O(h²) defect per step usually lead to O(h) global error over a fixed interval?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For y′=−5y with positive y₀, find conditions on h for explicit Euler to preserve nonnegativity and to be strictly stable.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Specify an Euler implementation test that checks indexing and actual evaluation counts.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.