A mass of 1 slug corresponds to a weight (force) of approximately 32 lbf:
F = ma --> W = (1 slug)*(32 ft/s2) = 32 lbf
Hanging this mass on a vertical spring results in the spring stretching by 2 ft. At equilibrium, the upward force of the spring acting on the mass is equal and opposite to gravity acting downward. So, we can use the weight along with Hooke's law to calculate the spring stiffness, k:
F = -kx
-32 lbf = - k*(2 ft) --> k = 16 lbf/ft
Next, we need to write an equation of motion (∑F = ma) for the system that includes the mass, spring and damping. Define "x" as the displacement of the mass from the equilibrium position, and use ' to denote a time derivative. Then:
∑F = mx'' = - cx' - kx + e-t(sin(4t))
k = spring stiffness = 16 lbf/ft
c = damping constant = 8 lbf/(ft/sec)
m = mass = 1 slug
Note that we are ignoring gravity in this equation because we are starting with the pre-stretched spring. The constant force due to gravity is already accounted for in the initial stretch of the spring, before the mass starts moving again at t=0.
You can solve the ODE above using a Laplace Transform as follows (use a Laplace Transform table for the forcing function).
mx'' + cx' + kx = e-t(sin(4t))
(s2 + 8s + 16)X(s) = 4/((s+1)2+42)
(s+4)2X(s) = 4/((s+1)2+42)
4
X(s) = ------------------------
((s+1)2+42)(s+4)2
At this point, I would recommend doing partial fraction expansion (PFE):
As + B C D
X(s) = ------------- + ----- + -------
(s+1)2+42 s+4 (s+4)2
Multiply each term in the equation above on top and bottom by the quantity needed to get the denominator back to the original denominator before PFE. Then you can set the numerator of the new equation equal to the numerator of the original equation before PFE. That process will give you this equation:
4 = (As+B)(s+4)2 + C((s+1)2+42)(s+4) + D((s+1)2+42)
Now distribute all the polynomials out...
4 = A(s3 + 8s2 + 16s) +B(s2 + 8s + 16) + C(s3 + 6s2 + 25s + 68) + D(s2 + 2s +17)
And set all the coefficients of each power of s equal to the corresponding values on the left side of the equation.
s3: 0 = A + C
s2: 0 = 8A + B + 6C + D
s1: 0 = 16A + 8B + 25C + 2D
s0: 4 = 16B + 68C + 17D
You can solve this system of equations however you want. One way is to set up a matrix equation and do an inverse operation to get the vector [A,B,C,D]T.
⌈ 1 0 1 0 ⌉ ⌈ A ⌉ ⌈ 0 ⌉
| 8 1 6 1 | | B | = | 0 |
| 16 8 25 2 | | C | | 0 |
⌊ 0 16 68 17| ⌊ D ⌋ ⌊ 4 ⌋
A = - 0.0384
B = - 0.0832
C = 0.0384
D = 0.1600
These values will ultimately get plugged into the solution. First, here is how to go back from the Laplace domain to time domain (again, refer to Laplace Transform tables).
As + B C D As B C D
X(s) = ------------- + ----- + ------- = ------------- + ------------- + ----- + -------
(s+1)2+42 s+4 (s+4)2 (s+1)2+42 (s+1)2+42 s+4 (s+4)2
x(t) = (A/4)(d/dt)(e-tsin(4t)) + (B/4)e-tsin(4t) + Ce-4t + Dte-4t
And you can simplify from here to find x(t).