we know that
in equilibrium,
the total force is equal to the driving force of oscillation.
here k is the force constant
and the R.H.S term is the driving force in periodic form.
then we assume the solution of the periodic oscilation be
x=A cost
so putting this solution in the above equation of the force we can find the constant A, which is the amplitude in applied force of oscillation.