The work done is positive, as expected. Our arbitrary
choice of the positive direction has no effect on the answer for W.
You can test this by taking the positive x-direction to be downward,
corresponding to compression. Do you get the same values
for k and W as we found here?