The average power output is the ratio between the work done to compress the spring, W, and the time taken, t:
[tex]P= \frac{W}{t} [/tex] (1)
The work done is equal to the elastic energy stored by the compressed spring:
[tex]W=U= \frac{1}{2}kx^2 [/tex]
where [tex]k=5000 N/m[/tex] is the spring constant and [tex]x=4.0 cm=0.04 m[/tex] is the compression of the spring. If we substitute the numbers, we find:
[tex]W= \frac{1}{2}(5000 N/m)(0.04 m)^2=4 J [/tex]
And now we can use eq.(1) to calculate the average power output:
[tex]P= \frac{W}{t}= \frac{4 J}{0.30 s} =13.3 W[/tex]