Answer: D(t) =

Explanation: A harmonic motion of a spring can be modeled by a sinusoidal function, which, in general, is of the form:
y =
or y =

where:
|a| is initil displacement
is period
For a Damped Harmonic Motion, i.e., when the spring doesn't bounce up and down forever, equations for displacement is:
or

For this question in particular, initial displacement is maximum at 8cm, so it is used the cosine function:
period =
12 =
ω =

Replacing values:

The equation of displacement, D(t), of a spring with damping factor is
.