# Work done by a spring on a block

A spring has a block attached to one end and the other end is attached to a wall. As the ball is displaced right or left, we know spring force $$F_{sp}$$ $$=$$ $$-kx$$, always in the direction opposite to the displacement of the block. So work done by the spring on the block is negative (equal to $$\frac{-k}{2}x^2$$), which can be verified from the graph of the function $$F_{sp}$$ $$=$$ $$-kx$$. Area under the curve gives work done by $$F_{sp}$$ so it makes sense that the area between thr curve and $$x$$-axis is always negative.

But when the block is moved to the left ($$-x$$) such that the spring is compressed, and the block is released such that it moves from $$-x$$ to $$0$$, work done by the spring on the block is positive, equal to $$\frac{k}{2}x^2$$, can by shown mathematically using integrals. But how does the graph show that work done by spring is positive as the block moves from $$-x$$ to $$0$$ ? I am not able to understand it graphically, because area occupied by the graph and the $$x$$-axis is always negative. I understand it mathematically, but want to understand it graphically. Am I missing something?

• $E=\vec F \cdot \vec x$, and $\vec x$ is also a vector... Commented May 7, 2020 at 21:07

You might have confused displacement with position.

The definition of work is force times displacement, where displacement = final position - initial position. Since the concepts of final and initial depend on the direction in which the block moves, when the block goes from $$-x$$ to $$0$$, the displacement actually equals

$$(0) - (-x_{max}) = x_{max}$$

Because the graph tells us that $$F_{sp}$$ is indeed positive for $$-x_{max} < x < 0$$, by definition, work done by the spring is positive. This is to say that although the graph is the same, how you use its coordinates to calculate area depends on whether your block moves to the left or to the right. It's also interesting to realize that, unlike displacement, $$F_{sp}$$ depends only on the position of the block.

• Thanks a lot! I understand how it is positive. I did not confuse displacement with position. I was confused because area enclosed by the curve and the position-axis is always $-ve$. I thought work done in this case would be similar to how we calculate displacement from a velocity-time graph, i.e part of the graph above x-axis gives positive displacement and part of the curve below the x-axis gives negative displacement. I thought it was something similar. So here, we have to take into account whether $x$ is $+ve$ or $-ve$, and $F_{sp}$ likewise. And we multiply both to calculate the work done?
– 4d_
Commented May 8, 2020 at 8:50
• We should take into account whether Δx is +ve or -ve. You can still have positive displacement when x < 0 as long as the final position is at the right of the initial position on the x-axis. Commented May 8, 2020 at 21:27
• By $x$, I meant $\Delta{x}$. Thanks again!
– 4d_
Commented May 9, 2020 at 1:34

The -x indicates the position of the block. On graph but the energy is positive for the displacement in that region hence the plot is shifted upwards