The steady state part can be expressed in the form
where is the amplitude.
Equate coefficients of and with the corresponding expressions in your formula for and eliminate the by squaring and adding.
I didn't derive anything in post 2, I simply stated what should (at your stage) be a well-known trig identity, and what allows the the expression for given in the question to be written in an alternative form.
Another trig identity, with which you should be familiar, is used later.