# Elastic potential energy and work equations

Elastic potential energy is $$\frac{1}{2} k x^2$$ and work is $$F \cdot d$$. Why these numbers do not evaluate to the same value in a problem?

The change in potential energy is the work done on a spring - $$W = \Delta U$$. However, every time I do an example I always get that the work is double the elastic potential energy. What am I missing?

If it takes $$2 \text{ N}$$ of force to displace a spring by $$0.2 \text{ m}$$ with a spring constant of $$10 \text{ N/m}$$ then the work is $$W_e = 2 \text{ N} \cdot 0.2 \text{ m} = 0.4 \text{ J}$$. However, the elastic potential energy stored in the spring is $$U_e = \frac{1}{2} 10 \text{ N/m} \cdot (0.2 \text{ m})^2 = 0.2 \text{ J}$$.

• it isn't 2N at every displacement along the spring. f*d is used for situations of constant force. The force from a spring changes with position. You must integrate across the entire displacement, which results in the spring energy equation.
– Jim
Commented Jan 25, 2022 at 21:23

so if potential energy in a spring is 1/2kx^2 and work f*d. Why do these numbers not come out to the same thing in a problem?

You have to start out with the general definition of work, which is not simply force times displacement, but is

$$W=\int\vec F.d\vec x$$

It only equals $$Fx$$ if the force it constant and can come out of the integral. But the force exerted by the spring is not constant, if varies linearly with displacement. So, for the spring, since the force is in the same direction as displacement and since $$F=kx$$

$$W=\int (kx)dx=\frac{1}{2}kx^2$$

Hope this helps.

TL;DR Your results are off by a factor 2 because you are using an instantaneous force, i.e. the force that spring exerts at some displacement. If you had used an average spring force between 0 and that displacement, you would have got the correct result. See below for detailed explanation where does the difference come from.

## Numerical evaluation

I will first explain this numerically so that you get a feeling about the procedure. Let's calculate what is the spring force and work for every elongation between $$0 \text{ m}$$ and $$-0.2 \text{ m}$$ with a step of $$0.02 \text{ m}$$ (see table below).

Spring      Force at    Work over
elongation  elongation  segment dx
--------------------------------------
0           0.0 N       N/A
-0.02 m     0.2 N       -0.004 J
-0.04 m     0.4 N       -0.008 J
-0.06 m     0.6 N       -0.012 J
-0.08 m     0.8 N       -0.016 J
-0.10 m     1.0 N       -0.020 J
-0.12 m     1.2 N       -0.024 J
-0.14 m     1.4 N       -0.028 J
-0.16 m     1.6 N       -0.032 J
-0.18 m     1.8 N       -0.036 J
-0.20 m     2.0 N       -0.040 J

From the above table, the total work done by the spring between elongation $$0 \text{ m}$$ and $$-0.2 \text{ m}$$ is $$-0.22 \text{ J}$$. This way of evaluating equations is called a numerical procedure, and result accuracy very much depends on the step size you take:

