For each infinitesimal displacement dx, the applied force is simply k x and the product of these is the infinitesimal transfer of energy into the spring dU. The total elastic energy placed into the spring from zero displacement to final length L is thus the integral U = ∫ ∫ 0 L − − L o k x d x = 1 2 k ( L − − L o ) 2