From Acceleration to Two First-Order Equations
A second-order differential equation describes how a quantity’s acceleration depends on time, position, and velocity. To approximate its solution with Euler’s method, we track position and velocity together. This turns the problem into a system of two first-order equations, to which the Euler update can be applied component by component.
Let \(x(t)\) denote position, so that \(x'(t)\) is velocity and \(x''(t)\) is acceleration. Suppose the equation and initial data are given in the form
The initial position is \(x_0\), and the initial velocity is \(v_0\). We introduce a new variable \(v=x'\). Then \(x'=v\), while the original equation says \(v'=f(t,x,v)\). Thus position and velocity satisfy a coupled first-order system.
This conversion does not change the motion being described. It records the same information in two variables: the rate of change of position is velocity, and the rate of change of velocity is acceleration.
The Euler Updates for Position and Velocity
Let \(h>0\) be the step size and define the grid times \(t_n=t_0+nh\), for nonnegative integers \(n\). Write \(x_n\) and \(v_n\) for the Euler approximations to position and velocity at time \(t_n\). At each step, evaluate both rates using the current approximations \(t_n,x_n,v_n\).
The first formula uses the current velocity as the slope of position. The second uses the current acceleration as the slope of velocity. Both updates use the same current state; neither formula uses a value that has just been updated during that step.
These are precisely the componentwise forward Euler updates for the first-order system. If the acceleration is written as a formula involving position and velocity, substitute the current approximations into that formula before calculating the next velocity.
Why the Conversion and Updates Work
The conversion follows directly from the meaning of velocity and acceleration. Define \(v(t)=x'(t)\). Differentiating this definition gives \(v'(t)=x''(t)\). Substituting the second-order equation yields \(v'(t)=f(t,x(t),v(t))\), while the definition itself gives \(x'(t)=v(t)\). The initial values for the system are \(x(t_0)=x_0\) and \(v(t_0)=x'(t_0)=v_0\).
To see why the Euler updates have the stated form, use the derivative approximation \(u(t+h)\approx u(t)+h u'(t)\) for a differentiable quantity \(u\). Apply it first to position, whose derivative is velocity, and then to velocity, whose derivative is acceleration. At time \(t_n\), replace the exact values by their current approximations:
Replacing \(x(t_n)\) and \(v(t_n)\) by \(x_n\) and \(v_n\), and using \(t_{n+1}=t_n+h\), gives the two updates. The approximation is made in each component using the system’s rates at the start of the step. This derivation explains both why the method applies and why the current state must be used in both formulas.
Worked Examples
Worked Example: Euler Approximation for Falling Motion
A falling object has acceleration \(x''=-10\) metres per second squared. At time \(t_0=0\), its position is \(x_0=20\) metres and its velocity is \(v_0=0\) metres per second. Use \(h=0.2\) seconds to approximate its position and velocity at \(t=0.6\) seconds.
Here \(f(t,x,v)=-10\). The Euler updates are \(x_{n+1}=x_n+0.2v_n\) and \(v_{n+1}=v_n+0.2(-10)=v_n-2\).
Step 1, from \(t_0=0\) to \(t_1=0.2\):
Step 2, from \(t_1=0.2\) to \(t_2=0.4\): Use the current values \(x_1=20\) and \(v_1=-2\).
Step 3, from \(t_2=0.4\) to \(t_3=0.6\):
Check: Each velocity change is \(0.2(-10)=-2\) metres per second, as required by the constant acceleration. Each position change is \(0.2\) times the velocity at the start of that step: \(0\), \(-0.4\), and \(-0.8\) metres. The approximation at \(t=0.6\) is \(x_3=18.8\) metres and \(v_3=-6\) metres per second.
Worked Example: Time-Dependent Acceleration with Damping
Consider \(x''=t-x'-2x\), with \(x(0)=1\), \(x'(0)=0\). Use \(h=0.25\) to approximate position and velocity at \(t=0.5\). Set \(v=x'\), so the acceleration function is \(f(t,x,v)=t-v-2x\).
Initially, \(t_0=0\), \(x_0=1\), and \(v_0=0\). The initial acceleration is
Therefore the first Euler step gives
Now \(t_1=0.25\). Evaluate the acceleration using the current values, not the initial ones:
The second step is
Check: The time grid is \(0,0.25,0.5\), so these are the approximations at the requested time. The position increment in the second step is \(0.25v_1=-0.125\), and the velocity increment is \(0.25(-1.25)=-0.3125\), matching the computed values. Thus \(x(0.5)\approx0.875\) and \(x'(0.5)\approx-0.8125\) by this Euler calculation.
Worked Example: A Spring Starting with Nonzero Velocity
For the model \(x''=-4x\), let \(x(0)=0\), \(x'(0)=2\), and use \(h=0.5\). Find the Euler approximations after two steps. Here \(f(t,x,v)=-4x\), so \(x_{n+1}=x_n+0.5v_n\) and \(v_{n+1}=v_n+0.5(-4x_n)\).
At the first step, \(x_0=0\) and \(v_0=2\), so
At the second step, use \(x_1=1\) and \(v_1=2\). The acceleration used is \(-4x_1=-4\), giving
Check: The computed times are \(t_1=0.5\) and \(t_2=1\). In the first step, position increases by \(0.5(2)=1\), and velocity changes by \(0.5(0)=0\). In the second, position increases by \(0.5(2)=1\), and velocity changes by \(0.5(-4)=-2\). The two-step approximation at \(t=1\) is \(x_2=2\), \(v_2=0\).
A Common Update-Order Mistake
A tempting but incorrect variation is to update velocity first and then use the new velocity to update position. That does not apply forward Euler to both components at the start of the step. For example, take \(x''=-2x\), \(x_0=1\), \(v_0=0\), and \(h=0.1\). The initial acceleration is \(-2(1)=-2\). Forward Euler gives
If the new velocity is incorrectly used to update position, the result would instead be \(x_1=1+0.1(-0.2)=0.98\). This is not the forward Euler position update: it uses the velocity at the end of the step instead of the velocity at the start. The correction is to calculate both new values from the old pair \((x_n,v_n)\), as in the two stated formulas.
Practical Checks Before Moving to the Next Step
For each step, keep the time, position, and velocity together. Evaluate the acceleration from the current time, position, and velocity; then calculate both increments. This is especially important when acceleration depends on time or velocity, since carrying forward an outdated value changes the calculation.
- Check that the time advances by \(h\) at every step.
- Check that the position increment is \(h v_n\), not \(h v_{n+1}\).
- Check that the acceleration is evaluated at \((t_n,x_n,v_n)\).
- Check units: multiplying velocity by time gives a position change, and multiplying acceleration by time gives a velocity change.
These checks verify that the numerical updates have been applied consistently. Euler values are approximations; the update calculation alone does not claim that they are exact values of the solution.
Check Your Understanding
For each question, identify the variables and apply the update rule using values from the start of each step.
- Rewrite \(x''=3t-x+2x'\) as a first-order system by defining \(v=x'\).
- For \(x''=-5\), \(x_0=4\), \(v_0=1\), and \(h=0.2\), calculate \(x_1\) and \(v_1\).
- For \(x''=t-v\), \(t_0=1\), \(x_0=2\), \(v_0=3\), and \(h=0.1\), find the acceleration used in the first step and calculate \(x_1,v_1\).
- Why must the position and velocity updates in a forward Euler step both use values from the same starting time?
- In the model \(x''=-4x\), suppose \(x_n=2\), \(v_n=-1\), and \(h=0.25\). Calculate \(x_{n+1}\) and \(v_{n+1}\).