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$ where $b^2 < a^2$

has the general solution:
 * $y = e^{-b x} \paren {C_1 \cos \alpha x + C_2 \sin \alpha x} + \dfrac K {\sqrt {4 b^2 \omega^2 + \paren {a^2 - \omega^2}^2} } \map \cos {\omega x - \phi}$

where:
 * $\alpha = \sqrt {a^2 - b^2}$
 * $\phi = \map \arctan {\dfrac {2 b \omega} {a^2 - \omega^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 = \map R x$

where:
 * $p = 2 b$
 * $q = a^2$
 * $\map R x = 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 Linear Second Order ODE: $y'' + 2 b y' + a^2 y = 0: b < a$, this has the general solution:
 * $y_g = e^{-b x} \paren {C_1 \, \map \cos {\sqrt {a^2 - b^2} } x + C_2 \, \map \sin {\sqrt {a^2 - b^2} } x}$

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

We have that:
 * $\map R x = K \cos \omega x$

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:

From Multiple of Sine plus Multiple of Cosine: Cosine Form:

and so:

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} \paren {C_1 \cos \alpha x + C_2 \sin \alpha x} + \dfrac K {\sqrt {4 b^2 \omega^2 + \paren {a^2 - \omega^2}^2} } \map \cos {\omega x - \phi}$

where:
 * $\phi = \map \arctan {\dfrac {2 b \omega} {a^2 - \omega^2} }$