If we have a spring that is extended 5cm (for example) relative to its equilibrium state and it's then compressed so that its only extended 3cm from its equilibrium state, is the work involved the same as if we had a spring extended 5cm from its equilibrium state and then compressed until it's compressed 3 cm from its equilibrium state?
Or have a misunderstood something?