Differential Equations › Section C · Second order differential equations › Topic C.8
Nonhomogeneous equations
Once an outside influence such as a driving force or an applied voltage appears, the equation is no longer homogeneous. Its solutions still have a simple structure: the system's own natural behaviour plus any one response to the input.
Adding an input
So far every equation in this section has had zero on the right-hand side, which describes a system left to itself. Push a swing, drive a circuit with a battery or shake a building with wind, and a forcing term appears:
with \(g\) not identically zero. This is a nonhomogeneous equation. Setting \(g = 0\) gives its associated homogeneous equation, which the earlier topics showed how to solve. This topic explains how the two are related; the next two topics, "Undetermined coefficients" and "Variation of parameters", give methods for the missing piece.
The key fact
Suppose \(Y_1\) and \(Y_2\) are two solutions of the nonhomogeneous equation. Substitute their difference into the left-hand side. Because derivatives respect differences, the result is the left side for \(Y_1\) minus the left side for \(Y_2\), which is \(g(t) - g(t) = 0\). So the difference of any two solutions of the nonhomogeneous equation solves the associated homogeneous equation. If \(y_1\) and \(y_2\) form a fundamental set for that homogeneous equation, as defined in "Fundamental sets and the Wronskian", then
for some constants. Nothing here needs constant coefficients.
The general solution
Fix one particular solution \(y_p\) of the nonhomogeneous equation. By the key fact, any other solution \(y\) differs from it by a homogeneous solution, so
Here \(y_c\) is the complementary solution, sometimes written \(y_h\); it carries the two arbitrary constants. The particular solution \(y_p\) has no arbitrary constants at all. In physical terms, \(y_c\) is the system's natural response and \(y_p\) is one response to the input. Solving a nonhomogeneous equation therefore takes three steps: solve the homogeneous equation, find any one particular solution, and add.
Worked example: a constant input
Solve \(y'' + y' - 2y = 4\) with \(y(0) = 0\) and \(y'(0) = 3\). 1. Homogeneous: \(r^2 + r - 2 = (r + 2)(r - 1)\), so \(y_c = c_1e^t + c_2e^{-2t}\). 2. Particular: a constant \(y_p = A\) has zero derivatives, so \(-2A = 4\) and \(A = -2\). 3. General: \(y = c_1e^t + c_2e^{-2t} - 2\). 4. Conditions: \(c_1 + c_2 - 2 = 0\) and \(c_1 - 2c_2 = 3\). 5. Subtracting gives \(3c_2 = -1\), so \(c_2 = -\frac{1}{3}\) and \(c_1 = \frac{7}{3}\). 6. Answer:
7. Check: \(y(0) = \frac{7}{3} - \frac{1}{3} - 2 = 0\) and \(y'(0) = \frac{7}{3} + \frac{2}{3} = 3\).
Initial conditions go on the whole solution
The constants must be found after \(y_p\) has been added, because the particular solution contributes to both \(y(t_0)\) and \(y'(t_0)\). In the example above, applying the conditions to \(y_c\) alone would give \(c_1 + c_2 = 0\) and \(c_1 - 2c_2 = 3\), so \(c_1 = 1\) and \(c_2 = -1\), and the resulting function \(e^t - e^{-2t} - 2\) starts at \(-2\), not 0. This is one of the most common errors in the whole section, and the habit that prevents it is simple: write the complete general solution first, then differentiate it, then substitute.
Worked example: a linear input
Show that \(y_p = 2t\) solves \(y'' + 4y = 8t\), then solve with \(y(0) = 1\) and \(y'(0) = 0\). 1. Check: \(y_p'' = 0\), so the left side is \(0 + 4(2t) = 8t\). 2. Homogeneous: \(r^2 + 4 = 0\) gives \(r = \pm 2i\), so \(y_c = c_1\cos 2t + c_2\sin 2t\). 3. General: \(y = c_1\cos 2t + c_2\sin 2t + 2t\). 4. \(y(0) = c_1 = 1\). 5. \(y' = -2c_1\sin 2t + 2c_2\cos 2t + 2\), so \(y'(0) = 2c_2 + 2 = 0\) and \(c_2 = -1\). 6. Answer: \(y = \cos 2t - \sin 2t + 2t\). The solution oscillates about the line \(2t\), which is the forced part; the oscillation is the natural part.
Particular solutions are not unique
The word "particular" means one specific solution, not a special one. Adding any homogeneous solution to \(y_p\) gives another valid particular solution. For \(y'' + 4y = 8t\), both \(2t\) and \(2t + 5\sin 2t\) work, because \(5\sin 2t\) contributes zero to the left side. Different choices of \(y_p\) simply shift the values of \(c_1\) and \(c_2\); the final answer to an initial value problem is the same, as uniqueness guarantees. In practice, choose the simplest \(y_p\) you can find, and drop any parts of it that already belong to \(y_c\).
Splitting the input
Inputs often come as sums, and linearity lets them be handled one piece at a time. If \(Y_1\) solves the equation with right side \(g_1\), and \(Y_2\) solves it with right side \(g_2\), then \(Y_1 + Y_2\) solves it with right side \(g_1 + g_2\), and \(kY_1\) handles \(kg_1\). For \(y'' + 4y = 8t + 12\), the piece \(8t\) has \(y_p = 2t\), and the constant 12 has \(y_p = 3\), since \(4 \cdot 3 = 12\). So \(y_p = 2t + 3\). This is superposition for inputs; unlike the homogeneous version, the right-hand sides must add up to the given forcing.
Common mistakes to avoid
First, applying the initial conditions to \(y_c\) before adding \(y_p\). Second, treating a sum of two solutions of the nonhomogeneous equation as a solution of the same equation: it solves the equation with \(2g(t)\) on the right. Third, putting arbitrary constants into \(y_p\); the two constants belong to \(y_c\) only. Fourth, forgetting \(y_c\) altogether and reporting \(y_p\) as the general solution. Fifth, assuming every particular solution must look the same; any two differ by a homogeneous solution.
Key takeaways
A nonhomogeneous equation \(y'' + py' + qy = g\) has the associated homogeneous equation with \(g = 0\). The difference of two nonhomogeneous solutions solves the homogeneous one, so the general solution is \(y = y_c + y_p\): the complementary solution with two constants plus any one particular solution. Fit initial conditions to the full \(y\). Particular solutions are not unique, and a sum of inputs can be handled by adding the particular solutions for each piece.
Flashcards
Flashcard
y″ + p(t)y′ + q(t)y = g(t) with g not zero
Test your understanding
Question 1 of 5
What is the general solution of y″ − y = 3?
Question 2 of 5
Y₁ and Y₂ both solve y″ + p(t)y′ + q(t)y = g(t). What can be said about Y₁ − Y₂?
Question 3 of 5
Solve y″ + 9y = 18 with y(0) = 0 and y′(0) = 3.
Question 4 of 5
−t solves y″ − y = t, and e^(2t)/3 solves y″ − y = e^(2t). Which function solves y″ − y = 2t − e^(2t)?
Question 5 of 5
y_p = 2t is a particular solution of y″ + 4y = 8t. Which of these is also a particular solution?
