I was going over the HW solutions I got back from a prof. And most of it I am ok with, But there is one bit that is sort of bothering me.
It has to do with solving the equation of motion for a damped oscillator. The question was "solve the equation of motion for the given driving source." Stated thus:
$$\ddot{x} + \gamma \dot x+ \omega_0^2x=\frac{F_{ext}(t)}{m}=3 \cos(\omega t) + 2 \cos (3\omega t)$$
I solve it like this: it's a 2nd order DE so I said the characteristic equation is going to be $\lambda^2+\gamma \lambda + \omega_0^2$ which has roots at $\lambda = \frac{\gamma \pm \sqrt{\gamma^2 - 4(1)(\omega_0^2)}}{2}$
That gets me the homogeneous solution $x=C_1 e^{-\frac{\gamma}{2}t} \cos \left(\frac{\sqrt{\gamma^2 - 4 \omega_0^2}}{2}\right) + C_2e^{-\frac{\gamma}{2}t} \sin \left(\frac{\sqrt{\gamma^2 - 4 \omega_0^2}}{2}\right)$
Manwhile th particular solution will be in the form $A \cos(\omega t) + B\cos (3\omega t)$.
Taking derivatives of that particular solution expression, we have:
$\frac{dx}{dt} = -A\omega \sin(\omega t) - 3\omega B\sin(3\omega t)$
$\frac{d^2x}{dt^2} = -A \omega^2 \cos (\omega t) - 9\omega^2 B \cos (3\omega t) $
Substituting into the original equation I got:
$-A \omega^2 \cos (\omega t) - 9\omega^2 B \cos (3\omega t) + \gamma (-A\omega \sin(\omega t) - 3\omega B\sin(3\omega t)) + \omega_0^2 (A \cos(\omega t) + B\cos (3\omega t) = 3 \cos (\omega t) + 2 \cos (3\omega t)$
Which we can move the coefficients around to get:
$-A \omega^2+ A\omega_0^2 \cos (\omega t) + (B\omega_0^2- 9 B\omega^2) \cos (3\omega t) - A\gamma \omega \sin(\omega t) - 3 B \omega \gamma \sin(3\omega t) = 3 \cos (\omega t) + 2 \cos (3\omega t)$
There are no sin terms in the right side $-A \gamma \omega = 0$ and $-3B\omega \gamma = 0$ which leaves us with $A = 3B$. I can substitute that in to what I just had and do the algebra and I should end up with $B=\frac{2}{\omega_0^2-9\omega^2}$ and $A=\frac{1}{\omega_0^2-\omega^2}$. So my particular solution is $x_p(t) = \frac{1}{\omega_0^2-\omega^2}\sin(\omega t) + \frac{2}{\omega_0^2-9\omega^2}\cos(3\omega t)$ and the general solution is just that added to the homogeneous solution. So I should have $$C_1 e^{-\frac{\gamma}{2}t} \cos \left(\frac{\sqrt{\gamma^2 - 4 \omega_0^2}}{2}\right) + C_2e^{-\frac{\gamma}{2}t} \sin \left(\frac{\sqrt{\gamma^2 - 4 \omega_0^2}}{2}\right)+\frac{1}{\omega_0^2-\omega^2}\sin(\omega t) + \frac{2}{\omega_0^2-9\omega^2}\cos(3\omega t)=x(t)$$
as my general solution.
Now this is where someone tells me I screwed this up badly :-) But really, I ask because my prof's answer sheet did this in a very different way. The answer he gave also seemed to be in a whole different form -- $x(t) = D_1\cos(\omega t + \delta_1) + D_2\cos(3\omega t + \delta_2)$ where D is the response function and I guess delta is a phase difference -- they are both arctangents. Did I end up with the same answer in a different form?
Thanks for reading this long post.
One of the mistakes you made is the sentence
First of all: $-A \gamma\omega = 0$ and $-3B\omega\gamma = 0$ does not imply $A = 3B$. You are not also not allowed to group terms because one is $\sin\omega t$ and the other is $\sin 3\omega t$ which are different.
Secondly, the fact that there are no $\sin$ terms in the right side means that you actually postulated an incorrect particular solution. Since the left hand side has a first derivative term, and you know that the derivative of $\cos$ is $\sin$, your particular solution should contain not only $\cos$ terms but also $\sin$ terms to "cancel out" the occurrences of $\sin$ that comes in the substitution.
Thirdly, if you are comfortable with complex numbers and Euler's identity $e^{i\theta} = \cos \theta + i \sin \theta$ I would advocate re-writing everything in terms of the exponential function and using complex numbers. The notation should simplify slightly. (If you are not comfortable, don't worry, you can do the same with just straight-up $\cos$ and $\sin$ and real coefficients. But you need to be more careful with the computation.)