Force required to stretch a spring
cm on a mechanical device is
newtons.
Therefore
N and
cm.
Hooks law: 
Substitute
,
in the formula.

Force required to stretch the spring
units is
.
Substitute
in
.
.
Work done by the object in moving from
to
is
.
Find work done in stretching the spring to the required
cm.
Here
cm and
cm.
Substitute
cm,
cm and
in integral formula of work done.

N-cm.
N-m.
Work done is
N-m.
Work done is
N-m.