The general solution of an inhomogeneous linear differential equation is made by adding together the general solution of the homogeneous equation (called the Complementary Function) to any function that yields the correct right hand side, called the Particular Integral.
There are two standard ways to solve oscillator problems with sinusoidal driving functions at angular frequency ω.
1) Try a solution of the form y=Acosωt+Bsinωt and do a lot of trig to find A and B or
2) Write the driving function as the real part of a complex exponential form, Dexp(iωt), and try a solution y=αexp(iωt). This time we do some complex math to find the complex constant α and then take the real part of the complete solution.
If we drive a damped harmonic oscillator with a simple periodic function we get the differential equation
y" + 2 βy' + ω02 y = Dcos(ωt).
In this
β is the damping constant, ω0 is the natural frequency of undriven oscillations, and ω is the driving frequency.
We often describe this by the quality value, Q = ω0/2β. Large Q (>10) means very light damping. Critical Damping has Q=1/2 and anything below that is overdamped.
When the driving frequency is much less than the natural frequency (ω << ω0) the response is in phase with the drive and has magnitude D/ω02. As the drive frequency approaches the natural frequency the reponse gets bigger and bigger, reaching a maximum near ω = ω0 at which point the response is 90 degrees out of phase with the drive. As the driving frequency increases still further the response gets steadily smaller and smaller, eventually going to 0. In this region the response is 180 degrees out of phase with the drive.
We call the phenomenon of a large response to a small periodic drive Resonance. We call the frequency at which the response is maximum the Resonant Frequency. If the oscillator is lightly damped, has a high Q, then the response will be very large and take place over a very narrow range of frequencies. If the oscillator is more damped, has a low Q, then the response will be much smaller and take place over a much broader range of frequencies.

The equation of motion for an underdamped driven harmonic oscillator is an inhomogeneous 2nd order linear ordinary differential equation. The complete solution to the driven oscillator problem consists of a solution to the homogeneous problem (the Complementary Function) plus a driven term (the Particular Integral).
The complementary function consists of a sinusoidal term at the natural frequency of the undriven oscillator multiplied by an exponential decay CF = A*exp(-βt)*cos(ωdt+φ) where ωd=√(ω02-β2) is the freely oscillating frequency of the undriven damped oscillator. The exponential term causes this term to decay away to nothing. So this term describes the transient behavior of the oscillator.
The particular integral consists only of an undecaying sinusoidal term at the driving frequency. This is called the steady state solution because it is all that is left after the transient solution has decayed away.
When a complete solution consists of the sum of two sinusoids at different frequencies f1 and f2, there is a beating between the two frequencies. The result is a sinusoid at the average frequency, (f1+f2)/2, modulated by a sinusoid at the difference frequency, |f1-f2|. The depth of the modulation depends on the relative amplitudes of the two sinusoids. It is complete if they have the same magnitude.
The solution of the driven damped equation is (for cosine drive, switch cos to sin if sine drive).
y = D cos(ωt+φ) where tanφ = -2βω
√((ω02-ω2)2+4β2ω2 (ω02-ω2)