Harmonic oscillators such as a spring-mass system (Subsection1.1.3) or an RLC circuit (Section2.1) can be modeled with second-order linear differential equations. Indeed, we can model a spring-mass system with the equation
\begin{equation*}
mx''(t) + b x'(t) +k x(t) = g(t),
\end{equation*}
where \(m\) is the mass, \(b\) is the damping coefficient, \(k\) is the spring constant, and \(F(t) = g(t)\) represents some external force applied to our system. RLC circuits can also be modeled to provide another example of forcing. If \(I(t)\) is the rate at which a charge flows through a circuit (measured in amperes or amps), \(R\) is the resistance (measured in ohms), \(C\) is the capacitance (measured in farads), and the inductance, \(L\text{,}\) is (measured in henrys), then the derivative of the impressed voltage (measured in volts), \(E(t)\text{,}\) is the forcing term
\begin{equation*}
L I'' + RI' + \frac{1}{C} I = E'(t).
\end{equation*}
What is different about these two equations from those that we considered in Section2.1 is that the terms on the righthand side, \(g(t)\) and \(E'(t)\text{,}\) are not zero. Such a term is called a forcing term.
Subsection2.2.1Nonhomogeneous Equations
A nonhomogeneous second-order linear differential equation is an equation of the form
\begin{equation*}
x'' +p(t) x' + q(t) x = g(t).
\end{equation*}
We have already seen how examples of such equations arise when examining models of harmonic oscillators with forcing terms. Our goal is to be able to solve such equations. In general, these equations can be difficult to solve for an arbitrary function \(g(t)\text{.}\) Before we attempt to find solutions for some of the more common functions that might occur for \(g(t)\text{,}\) let us derive some fundamental facts about second-order linear differential equations.
Theorem2.2.1
Suppose that
\begin{equation}
x'' +p(t) x' + q(t) x = g(t)\label{secondorder02-equation-nonhomogeneous-difference}\tag{2.2.1}
\end{equation}
has solutions \(x_1 = x_1(t)\) and \(x_2 = x_2(t)\text{.}\) Then \(x_1(t) - x_2(t)\) is a solution of the homogeneous linear differential equation
\begin{equation*}
x'' +p(t) x' + q(t) x = 0.
\end{equation*}
Proof
Since \(x_1\) and \(x_2\) are solutions of (2.2.1), we know that
\begin{align*}
x_1'' +p(t) x_1' + q(t) x_1 & = g(t)\\
x_2'' +p(t) x_2' + q(t) x_2 & = g(t).
\end{align*}
Thus,
\begin{gather*}
\frac{d^2}{dt^2} (x_1 - x_2) + p(t) \frac{d}{dt} (x_1 - x_2) + q(t) (x_1 - x_2)\\
= \left( \frac{d^2 x_1}{dt^2} + p(t) \frac{dx_1}{dt} + q(t) x_1 \right) - \left( \frac{d^2 x_2}{dt^2} + p(t) \frac{dx_2}{dt} + q(t) x_2 \right)\\
= g(t) - g(t) = 0.
\end{gather*}
We can use Theorem2.2.1 to derive the fact that the general solution to
\begin{equation}
x'' +p(t) x' + q(t) x = g(t).\label{secondorder02-equation-nonhomogeneous}\tag{2.2.2}
\end{equation}
can be written in the form
\begin{equation*}
x = x_h + x_p,
\end{equation*}
where \(x_h\) is the general solution of the homogeneous equation
\begin{equation*}
x'' +p(t) x' + q(t) x = 0,
\end{equation*}
and \(x_p\) is any solution of (2.2.2). Indeed, suppose that \(x_q\) is another solution to (2.2.2). Then \(x_q - x_p\) is a solution to the homogeneous equation
\begin{equation*}
x'' +p(t) x' + q(t) x = 0.
\end{equation*}
Therefore,
\begin{equation*}
x_q - x_p =x_h
\end{equation*}
or
\begin{equation*}
x_q =x_h + x_p.
\end{equation*}
We state this fact in the following theorem.
Theorem2.2.2
Let \(x_p\) be a particular solution of the equation
\begin{equation*}
x'' +p(t) x' + q(t) x = g(t),
\end{equation*}
and \(x_h\) be the general solution of the corresponding homogeneous equation
\begin{equation*}
x'' +p(t) x' + q(t) x = 0.
\end{equation*}
Then the general solution to \(x'' +p(t) x' + q(t) x = g(t)\) is \(x = x_h + x_p\text{.}\)
Subsection2.2.2Forcing Terms
The equation
\begin{equation*}
m x'' + bx' + kx = g(t)
\end{equation*}
can be used to model a harmonic oscillator where forcing occurs. In general, we will not be able to solve this equation explicitly for a given \(g(t)\text{;}\) however, certain forcing functions often occur in practice. Some of the more important forcing functions are \(g(t) = e^{-at}\text{,}\) where the external force decreases exponentially over time; \(g(t) = k\text{,}\) where a constant force is applied; and \(g(t) = \cos \omega t\) or \(g(t) = \sin \omega t\text{,}\) where a force is applied periodically.
In the case of the unforced damped harmonic oscillator,
\begin{equation*}
m x'' + b x' + kx =0,
\end{equation*}
we know that \(m \gt 0\text{,}\) \(b \gt 0\text{,}\) and \(k \gt 0\text{.}\) Thus, we can rewrite this equation as
\begin{equation*}
x'' + px' + q x = 0,
\end{equation*}
where \(p = b/m\) and \(q = k/m\) are both positive. The characteristic equation is \(\lambda^{2} + p\lambda + q = 0\text{,}\) and the roots are
\begin{equation*}
\lambda_{1} = \frac{-p + \sqrt{p^{2}-4q}}{2} \quad \text{and} \quad \lambda_{2} = \frac{-p - \sqrt{p^{2}-4q}}{2}.
\end{equation*}
As we know from Theorem2.1.10, there are three distinct possibilities for the general solution, corresponding to whether \(p^{2}-4q\) is positive, zero, or negative. Explicitly, general solutions for the undamped harmonic oscillator are given by
\begin{equation*}
x(t)= \begin{cases}
c_{1}e^{\lambda_{1} t} + c_{2}e^{\lambda_{2} t} \quad & p^{2}-4q \gt 0 \\
c_{1}e^{\alpha t} + c_{2}te^{\alpha t} \quad & p^{2}-4q =0 \\
c_{1}e^{\alpha t}\cos(\beta t) + c_{2}e^{\alpha t}\sin(\beta t) \quad & p^{2} - 4q \lt 0
\end{cases}
\end{equation*}
where \(\alpha = -\frac{p}{2}\) and \(\beta = \frac{\sqrt{4q - p^{2}}}{2}\text{.}\) Since \(p \gt 0\text{,}\) \(\alpha \lt 0\text{,}\) and thus for any constants \(c_{1}\) and \(c_{2}\) we have
\begin{equation*}
\lim_{t \to \infty}(c_{1}e^{\alpha t} + c_{2}te^{\alpha t}) = \lim_{t \to \infty}(c_{1}e^{\alpha t}\cos(\beta t) + c_{2}e^{\alpha t}\sin(\beta t)) = 0.
\end{equation*}
Moreover, both \(\lambda_{1}\) and \(\lambda_{2}\) are strictly negative when \(p^{2}-4q \gt 0\text{.}\) (To see that this holds for \(\lambda_{1}\text{,}\) we must also note that \(q \gt 0\) in this setting.) So
\begin{equation*}
\lim_{t \to \infty}(c_{1}e^{\lambda_{1} t} + c_{2}e^{\lambda_{2} t}) = 0
\end{equation*}
as well, for any constants \(c_{1}\) and \(c_{2}\text{.}\)
It follows that if \(x_{h}\) is the general solution to the homogeneous equation \(x'' + px' + qx = 0\text{,}\) then \(x_{h} \to 0\) as \(t \to \infty\text{.}\) Therefore, we have the following result.
Theorem2.2.3
Suppose
\begin{equation*}
x'' + px' + q x = g(t)
\end{equation*}
has solution \(x = x_h + x_p\text{,}\) where \(p \gt 0\) and \(q \gt 0\text{.}\) If
\begin{equation*}
x = x_h + x_p
\end{equation*}
is the general solution to the equation, then
\begin{equation*}
x = x_h + x_p \to x_p
\end{equation*}
as \(t \to \infty\text{.}\)
In other words, all solutions of a damped harmonic oscillator with nonzero damping are essentially the same for large values of \(t\text{.}\)