The work done by an elastic force is the work done due to the deformation of an object.
W=kΔx22
where,
W— work done; k— spring stiffness constant; Δx— displacement.