2nd order DE with periodic forcing

Hello MHF, this is my first post hope you guys can help! Please bear with my notation, I haven't figured out how to write symbols yet.

I am having some trouble understanding my notes on a 2nd order inhomogeneous differential equation with a trigonometric RHS and how to solve it. I think it would be best if I first present the information I have and then the parts I am having trouble with:

the ODE is **u" + au' +bu = Ccos(wt)** a,b,C,w constant.

Solving the homogenous form to find the complementary function is no problem for me. The problem is the particular integral. Normally I would tackle this with a trial function like u=Acos(wt) + Bsin(wt) but this doesnt work in the past paper questions I have tried (I get A=B=0).

This is what appears in my course notes:

We can solve this equation by writing u=Re(x) (real part of x) where x(t) solves

x" + ax' + bx = Ce^(iwt) **(*)**

we find as a particular solution x= d*e^(iwt) where d=C(-w^2 + iaw + b)^-1

If we rewrite d in polar form as d=r*e^(i*phi) then x=r*e^(i(wt+phi))

and u = Re(x) = rcos(wt+phi) (sorry, unsure how to get the symbol for phi)

__________________

A number of things are unclear to me. When x(t) is defined as solving the ODE I labelled as **(*)**, should I take that to mean just any particular solution? Not a full general solution.

Finding the particular solution x=de^(iwt) is no problem but when converting into the polar form d=r*e^(i*phi) how do I find r and phi?

And finally, WHY does this work? What is particularly useful about a trial function that satifies **(*)**?? Where does the RHS of **(*)** Ce^(iwt) come from? This would really help me a lot, I always find understanding why I'm doing something makes it much easier to learn.

I hope this isn't too convoluted and confusing to read. I'll try and figure out how to do symbols and edit this post.