# Work done by Spring

1. Oct 7, 2008

### rwx1606

1. The problem statement, all variables and given/known data
Is the work done BY a spring always negative when you compress or stretch it?

2. Relevant equations
W=-1/2kx^2

3. The attempt at a solution
I know that the spring force always acts opposite of displacement when compressing or stretch. So when you compress or stretch the spring, the work the spring does should be -1/2kx^2. I'm having a hard time convincing myself mathematically though. So you compress the spring from x initial=0 m to a x final equal to some -4 m. The spring force according to this convention, F=-kx becomes a positive kx because the displacement is negative. When I integrate the force, do I put a a positive sign now, so in this case I would integrate the spring force from -4m to 0m? Also I know work is the Magnitude of the force times the Magnitude of the displacement for a constant force. Does this hold in varying forces such as the spring force?

2. Oct 8, 2008

### alphysicist

Hi rwx1606,

This is true if the spring starts with x=0. So if the spring is initially unstretched (and uncompressed), then if it is stretched or compressed the work done by the spring is negative like you have.

But if you talk about the the spring going from x=4 to x=2, for example, the work done by the spring force would be positive.

The force is positive, but F is still F=-k x.

No, you integrate to find the work done by the spring force. (If you try just multiplying the magnitudes, you'll find that you are missing a numerical factor.)