# Variation of Constant for $x''=-2\beta x'-x+\gamma\cos(\omega t)$

I am trying to find the solution for $$x''=-2\beta x'-x+\gamma\cos(\omega t)$$ with $\beta,\gamma,\omega$ positive constants. I started by finding the homogeneous part of the solution by solving $x''+2\beta x'+x=0$ and found $$x_{hom}=c_1e^{\lambda_+ t}+c_2e^{\lambda_- t}$$ with $\lambda_{\pm}=-\beta\pm\sqrt{\beta^2-1}$. Now to find the particular solution I try to use the variation of constants, hence I need to solve the system $$c_1'(t)e^{\lambda_+ t}+c_2'(t)e^{\lambda_- t}=0\\ c_1'(t)\lambda_+ e^{\lambda_+ t}+c_2'(t)\lambda_- e^{\lambda_- t}=\gamma \cos(\omega t)$$ I did so and found: $$c_1=\frac{\gamma}{4\sqrt{\beta^2-1}(i\omega-\lambda_+)}e^{(i\omega-\lambda_+)t}-\frac{\gamma}{4\sqrt{\beta^2-1}(i\omega+\lambda_+)}e^{-(i\omega+\lambda_+)t}$$ and $$c_2=-\frac{\gamma}{4\sqrt{\beta^2-1}(i\omega-\lambda_-)}e^{(i\omega-\lambda_-)t}+\frac{\gamma}{4\sqrt{\beta^2-1}(i\omega+\lambda_+)}e^{-(i\omega+\lambda_-)t}$$ Now the particular solution is $$x_p=c_1e^{\lambda_+ t}+c_2e^{\lambda_- t}$$

However in my course the particular solution was given to be $$x_p=a \cos(\omega t) + b \sin(\omega t)$$ with $$a=\frac{(1-\omega^2)\gamma}{(1-\omega^2)^2+4\beta^2\omega^2}, b=\frac{-2\beta\omega\gamma}{(1-\omega^2)^2+4\beta^2\omega^2}$$ and I just can't connect my result to this one! Where is my error?

• May be, you need to get rid of the imaginaty part in denominator. – Claude Leibovici Dec 14 '15 at 13:46

In the present case, obviously a particular solution will fit of the form : $$x_p=a \cos(\omega t)+b \sin(\omega t)$$ that we bring back into the ODE : $$-a\omega^2 \cos(\omega t)-b\omega^2 \sin(\omega t)=$$ $$=-2\beta\omega\left(-a \sin(\omega t)+b \cos(\omega t) \right) -a \cos(\omega t)-b \sin(\omega t)+\gamma\cos(\omega t)$$ Then, solve for $a$ and $b$ : $$-a\omega^2 =-2\beta\omega b -a +\gamma$$
$$-b\omega^2 =2\beta\omega a -b$$