# Potential energy in an ideal spring compressed from both sides

My query is that suppose an ideal spring is present and is compressed from both the sides by a distance $$x_{1}$$ from the left and a distance $$x_{2}$$ from the right. So what will be the potential energy stored in the spring at this moment?

Using the formula $$\frac{1}{2} kx^{2}$$, should it be $$\frac{1}{2} k (x_{1}+x_{2})^2$$ or the sum of individual energies $$\frac{1}{2} k(x_{1})^2 + \frac12 k(x_{2})^2$$? According what I have read it should be the individual sum.

But I can't understand why as if we stretch a spring, say to $$y_{1}$$ and $$y_{2}$$ from both side, the force applied by spring on both sides will be $$-k(y_{1}+y_{2})$$, as the spring is ideal, and there can't be net force on it, so it will apply same force on both side. But why should the potential energy be measured individually rather taking the sum of total compressed/stretched distance from both sides?

• It is the total amount of compression (i.e. $x_1+x_2$) that is important. Whether the spring is compressed from one side or the other or from both sides at the same time is irrelevant to the energy that it stores. Oct 2 at 13:04
• A great strategy in solving this kind of problem is to think about the original derivation of the formula $kx^2/2$. Can you look at that derivation, and figure out how to derive a new potential energy formula for the situation that you're in? Oct 2 at 13:08
• Adding to @AXensen, this problem is well worth digging in to. It adds to one's intuition and understanding, and provides an exercise in mathematical development. As your studies progress you will run across things that you think is one way, but everyone's answer is something different. Dig in to it. In fact, digging in to anything has that value. Oct 2 at 13:56
• Notwithstanding @Steeven's answer, look at the special case of compressing one side by $x$ and extending the other side by $x$, the spring is not extended and merely translated.
– jim
Oct 2 at 15:58
• how do you compress a spring from one side? Oct 4 at 2:39

There is no such thing as a compression/elongation of an ideal spring from "only one end". But this misunderstanding is very common since this is slightly counterintuitive.

Pushing/pulling from one side will just move the spring, not compress/elongate it, if it is not supported/fixed at the other end simultaneously.

In the formula for potential elastic energy, $$E=\frac12 k x^2,$$ $$x$$ is the difference between current length and the natural, unstretched length measured from any end. There is no other interpretation of this. There is no meaning in measuring the "compression at only one end" or anything like that and definitely not in talking about two different compressions from either side. The "other end" cannot be inactive, so to speak, during any such change in the spring length - otherwise there would have been no change at all.

So, to answer your specific question, depending on how you measure $$x_1$$ and $$x_2$$, you might have to add them together to get the total change from original length. But be careful when doing such measurements as the spring as a whole might be moving as well, interfering with the measurement - the safest option is to simply measure form one end to the other how long the spring is after compression and before compression. The difference is you $$x$$ in the formula.

If you imagine a coordinate system with it's origin at one end, then $$x$$ is simply the new length that you measure from this origin. This is how the formula is often treated mathematically.

In my opinion, Steeven's answer gives a fairly intuitive reason why the total energy must be $$\frac 1 2 k\left(x_1+x_2\right)^2$$, and is a good way to think about the problem. I'd like to further directly address what I think is the cause of the confusion.

Suppose we compress a spring, and choose a frame of reference such that some point $$P$$ along the spring remains fixed. Then, apparently, part of the spring is compressed by $$x_1$$, while the other part is compressed by $$x_2$$, as shown in the diagram below.

Since $$P$$ is fixed, the following system where the spring is cut at P should be equivalent.

So shouldn't the total energy be $$\frac 1 2 k x_1^2 + \frac 1 2 k x_2^2$$? Not quite. By cutting the spring, the spring constant changes, so the total energy is actually $$\frac 1 2 k_1 x_1^2 + \frac 1 2 k_2 x_2^2$$.

But what are $$k_1$$ and $$k_2$$? A cut spring will get stiffer in inverse proportion to the fraction of total length at which it's cut, since there's only that fraction of material left to bend. Symbolically, that means $$k_1 = k \frac{x_1 + x_2}{x_1}$$ and $$k_2 = k \frac{x_1 + x_2}{x_2}.$$ Now, we substitute these back into the original expression, then simplify, and we can relax; we haven't unraveled the universe.

$$\frac 1 2 k \frac{x_1 + x_2}{x_1} x_1^2 + \frac 1 2 k \frac{x_1 + x_2}{x_2} x_2^2$$

$$\frac 1 2 k \left(x_1^2 + x_2 x_1\right) + \frac 1 2 k \left(x_1 x_2 + x_2^2\right)$$

$$\frac 1 2 k \left(x_1^2 + 2 x_2 x_1 + x_2^2\right)$$

$$\frac 1 2 k \left(x_1 + x_2\right)^2$$

† Note that while $$x_1 + x_2$$, $$x_1$$, and $$x_2$$ are not the lengths of the spring and its parts, they are all proportional to those lengths by the same factor.

So what will be the potential energy stored in the spring at this moment.

So using the formula $$\frac12 kx²$$ Should it be $$\frac12 k (x1+x2)^2$$ Or sum of individual energy $$\frac12 k(x1)^2 + \frac12 k(x2)^2$$

The best thing to do is to just derive it directly.

As you say, the force is the same on both sides of the spring. On each side of the spring it is always equal to $$F(Y_1,Y_2) = k \ (Y_1 + Y_2)$$

So let's say that we stretch the left end of the spring from $$0$$ to $$Y_1$$ first with the right end held at $$0$$, and then holding the left end at $$Y_1$$ we stretch the right end from $$0$$ to $$Y_2$$. Then the work done in the first part is $$W_1=\int_{0}^{Y_1} F(y_1,0) \ dy_1 = \frac{1}{2} k Y_1{}^2$$ and the work done in the second part is $$W_2=\int_{0}^{Y_2} F(Y_1,y_2) \ dy_2 = \frac{1}{2} k Y_2{}^2 + k Y_1 Y_2$$ and the total work is $$W=W_1+W_2= \frac{1}{2} k Y_1{}^2 + k Y_1 Y_2 + \frac{1}{2} k Y_2{}^2 = \frac{1}{2} k (Y_1+Y_2)^2$$

Since the spring is conservative, it doesn't matter the actual path taken. The total energy stored is the same at any $$Y_1$$, $$Y_2$$ regardless of how you arrive at that point. If you wish, you can confirm that by using this same approach with different paths.

from the equations of motion

$$m_1\ddot x_1+k(x_1-x_2)=0\\ m_2\ddot x_2-k(x1-x_2)=0$$

the potential energy is:

$$U=\frac k2 (x_1-x_2)^2$$

We can see that the energy must be dictated by the total elongation/compression of the spring by recognizing that the energy change from stretching a spring cannot depend on how we choose to model the problem conceptually.

You've already noted that the spring would appear to have different energy if you treated it as 2 independent springs each with 1/2 the compression. But why stop there? You could treat it as 3 spring with 1/3 the compression, or 10 springs with 1/10 the compression. Each of these would ostensibly represent different amount of potential energy, but they are physically identical systems, the only difference is where we have chosen to put the arbitrary, conceptual, non-physical breaks in the spring. This is of course absurd, the system's energy can't change merely by thinking about it differently - this should suggest there is something wrong with this approach to the problem.