$$W \approx \left\{ \begin{array}{l} -0.2200 \text{ J for } \Delta x = 0.02 \text{ m} \\ -0.2100 \text{ J for } \Delta x = 0.01 \text{ m} \\ -0.2010 \text{ J for } \Delta x = 0.001 \text{ m} \\ -0.2001 \text{ J for } \Delta x = 0.0001 \text{ m} \end{array} \right.$$

As you can see, as step size approaches $$0 \text{ m}$$ the work approaches $$-0.2 \text{ J}$$. The negative sign comes from the fact that the spring is being compressed in this case, which means spring takes an energy from the object and stores it as elastic potential energy in spring-object system.

The problem with your procedure is that you calculated work as as $$2.0 \text{ N} \cdot (-0.20 \text{ m}) = -0.40 \text{ J}$$, as if the spring force $$2.0 \text{ N}$$ was constant over whole displacement $$-0.20 \text{ m}$$, which obviously is not true. To calculate work in this way, you must use the average force spring exerts over the displacement! The average force is calculated to be $$1 \text{ N}$$ in limit case as $$\Delta x$$ approaches zero, and the total work is $$1 \text{ N} \cdot (-0.20 \text{ m}) = -0.20 \text{ J}$$.

If you are still not familiar with calculus (derivatives and integrals), here is an interesting problem for you - express the total work and average force as a function of $$\Delta x$$.

## Work done by spring

If it takes $$2 \text{ N}$$ of force to displace a spring by $$0.2 \text{ m}$$ ...

That is a mistake right there. The force exerted by the spring is not constant, but it linearly depends on the elongation, as in

$$\boxed{F_e = -k x} \tag 1$$

where $$k$$ is the spring constant and $$x$$ is the elongation. The minus sign defines that the force exerted by the spring always acts in the direction opposite to the elongation.

Since force is not constant over some distance, we cannot simply multiply the final force value with the total displacement. We have to integrate the force over the distance (geometrically, this means finding an area under the force curve):

$$W_e = \int_{x_1}^{x_2} -k x \cdot dx = \left. -\frac{1}{2} k x^2 \right|_{x_1}^{x_2} = -\frac{1}{2} k x_2^2 + \frac{1}{2} k x_1^2 = -\Delta U_e \tag 2$$

where $$U_e = \frac{1}{2} k x^2$$ is the elastic potential energy, and $$\Delta$$ denotes a difference (final minus initial value). If you are not familiar with calculus and integrals ($$\int$$ and $$dx$$ in the above equation), what it means is that you sum the spring force ($$-kx$$) for every elongation $$\{x,x+dx,x+2dx,...\}$$ between $$x_1$$ and $$x_2$$, where $$dx$$ is infinitesimally small increment, just as we did in the numerical evaluation above.

The change in potential energy is the work done on a spring.

This is correct when it comes to "work done on a spring". But the work that spring does equals negative of the change in elastic potential energy! This negative sign is really important, do not ever forget it! The same applies to the gravitational potential energy. Check Eq. (2) if you do not understand why.

In this context we can define an average force that the spring exerts over some distance

$$W_e = \bar{F_e} \cdot (x_2 - x_1) \qquad \text{or} \qquad \boxed{\bar{F}_e = -\frac{1}{2} k (x_1 + x_2)} \tag 3$$

The force $$\bar{F}_e$$ is now constant but is valid only for spring elongation from $$x_1$$ to $$x_2$$. Also, notice the difference compared to the definition in Eq. (1).

If you take that the spring starts from the relaxed state ($$x_1 = 0$$), then the average force between $$0$$ and $$x_2$$ and instantaneous force exactly at position $$x_2$$ are

$$\bar{F}_e = -\frac{1}{2} k x_2 \qquad \text{and} \qquad F_{e,2} = -k x_2$$

In this particular case the work done by a spring can be calculated as

$$W_e = \bar{F}_e (x_2-0) = -\frac{1}{2} k x_2^2$$

and you calculated it as

$$W'_e = F_{e,2} (x_2-0) = -k x_2^2 \qquad \text{WRONG!}$$

Notice that $$W_e' = 2W_e$$ which explains the factor 2 mismatch in your calculations. The force $$2 \text{ N}$$ in your example corresponds to the instantaneous force exactly at $$-0.2 \text{ m}$$ and not to the average force between $$0 \text{ m}$$ and $$-0.2 \text{ m}$$.

You are missing that the force changes as the spring elongates. It is 0 at the equilibrium position and it is only equal to the final force at the final extension. The factor of 1/2 accounts for the variation in the force, essentially giving you the average force.

If the force is $$f(x)=-kx$$, then the potential energy is $$E(x)=\int _{0}^{x} ky dy = k\frac{x^{2}}{2}$$ When you use the formula with $$\vec{F} \cdot \vec{dl}$$ you need to integrate, you cannot just plug in the numbers.