Take y″ + 3y′ + 2y = 4 with y(0) = 0 and y′(0) = 0. The forcing is constant, so the first route guesses a constant. If y_p = K, then y_p′ = 0 and y_p″ = 0, and the equation reads 2K = 4, so y_p = 2. The homogeneous equation has the characteristic roots −1 and −2, so y_h = C₁·e^(−t) + C₂·e^(−2t). The general solution is y = 2 + C₁·e^(−t) + C₂·e^(−2t).
Fitting the constants takes two equations. From y(0) = 0: 2 + C₁ + C₂ = 0, so C₁ + C₂ = −2. From y′(0) = 0, with y′ = −C₁·e^(−t) − 2C₂·e^(−2t): −C₁ − 2C₂ = 0. Adding the two equations gives −C₂ = −2, so C₂ = 2 and C₁ = −4.
The second route starts at the same equation. Transforming gives (s² + 3s + 2)·Y = 4/s, so Y = 4/(s·(s + 1)·(s + 2)). The roots give the coefficients: 4/(1·2) = 2 at s = 0, 4/((−1)·1) = −4 at s = −1, and 4/((−2)·(−1)) = 2 at s = −2. So Y = 2/s − 4/(s + 1) + 2/(s + 2), and the table backwards gives y = 2 − 4·e^(−t) + 2·e^(−2t).
undetermined coefficients: y = 2 − 4e^(−t) + 2e^(−2t)
Laplace transform: y = 2 − 4e^(−t) + 2e^(−2t)
The same function from two directions. The lab prints this solution and its residual in the original equation and starting values, residual 0, so the check does not rest on reading two lines and judging them alike.
Theorem · The routes agreeIf y₁ and y₂ both satisfy y″ + 3y′ + 2y = 4 with y(0) = 0 and y′(0) = 0, then y₁ = y₂.
Let d = y₁ − y₂. Because the equation is linear, the 4 cancels and d satisfies the homogeneous equation, with d(0) = 0 and d′(0) = 0.
So d = C₁·e^(−t) + C₂·e^(−2t), and the starting values give C₁ + C₂ = 0 and −C₁ − 2C₂ = 0. Adding them gives −C₂ = 0, so C₂ = 0 and C₁ = 0. The other kinds of root end the same way, because the 2×2 system for the constants has a nonzero determinant, the Wronskian at 0 of “Superposition and the Wronskian” in Second-Order Linear Equations.
□
A third route for a first-order equation
The equation y′ + 2y = e^t with y(0) = 0 has a third route, the integrating factor. With μ = e^(2t) the left side times μ is (e^(2t)·y)′, and the right side is e^(3t). So e^(2t)·y = e^(3t)/3 + C, and y(0) = 0 gives C = −1/3. The result is y = e^t/3 − e^(−2t)/3.
The transform gives (s + 2)·Y = 1/(s − 1), so Y = 1/((s − 1)(s + 2)). At s = 1 the coefficient is 1/3, and at s = −2 it is −1/3. Undetermined coefficients guesses A·e^t: A + 2A = 1, so A = 1/3, and the starting value gives the constant −1/3. All three return e^t/3 − e^(−2t)/3.
For the cosine-force preset, y″ + 4y = 3cos(t) from rest, undetermined coefficients guesses A·cos(t): −A + 4A = 3, so A = 1, and the starting values give C₁ = −1 and C₂ = 0. The transform gives Y = 3s/((s² + 1)(s² + 4)) = s/(s² + 1) − s/(s² + 4). Both give y = cos(t) − cos(2t).
When to choose which
- Undetermined coefficients is shortest when the forcing is one of the shapes it guesses, and when what you want is the long-run response, the particular solution itself.
- The transform is shortest when the forcing switches on or off, since the step is one factor, and when the starting values are not zero, since they go in at the first line.
- The integrating factor needs a first-order equation, and then works for any forcing that can be integrated against μ.
- Substitution is not a method but a referee. Whichever route is used, put the answer in the equation and its starting values.