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

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:
{{begin-eqn}}
{{eqn | l = y_p
      | r = A \sin \omega x + B \cos \omega x
      | c = 
}}
{{eqn | ll= \leadsto
      | l = {y_p}'
      | r = \omega A \cos \omega x - \omega B \sin \omega x
      | c = Derivative of Sine Function, Derivative of Cosine Function
}}
{{eqn | ll= \leadsto
      | l = {y_p}''
      | r = -\omega^2 A \sin \omega x - \omega^2 B \cos \omega x
      | c = Power Rule for Derivatives
}}
{{end-eqn}}
Substituting into $(1)$:
{{begin-eqn}}
{{eqn | l = -\omega^2 \paren {A \sin \omega x + B \cos \omega x} + 2 b \omega \paren {A \cos \omega x - B \sin \omega x} + a^2 \paren {A \sin \omega x + B \cos \omega x}
      | r = K \cos \omega x
      | c = 
}}
{{eqn | ll= \leadsto
      | l = -\omega^2 A \sin \omega x - 2 b \omega B \sin \omega x + a^2 A \sin \omega x
      | r = 0
      | c = equating coefficients
}}
{{eqn | l = -\omega^2 B \cos \omega x + 2 b \omega A \cos \omega x + a^2 B \cos \omega x
      | r = K \cos \omega x
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \paren {a^2 - \omega^2} A - 2 b \omega B
      | r = 0
      | c = 
}}
{{eqn | l = \paren {a^2 - \omega^2} B + 2 b \omega A
      | r = K
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \frac {2 b \omega B} {a^2 - \omega^2}
      | r = A
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \paren {a^2 - \omega^2} B + 2 b \omega \frac {2 b \omega B} {a^2 - \omega^2}
      | r = K
      | c = 
}}
{{eqn | ll= \leadsto
      | l = B \paren {\frac {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2} {a^2 - \omega^2} }
      | r = K
      | c = 
}}
{{eqn | ll= \leadsto
      | l = K \frac {a^2 - \omega^2} {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2}
      | r = B
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \frac {2 b \omega} {a^2 - \omega^2} K \frac {a^2 - \omega^2} {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2}
      | r = A
      | c = 
}}
{{eqn | ll= \leadsto
      | l = K \frac {2 b \omega} {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2}
      | r = A
      | c = 
}}
{{end-eqn}}
Hence:
{{begin-eqn}}
{{eqn | l = y_p
      | r = K \frac {2 b \omega} {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2} \sin \omega x + K \frac {a^2 - \omega^2} {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2} \cos \omega x
      | c = 
}}
{{eqn | r = \frac K {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2} \paren {2 b \omega \sin \omega x + \paren {a^2 - \omega^2} \cos \omega x}
      | c = 
}}
{{end-eqn}}
From Multiple of Sine plus Multiple of Cosine: Cosine Form:
{{begin-eqn}}
{{eqn | o = 
      | r = 2 b \omega \sin \omega x + \paren {a^2 - \omega^2} \cos \omega x
      | c = 
}}
{{eqn | r = \sqrt {4 b^2 \omega^2 + \paren {a^2 - \omega^2}^2} \map \cos {\omega x + \map \arctan {\dfrac {-2 b \omega} {a^2 - \omega^2} } }
      | c = 
}}
{{eqn | r = \sqrt {4 b^2 \omega^2 + \paren {a^2 - \omega^2}^2} \map \cos {\omega x - \map \arctan {\dfrac {2 b \omega} {a^2 - \omega^2} } }
      | c = Tangent Function is Odd
}}
{{end-eqn}}
and so:
{{begin-eqn}}
{{eqn | l = y_p
      | r = \frac {K \sqrt {4 b^2 \omega^2 + \paren {a^2 - \omega^2}^2} } {\paren {a^2 - \omega^2}^2 + 4 b^2 \omega^2} \map \cos {\omega x - \phi}
      | c = where $\phi = \map \arctan {\dfrac {2 b \omega} {a^2 - \omega^2} }$
}}
{{eqn | r = \frac K {\sqrt {4 b^2 \omega^2 + \paren {a^2 - \omega^2}^2} } \map \cos {\omega x - \phi}
      | c = 
}}
{{end-eqn}}
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} }$
{{qed}}
Category:Examples of Constant Coefficient LSOODEs
Category:Examples of Method of Undetermined Coefficients
kjklg40zi12l1x9ce619a6d15bmx4sy