Menu
Sign up Sign in

AI HL · AHL 9

Differential Equations

AHL 9.16

Second order equations: exact solutions, error and models

AHL 9.16

Second order equations: exact solutions, error and models

Target: I can use Euler's method on a second order equation with two step lengths and compare the estimates. (+5 more)

By the end of this section

Key points

Exact solution by eigenvalues

  • Write \(\frac{d^2x}{dt^2} + a\frac{dx}{dt} + bx = 0\) as a system with matrix \(\begin{pmatrix} 0 & 1 \\ -b & -a \end{pmatrix}\). Find the eigenvalues \(\lambda_1, \lambda_2\) from \(\lambda^2 + a\lambda + b = 0\).
  • An eigenvector for λ is \(\begin{pmatrix} 1 \\ \lambda \end{pmatrix}\). The general solution is \(\begin{pmatrix} x \\ y \end{pmatrix} = Ae^{\lambda_1 t}\begin{pmatrix} 1 \\ \lambda_1 \end{pmatrix} + Be^{\lambda_2 t}\begin{pmatrix} 1 \\ \lambda_2 \end{pmatrix}\), so \(x = Ae^{\lambda_1 t} + Be^{\lambda_2 t}\).
  • Use \(x(0)\) for the first equation and \(y(0) = x'(0)\) for the second to find A and B.

Checking an estimate or a given solution

  • Percentage error = \(\dfrac{|\text{estimate} - \text{exact}|}{|\text{exact}|} \times 100\). Divide by the exact value, not the estimate.
  • A smaller step length gives a smaller percentage error.
  • To verify a given function: differentiate it twice, substitute into the left side, and compare with the right side. Then check x(0) and x′(0) separately.

Reading Euler's graph

  • Amplitude: the height of a peak. Period: the time between two peaks. Give both to 2 significant figures when asked.
  • For an undamped oscillation such as \(\frac{d^2x}{dt^2} + 4x = 0\) the true amplitude stays the same, but Euler's peaks grow. Read the first peak, and a smaller step length reduces the growth.
  • A forced oscillation has a driving term on the right. Run Euler from rest for the whole window and read the largest x. The motion is largest when the driving frequency is close to the natural frequency.

Commenting on a model

  • Compare the output with what the quantity can really do: a population or a concentration cannot be negative, and a price does not follow a smooth wave for ever.
  • Name the quantity and the problem in your answer: “the model gives a negative population, which is impossible”.
  • For a long-term value, read the level the graph settles at. Give it to the accuracy asked.

On the calculator

Euler's method for a second order equation

  • Set up three columns for t, x and y. The first row holds t = 0, x(0) and y(0) = x′(0).
  • Each next row: t plus h, x plus h times y, y plus h times the right side of dy/dt. The right side uses x, y and t from the row above.
  • Fill down to the time you need. For two step lengths, change h in one cell and fill down again.

Screenshot and video to come

Graphing the output and reading peaks

  • Plot x against t as a scatter plot with the points joined.
  • Use the graph's maximum tool, or read down the x column, to find the largest value and the t where it happens.
  • For a period, find the t of two successive peaks and subtract.

Screenshot and video to come

Evaluating the exact solution

  • Type the exact solution as a function of t.
  • Evaluate it at the time you need, then use the exact value in the percentage error.

Screenshot and video to come

Worked examples

Problems like the ones in class. Pick one, try it, then open the working.
Two step lengths

A function satisfies \(\frac{d^2x}{dt^2} - 0.9\frac{dx}{dt} + 0.14x = 0\), with x(0) = 1.5 and x′(0) = 0.4. Use Euler's method to estimate x(3) with step length (a) 0.5 and (b) 0.1.

Working
  1. The pair

    \(\frac{dx}{dt} = y,\quad \frac{dy}{dt} = 0.9y - 0.14x\)

    Let y = dx/dt. Starting values x_0 = 1.5 and y_0 = 0.4.

  2. Recurrences, h = 0.5

    \(x_{n+1} = x_n + 0.5y_n,\quad y_{n+1} = y_n + 0.5(0.9y_n - 0.14x_n)\)

    t = 3 is 6 steps.

  3. From the calculator, h = 0.5

    x_6 = 3.5137

  4. Recurrences, h = 0.1

    \(x_{n+1} = x_n + 0.1y_n,\quad y_{n+1} = y_n + 0.1(0.9y_n - 0.14x_n)\)

    t = 3 is 30 steps.

  5. From the calculator, h = 0.1

    x_30 = 3.8772

    The two estimates differ: the smaller step is more accurate.

Video walkthrough coming
The exact solution

For \(\frac{d^2x}{dt^2} - 0.9\frac{dx}{dt} + 0.14x = 0\) with x(0) = 1.5 and x′(0) = 0.4, write the equation as a system, find the exact solution and use it to find x(3).

Working
  1. System and matrix

    \(\frac{dx}{dt} = y,\quad \frac{dy}{dt} = 0.9y - 0.14x;\quad \begin{pmatrix} 0 & 1 \\ -0.14 & 0.9 \end{pmatrix}\)

    dy/dt = 0.9y − 0.14x.

  2. Eigenvalues

    \(\lambda^2 - 0.9\lambda + 0.14 = 0,\quad \lambda = 0.2 \text{ or } 0.7\)

    From the calculator.

  3. Eigenvectors

    \(\lambda = 0.2: \begin{pmatrix} 1 \\ 0.2 \end{pmatrix};\quad \lambda = 0.7: \begin{pmatrix} 1 \\ 0.7 \end{pmatrix}\)

    An eigenvector for λ is (1, λ).

  4. General solution

    \(x = Ae^{0.2t} + Be^{0.7t},\quad y = 0.2Ae^{0.2t} + 0.7Be^{0.7t}\)

    x is the top line.

  5. Use the starting values

    \(A + B = 1.5,\quad 0.2A + 0.7B = 0.4\) gives \(A = 1.3,\ B = 0.2\)

    Solve the pair on the calculator.

  6. Evaluate

    \(x = 1.3e^{0.2t} + 0.2e^{0.7t}\), so \(x(3) = 4.00\)

    Compare with the estimates: 3.51 and 3.88.

Video walkthrough coming
Percentage error

The exact value is x(3) = 4.002, to 4 significant figures. Find the percentage error of the Euler estimate with step length 0.5, which is 3.514, to 4 significant figures.

Working
  1. The error

    |3.514 − 4.002| = 0.488

    Subtract the estimate from the exact value.

  2. As a percentage of the exact value

    \(\dfrac{0.488}{4.002} \times 100 = 12.2\%\)

    Divide by the exact value.

  3. The smaller step

    step length 0.1: 3.12%

    A smaller step length gives a smaller percentage error.

Video walkthrough coming
Amplitude and period from a sketch

A mass on a spring has displacement x cm after t seconds, where \(\frac{d^2x}{dt^2} + 4x = 0\), with x(0) = 0 and x′(0) = 2. Use Euler's method with step length 0.1 to sketch the motion for 0 ≤ t ≤ 5. Estimate the amplitude and the period to 2 significant figures, using the first two peaks.

12345−2−1123tx
Working
  1. The pair

    \(\frac{dx}{dt} = y,\quad \frac{dy}{dt} = -4x\)

    Starting values x_0 = 0 and y_0 = 2.

  2. Sketch

    oscillation with peaks at t = 0.8 and t = 4.0

    From the table, x first peaks at 1.17.

  3. Amplitude

    first peak: 1.2

    Euler's second peak is higher (2.2), but the true motion keeps one amplitude. Use the first peak.

  4. Period

    4.0 − 0.8 = 3.2 s

    The time between two successive peaks.

Video walkthrough coming
A forced oscillation

A glass on a vibrating table has displacement x mm after t seconds, where \(\frac{d^2x}{dt^2} + 0.5\frac{dx}{dt} + 6x = 3\cos(\omega t)\). The glass starts at rest at x = 0. Use Euler's method with step length 0.1 to estimate the maximum displacement in the first 10 seconds when (a) ω = 1 and (b) ω = 2.4.

Working
  1. The pair (ω = 1)

    \(\frac{dx}{dt} = y,\quad \frac{dy}{dt} = -0.5y - 6x + 3\cos t\)

    x_0 = 0 and y_0 = 0.

  2. Run to t = 10

    100 steps; largest x = 1.42 at t = 6.5

    Radian mode. Read the largest x in the table.

  3. The pair (ω = 2.4)

    \(\frac{dx}{dt} = y,\quad \frac{dy}{dt} = -0.5y - 6x + 3\cos 2.4t\)

    Same recurrences with the new driving term.

  4. Run to t = 10

    largest x = 6.53 at t = 8.5

    About 4.6 times larger.

  5. Conclusion

    ω = 2.4 gives the larger motion

    The natural frequency is √6 ≈ 2.45, and 2.4 is close to it.

Video walkthrough coming
A share price model

An analyst models the price p dollars of a share, t years from now, by \(\frac{d^2p}{dt^2} + 0.6\frac{dp}{dt} + 2.5p = 10 - 2e^{-0.3t}\). The price is now 5 dollars and is falling at 2 dollars per year. Use Euler's method with step length 0.1 to find, to 1 decimal place, according to the model: (a) when to buy, (b) how long to hold the share, (c) the profit per share, (d) the long-term price. (e) Suggest why the model is unlikely to be accurate.

1234567812345tp
Working
  1. The pair

    \(\frac{dp}{dt} = v,\quad \frac{dv}{dt} = -0.6v - 2.5p + 10 - 2e^{-0.3t}\)

    Let v = dp/dt. Starting values p_0 = 5 and v_0 = −2.

  2. Run the table and graph p

    lowest price 1.88 at t = 1.5; highest 4.84 at t = 3.6

    The price falls, rises, then settles.

  3. (a) and (b)

    buy at t = 1.5; hold for 3.6 − 1.5 = 2.1 years

    Buy at the lowest price and sell at the next peak.

  4. (c) and (d)

    profit = 4.84 − 1.88 = 3.0 dollars; long-term price 4.0 dollars

    The graph levels off near 4. At t = 20 the table gives 4.04.

  5. (e) Comment

    unlikely to be accurate

    The price rises and falls in a regular, smooth wave and ends at a fixed level. Real prices are affected by news and chance, so they would not follow a rule like this.

Video walkthrough coming
A nonlinear equation

Consider \(\frac{d^2x}{dt^2} + x\frac{dx}{dt} + x = 2 + t^2 + 2t^3\), with x(0) = 0 and x′(0) = 0. (a) Use Euler's method with step length 0.1 to estimate x(1) and x(2). (b) Show that x = t² satisfies the equation and the starting values. (c) Hence find the percentage error in your estimate of x(2).

Working
  1. The pair

    \(\frac{dx}{dt} = y,\quad \frac{dy}{dt} = 2 + t^2 + 2t^3 - xy - x\)

    The equation is not linear, but Euler's method still works.

  2. (a) From the calculator

    x(1) ≈ 0.921, x(2) ≈ 3.94

    t = 2 is row 20.

  3. (b) Substitute x = t²

    \(x' = 2t,\ x'' = 2:\quad 2 + t^2(2t) + t^2 = 2 + 2t^3 + t^2\), which is the right side

    The left side matches the right side.

  4. (b) Starting values

    \(x(0) = 0^2 = 0,\quad x'(0) = 2(0) = 0\)

    Both starting values match.

  5. (c) Exact value and error

    \(x(2) = 4;\quad \dfrac{|3.9410 - 4|}{4} \times 100 = 1.48\%\)

    Divide by the exact value.

Video walkthrough coming