Every earlier lesson on this course ended by fitting two constants, and each did it in one line. This lesson shows that the lines are one computation. The unknowns are C₁ and C₂, the data are the starting value y(0) and the starting rate y′(0), and the equations come from putting t = 0 in the general solution and in its rate.
real roots r₁, r₂: C₁ + C₂ = y(0)
r₁·C₁ + r₂·C₂ = y′(0)
repeated root r: C₁ = y(0)
r·C₁ + C₂ = y′(0)
complex α ± βi: C₁ = y(0)
α·C₁ + β·C₂ = y′(0)
Read the second line of each pair as “the rate at the start”. For two exponentials it adds the roots in proportion to the constants. For the repeated root, the product rule on (C₁ + C₂·t)·e^(rt) at t = 0 gives r·C₁ + C₂. For the complex pair, the product rule on the exponential and the cosine and sine at t = 0 gives α·C₁ + β·C₂.
Eliminating, once, for two real roots
Multiply the first equation by r₂ and subtract it from the second, then multiply the first by r₁ and subtract the second from it. The unknowns separate.
(r₁ − r₂)·C₁ = y′(0) − r₂·y(0)
(r₁ − r₂)·C₂ = r₁·y(0) − y′(0)
The factor r₁ − r₂ is why the roots have to differ. If they are different it is not zero and may be divided out, so there is exactly one pair C₁, C₂ for every starting value and rate. If they are equal the two exponentials are one function, and the repeated-root form takes over.
Example · The lab's first presetFor y″ + 3y′ + 2y = 0 the roots are r₁ = −1 and r₂ = −2, so r₁ − r₂ = 1. With y(0) = 0 and y′(0) = 1, the first formula gives C₁ = (1 − 0)/1 = 1 and the second C₂ = (0 − 1)/1 = −1.
The solution is e^(−t) − e^(−2t). It starts at 0 and is positive afterwards, with a starting rate of 1: the rate at the start is not the rate of the number 0.
A complex fit
For y″ + 2y′ + 5y = 0 the roots are −1 ± 2i, so the pair is C₁ = y(0) and −C₁ + 2·C₂ = y′(0). Take y(0) = 2 and y′(0) = 0. Then C₁ = 2 and −2 + 2·C₂ = 0, so C₂ = 1, and the solution is e^(−t)·(2·cos(2t) + sin(2t)). Its rate at 0 is zero because two effects cancel exactly: the exponential pulls it down by 2 and the sine pushes it up by 2. The rate is not zero because y(0) happens to be a constant.
When the lab declines
For y″ − y′ − y = 0 the roots are (1 ± √5)/2. The two equations are exactly as above, and they have a solution; by hand it is C₁ = (5 − √5)/10 and C₂ = (5 + √5)/10 for y(0) = 1 and y′(0) = 0, and the first equation checks, since the two add to 1. The constants contain √5, though, and the lab fits rational constants only. It prints a dash in the constants tile and the solution tile and says in its status line that the roots are irrational.
That is a limit of the arithmetic. The lab differentiates and substitutes solutions whose exponents and constants are fractions, which it can do without rounding; a surd in an exponent or a constant would have to be rounded, and then the residual would be a rounded number instead of a zero. A complex pair whose β is a surd is declined for the same reason, as in y″ + 3y = 0 with the roots ±√3·i, and the status line names the irrational frequency. The method is the same for any roots, and a solution with irrational constants is a perfectly good one.