Why the Target Time Matters
Euler’s method advances a solution in equal time steps. When a problem asks for an approximation at a specified time, the steps must not only follow the slope rule; they must also end at that time. A step size that does not fit the interval evenly can leave the calculation short of the target or carry it past the target.
The key planning task is to relate three quantities: the initial time, the target time, and the step size. Once the number of steps is a whole number, the Euler updates can be carried out in order until the last time value equals the target.
The Euler Update and the Target-Time Condition
For an initial-value problem \(y'=f(t,y)\) with \(y(t_0)=y_0\), a forward Euler step of size \(h>0\) uses the slope at the current point to estimate the solution at the next time. The update is
Here \(t_n\) is the time at step \(n\), and \(y_n\) is the Euler approximation at that time. The slope is evaluated at the current time and approximate solution, not at the next time.
If the target and initial times are given and you may choose the step size, first choose a positive integer \(N\), then set \(h=(T-t_0)/N\). If \(h\) is given instead, calculate \((T-t_0)/h\) and check that it is a whole number before constructing the table.
Why the Step Count Determines the Endpoint
The time update is especially simple: every Euler step adds \(h\) to the time, regardless of the slope rule. Starting at \(t_0\), after one step the time is \(t_0+h\); after two steps it is \(t_0+2h\). Repeating this gives the endpoint condition directly.
To verify the result, use induction. For \(n=0\), the starting time is \(t_0=t_0+0h\). Suppose \(t_n=t_0+nh\). The Euler time update gives
Thus the formula holds at the next step. Starting from \(n=0\), it follows for every nonnegative integer \(n\). In particular, \(t_N=T\) exactly when \(t_0+Nh=T\). This argument concerns the time coordinates; the solution values still must be computed from the slope rule.
A Reliable Calculation Plan
Subtract the initial time from the target time: \(T-t_0\).
If \(h\) is prescribed, calculate \(N=(T-t_0)/h\) and check it is a positive integer. If you choose \(h\), choose a positive integer \(N\) and use \(h=(T-t_0)/N\).
Start with \((t_0,y_0)\), evaluate \(f(t_n,y_n)\), and compute \(y_{n+1}=y_n+h f(t_n,y_n)\) at each step.
Confirm that the last time is \(t_0+Nh=T\), and that exactly \(N\) updates were made.
For a time-dependent rule, use the current time in the slope at every step. Even if two approximate solution values happen to match, their slopes need not match when their time coordinates differ.
Worked Examples
Worked Example: Choosing a Step Size for a Time-Dependent Rule
Use Euler’s method for \(y'=t+y\), \(y(0)=1\), to approximate \(y(1)\) using four equal steps. First, the interval length is \(1-0=1\), so \(h=1/4=0.25\). The number of steps is \(1/0.25=4\), as required.
At \(t_0=0\), \(y_0=1\), the slope is \(f(0,1)=0+1=1\). Thus \(y_1=1+0.25(1)=1.25\), at \(t_1=0.25\).
At \(t_1=0.25\), \(y_1=1.25\), the slope is \(f(0.25,1.25)=0.25+1.25=1.5\). Thus \(y_2=1.25+0.25(1.5)=1.25+0.375=1.625\), at \(t_2=0.50\).
At \(t_2=0.50\), \(y_2=1.625\), the slope is \(f(0.50,1.625)=0.50+1.625=2.125\). Thus \(y_3=1.625+0.25(2.125)=1.625+0.53125=2.15625\), at \(t_3=0.75\).
At \(t_3=0.75\), \(y_3=2.15625\), the slope is \(f(0.75,2.15625)=0.75+2.15625=2.90625\). Thus \(y_4=2.15625+0.25(2.90625)=2.15625+0.7265625=2.8828125\), at \(t_4=1.00\).
Check: Four time updates give \(t_4=0+4(0.25)=1\), exactly the target. The final solution approximation is \(y(1)\approx 2.8828125\) by this Euler calculation.
Worked Example: Reaching a Target in a Decay Model
A quantity \(P\), measured in milligrams, satisfies \(P'=-0.2P\), with \(P(0)=100\). Use a one-year step to approximate the quantity at \(T=3\) years. The interval is \(3-0=3\) years, so \(N=3/1=3\) steps. Each slope has units of milligrams per year, and multiplying by the one-year step gives a change in milligrams.
At \(t_0=0\), \(P_0=100\), the slope is \(-0.2(100)=-20\) milligrams per year. The update is \(P_1=100+1(-20)=80\) milligrams, at \(t_1=1\).
At \(t_1=1\), \(P_1=80\), the slope is \(-0.2(80)=-16\) milligrams per year. The update is \(P_2=80+1(-16)=64\) milligrams, at \(t_2=2\).
At \(t_2=2\), \(P_2=64\), the slope is \(-0.2(64)=-12.8\) milligrams per year. The update is \(P_3=64+1(-12.8)=51.2\) milligrams, at \(t_3=3\).
Check: The three time updates give \(t_3=0+3(1)=3\) years. The Euler approximation at the target is \(P(3)\approx 51.2\) milligrams.
Worked Example: Starting at a Nonzero Time
For \(y'=2t-y\) with \(y(2)=3\), use \(h=0.5\) to approximate the solution at \(T=5\). The interval length is \(5-2=3\), so \(N=3/0.5=6\) steps.
At \(t_0=2\), \(y_0=3\), the slope is \(2(2)-3=1\), so \(y_1=3+0.5(1)=3.5\), at \(t_1=2.5\).
At \(t_1=2.5\), \(y_1=3.5\), the slope is \(2(2.5)-3.5=1.5\), so \(y_2=3.5+0.5(1.5)=4.25\), at \(t_2=3\).
At \(t_2=3\), \(y_2=4.25\), the slope is \(2(3)-4.25=1.75\), so \(y_3=4.25+0.5(1.75)=5.125\), at \(t_3=3.5\).
At \(t_3=3.5\), \(y_3=5.125\), the slope is \(2(3.5)-5.125=1.875\), so \(y_4=5.125+0.5(1.875)=6.0625\), at \(t_4=4\).
At \(t_4=4\), \(y_4=6.0625\), the slope is \(2(4)-6.0625=1.9375\), so \(y_5=6.0625+0.5(1.9375)=7.03125\), at \(t_5=4.5\).
At \(t_5=4.5\), \(y_5=7.03125\), the slope is \(2(4.5)-7.03125=1.96875\), so \(y_6=7.03125+0.5(1.96875)=8.015625\), at \(t_6=5\).
Check: The time formula gives \(t_6=2+6(0.5)=5\). Therefore the target approximation is \(y(5)\approx 8.015625\).
Common Mistake: Rounding the Number of Steps
Suppose \(y'=y\), \(y(0)=1\), and the target is \(T=1\), but the proposed step size is \(h=0.3\). The quotient is \((1-0)/0.3=10/3\), which is not an integer. Three steps end at \(t_3=0+3(0.3)=0.9\); four steps end at \(t_4=0+4(0.3)=1.2\). Neither reaches \(1\).
A mistaken approach is to round \(10/3\) to \(3\) and report the three-step value as the approximation at \(t=1\). That value belongs to \(t=0.9\), not \(t=1\). The endpoint cannot be corrected just by labeling the last row differently.
To use equal steps and reach \(1\), choose an integer step count first. For example, with \(N=4\), take \(h=(1-0)/4=0.25\). For this slope rule, the updates are \(y_{n+1}=y_n+0.25y_n=1.25y_n\). Starting from \(y_0=1\), they give \(y_1=1.25\), \(y_2=1.5625\), \(y_3=1.953125\), and \(y_4=2.44140625\). The time is \(t_4=0+4(0.25)=1\), so the last value is correctly assigned to the target.
What to Check Before Reporting an Approximation
Before giving an Euler approximation at a target time, make three separate checks:
- Step count: Does \((T-t_0)/h\) equal a positive integer?
- Update rule: Was each slope evaluated at the current pair \((t_n,y_n)\) and multiplied by \(h\)?
- Endpoint: Does the final time satisfy \(t_N=t_0+Nh=T\)?
These checks address different parts of the calculation. Correct solution updates do not guarantee that the chosen number of steps reaches the requested time. Likewise, a correct endpoint does not guarantee that the slopes and solution updates were computed correctly.
Check Your Understanding
For each question, identify the target-time condition before performing any solution updates.
- Starting at \(t_0=1\), how many steps of size \(0.5\) are needed to reach \(T=4\)?
- Starting at \(t_0=2\), can a step size \(h=0.4\) reach \(T=5\) in a whole number of equal steps? Show the quotient.
- For \(y'=t-y\), \(y(0)=2\), and \(h=0.5\), find the first Euler approximation and its time coordinate.
- If \(t_0=3\), \(T=7\), and you choose \(N=8\) equal steps, what step size should you use?
- Why is it incorrect to call a three-step result with \(t_0=0\) and \(h=0.3\) the Euler approximation at \(T=1\)?