Linear Second Order ODE/y'' + 2 b y' + a^2 y = K cosine omega x/b less than a

Theorem
The second order ODE:
 * $(1): \quad y'' + 2 b y' + a^2 y = K \cos \omega x$

has the general solution:
 * $y = e^{-b t} \left({C_1 \cos \alpha x + C_2 \sin \alpha x}\right) + e^{-b x} \left({C_1 \cos \alpha x + C_2 \sin \alpha x}\right) + \dfrac K {\left({a^2 - \omega^2}\right)^2 + 4 b^2 \omega^2} \left({2 b \omega \sin \omega x + \left({a^2 - \omega^2}\right) \cos \omega x}\right)$

where:
 * $\alpha = \sqrt {a^2 - b^2}$

Proof
It can be seen that $(1)$ is a nonhomogeneous linear second order ODE with constant coefficients in the form:
 * $y'' + p y' + q y = R \left({x}\right)$

where:
 * $p = 2 b$
 * $q = a^2$
 * $R \left({x}\right) = K \cos \omega x$

First we establish the solution of the corresponding constant coefficient homogeneous linear second order ODE:
 * $y'' + 2 b y' + a^2 y = 0$

From Second Order ODE: $y'' + 2 b y' + a^2 y = 0: b < a$, this has the general solution:
 * $y_g = e^{-b x} \left({C_1 \cos \left({\sqrt {a^2 - b^2} }\right) x + C_2 \sin \left({\sqrt {a^2 - b^2} }\right) x}\right)$

Substituting $\alpha = \sqrt {a^2 - b^2}$, this can be written more compactly as:
 * $y_g = e^{-b x} \left({C_1 \cos \alpha x + C_2 \sin \alpha x}\right)$

We have that:
 * $R \left({x}\right) = K \cos \omega x$

First suppose that $\omega \ne \alpha$.

It is noted that $K \cos \omega x$ is not itself a particular solution of $(2)$.

So from the Method of Undetermined Coefficients for Sine and Cosine:
 * $y_p = A \sin \omega x + B \cos \omega x$

where $A$ and $B$ are to be determined.

Hence:

Substituting into $(1)$:

Hence:

So from General Solution of Linear 2nd Order ODE from Homogeneous 2nd Order ODE and Particular Solution:


 * $y = y_g + y_p = e^{-b x} \left({C_1 \cos \alpha x + C_2 \sin \alpha x}\right) + \dfrac K {\left({a^2 - \omega^2}\right)^2 + 4 b^2 \omega^2} \left({2 b \omega \sin \omega x + \left({a^2 - \omega^2}\right) \cos \omega x}\right)$