Answer
The work done by the spring on the block is $~~7.2~J$
Work Step by Step
The magnitude of the spring force when $d = 0.040~m$ is $360~N$
We can find the spring constant $k$:
$kd = 360~N$
$k = \frac{360~N}{0.040~m}$
$k = 9000~N/m$
We can find the work done by the spring on the block as the block moves from $x_i = 5.0~cm$ to $x_f = -3.0~cm$:
$W = \frac{1}{2}kx_i^2-\frac{1}{2}kx_f^2$
$W = \frac{1}{2}k~(x_i^2-x_f^2)$
$W = \frac{1}{2}(9000~N/m)~[(0.050~m)^2-(-0.030~m)^2)]$
$W = 7.2~J$
The work done by the spring on the block is $~~7.2~J$