FP1 6.1 - Numerical solution of differential equations
Replace derivatives by finite differences to approximate first- and second-order differential equations (FP1 6.1). You will use forward and central differences, generate solution values on a grid and distinguish starting-value calculations from boundary-value equations.
Three derivative approximations on a grid
Can a table of heights stand in for a differential equation's derivatives? A forward secant estimates a tangent using the next height. A central secant uses heights on both sides, balancing their contributions.
Choose equally spaced points , with . Write for the height associated with ; in a numerical solution these heights are themselves approximations. The subscripts label grid positions, rather than powers or derivatives.
You already know
An initial condition selects a solution curve, and a differential equation supplies gradients along that curve. A first-order initial-value problem normally gives one starting value; a second-order problem needs two pieces of data. A numerical approximation does not have to satisfy the equation exactly between grid points.
The difference of the two neighbouring secant gradients is
Dividing that gradient change by the separation gives the second-difference estimate of the second derivative.
Forward, central and second differences
For an equally spaced grid, where is sufficiently smooth near the points used,
The central first difference spans two grid intervals, while the second difference divides by .
Not in the formula booklet: learn it.
Central estimates require both neighbours, so they cannot be used at an endpoint without additional information.
Worked example 1: three estimates from one small table
Question. For , estimate by forward and central differences and by the second difference, using .
Plan. Find the three heights around , then use each approximation with its own denominator.
Why this step? The same three heights enter different expressions; a shared table does not mean the denominators are interchangeable.
Answer. The estimates are , and , respectively.
Check. The exact derivatives are , , giving and at . The central first estimate is closer here, and the second estimate is exact.
Change only the spacing to , keeping the function and centre fixed.
Worked example 2: halving the spacing
Question. Repeat the three estimates at using .
Plan. Recalculate the neighbouring heights; do not reuse those for the old grid.
Why this step? Halving quarters , so the second-difference denominator must change by a different factor.
Answer. The estimates are , and .
Check. The central first-derivative error falls from to . The second derivative remains exact.
There is a useful surprise: the central second difference is exact for every cubic polynomial, for any non-zero spacing when exact heights are used. Expanding the cubic at and cancels the odd powers of , leaving exactly its second derivative. This algebraic fact is not a separate booklet result. General smooth functions still produce approximation errors.
[DIAGRAM: asset_name: Forward and central secants around a tangent; asset_slug: 9fm0-fp1-difference-secants; caption: The central secant balances heights on both sides of the derivative point; description: A Cartesian graph of y equals x cubed near x equals 1 shows points at x equals 0.8, 1 and 1.2. A clay forward secant through x equals 1 and 1.2 has slope 3.64. A sage central secant through x equals 0.8 and 1.2 has slope 3.04. A blue tangent at x equals 1 has slope 3. The three lines have separate legend labels and the grid heights are marked.]

Watch out
Smaller spacing usually reduces discretisation error for a smooth problem, but it also magnifies the effect of rounding in differences. Keep enough digits in stored heights, especially before division by .
Change the spacing to and keep the three denominators distinct.
Forward steps for a first-order equation
For , replacing the derivative by a forward difference gives an explicit update from the current point.
Rearrange , then define the numerical scheme by the resulting update. Equality in that update describes the calculation, rather than an exact differential-equation solution.
Forward first-order update
For and grid ,
Start from the given . The slope is evaluated at the current point, before moving to the next point. This is the forward Euler method.
Not in the formula booklet: learn it.
Use a table with separate columns for , the current slope and the next height. Retain working digits until the requested final rounding.
Worked example 3: two forward steps
Question. Use the forward-difference method with to estimate , where and .
Plan. Use , advancing and together.
Why this step? The second step uses the new height , not the original height , to estimate the slope at .
Answer. .
Check. Two intervals of width reach . The exact function satisfies the problem and gives approximately , so is an approximation rather than an exact value.
Change only the step length to , keeping the same initial-value problem and target point.
Worked example 4: more steps to the same target
Question. Repeat the estimate of with .
Plan. Take four forward steps, using the current coordinates each time.
Thus
Why this step? The target is unchanged, so halving the step doubles the required number of steps.
Answer. , or to six significant figures.
Check. This is closer to than the previous estimate. That comparison concerns this problem; two numerical approximations alone would not prove an error bound.
A smooth exact solution is useful for checking a method in an example, but numerical methods remain useful when no manageable explicit solution is available.
Watch out
Wrong: use for the forward update. That mixes the next horizontal coordinate with the current height. Right: evaluate the slope at the current pair , giving . Show the recurrence and intermediate values; a calculator's direct solution of the differential equation does not demonstrate the requested finite-difference method.
Take two larger steps for the next estimate.
Central first differences need two starting heights
A central first difference produces a two-step recurrence: its next height depends on both of the preceding stored heights.
For , substitute at , then rearrange.
Central first-order update
Two starting heights, , are needed. Use a supplied starting height or the instructed starting method, such as one forward step. The slope is still evaluated at the central point .
Not in the formula booklet: learn it.
The update jumps from the old height across two intervals. Adding to would use the wrong base height.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account