As we know that work done to stretch the spring will be given as
[tex]U = \frac{1}{2}kx^2[/tex]
so here we have
[tex]9 = \frac{1}{2}k(0.02)^2[/tex]
so we have
[tex]k = 45000 N/m[/tex]
now we need to find the work done to stretch the spring from x = 2 cm to x = 4 cm
here we have
[tex]U = \frac{1}{2}k(x_1^2 - x_2^2)[/tex]
now we have
[tex]U = \frac{1}{2}(45000)(0.06^2 - 0.02^2)[/tex]
[tex]U = 72 J[/tex]