Answer
The work done in second compression is 3 times of that in first compression.
Work Step by Step
When expansion is from 0cm to 2cm, the work done is directly proportional to $2^{2}-0^{2}=4$
When expansion if from 2cm to 4cm, the work done is directly proportional to $4^{2}-2^{2}=16-4=12$
So, the work done in the latter case is 3 times the first case.