# Work done by a harmonic oscillator

1. Oct 13, 2007

### Hunt_

In the case of an undamped oscillator, the work done by the system is written as ( assume initial position is 0 ) :

$$W = - \Delta U = - K \frac{x^2}{2}$$

But to verify this , we must assume that the force acting on the oscillator is constant , which is not true as F = f(x) according to hook's law.

To find an expression for the work done by the system I start with :

$$dW = Cos(F,x) \ d(Fx) = d(Fx) = -K d(x^2)$$

then it follows that

$$W = - K x^2$$

Ofcourse this eq must be wrong , but I wonder why. Why should the force of the spring be constant ?

2. Oct 13, 2007

### Staff: Mentor

The force of the spring isn't constant:

$$dW = Fdx = kx dx$$

Integrate that and you'll get the correct answer.

3. Oct 14, 2007

### Hunt_

When you write dW=Fdx you already assume the force is constant . Otherwise , why would F be outside the differential ? We should write dW = d(Fx) keeping F inside the differential as it is not a constant. dW = Fdx is correct only when F = constant. True ?

Notice , when calculating the work done by an electron in a battery , we write dW = d(Fx) = d(qEx) = Vdq assuming the potential difference V = const while q is a variable. ( In this case F is not constant ). Had we writen directly dW = Fdx , we would not obtain the correct expression. It is not necessary that dW = Fdx always holds true, it depends on the situation.

I hope you got my point.

4. Oct 14, 2007

### Staff: Mentor

No, not true. The differential element of work is dW = Fdx, not dW = d(Fx). (What does dF even mean? A small change in F?) Work is Force times distance; we need to add up (integrate) all the contributions of Force*dx over the variable x. Whether F is constant or not is a different story: if F is constant, then you can take it out of the integral. In this case F is a function of x, so dW = Fdx = kx dx:

$$W = \int F(x) dx \neq F(x) \int dx$$

$$W = \int F(x) dx = \int k x dx = 1/2 kx^2$$

Again, incorrect. dW = F dx is always true--it's the basic definition of work. In the case where force is constant (and in the same direction as displacement):

$$W = \int F dx = F \int dx = Fx$$

5. Oct 14, 2007

### Hunt_

Thanks , I think it makes much more sense now.