What has the potential energy: the spring or the body on the spring?

Particles have gravitational potential energy due to its position in the gravitational field. We say the particle has potential energy and not the Earth (the body doing the work). Why is it not the same with a spring doing work on a body?

It is my understanding that we can define a potential energy function for all systems being acted on by a conservative force. Since the spring force is conservative, why can't we define a spring (elastic) potential energy for the body? Why is the potential energy defined only for the spring?

Particles have gravitational potential energy due to its position in the gravitational field.

Systems have potential energy. Ascribing the energy to a particle is incorrect.

We say the particle has potential energy and not the Earth (the body doing the work).

That is incorrect. The potential energy is a function of the system, specifically the relative position.

Why is it not the same with a spring doing work on a body?

It is the same. If you have a potential like $-GmM/|\vec r_1-\vec r_2|$ then it is a scalar that assigns a number to a configuration of the system, so it depends on the the coordinates $(x_1,y_1,z_1)$ of one particle and the coordinates $(x_2,y_2,z_2)$ of the other particle. The gradient with respect to the $(x_1,y_1,z_1)$ coordinates gives an equal and opposite force as the gradient with respect to the $(x_2,y_2,z_2)$ coordinates.

It is my understanding that we can define a potential energy function for all systems being acted on by a conservative force.

Now you're talking. If you had a potential like $-GmM/|\vec r_1-\vec r_2|$=$\frac{-GmM}{\sqrt{(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_2)^2}}$ then each particle feels an equal an opposite force. So of they started out at rest they move towards each other. They each gain some kinetic energy and the potential energy gets more negative because of the motion of both of them towards each other each helps make the denominator smaller.

Since the spring force is conservative, why can't we define a spring (elastic) potential energy for the body?

We do do it the exact same way. For gravity, the potential energy depended on how far away the particles were, and if one was so much more massive it barely moved and so it seemed like all the changes were on and due to the other one.

For a spring the potential energy depends not on the relative separation of two things, but on the compression of the spring.

Why is the potential energy defined only for the spring?

The potential energy is always defined for the system. But when you have a heavy object and a light object under gravity then the heavy object barely moves and so you can describe the configuration of the system almost perfectly by just describing the location of the small object. And for the spring you can describe the energy of the system almost perfectly by describing the length of the spring.

So to be clear, the energy is always a function of the system. In one case (object and earth under gravitational force) you can approximately describe the energy quite well by describing just one object. In another case (object and spring under Hooke's Law force) you can approximately describe the energy quite well by describing the other object (the spring and its length).

How you can easily describe an energy is not the same as where the energy is defined. It is always defined for the whole system. And you can see that if you had a spring in a gravitating system, which since it has more potentials is even more complicated.

• A particle can be considered a system in its most simple form. You can still define an input and output. – docscience Oct 2 '15 at 19:16
• @docscience If you are suggesting an improvement to my answer, I can't tell what you are suggesting. – Timaeus Oct 2 '15 at 19:17
• The particle can constitute a system into itself, but you are right, that you can't define a potential energy for the single particle system. Potential energy requires introducing at least one other particle – docscience Oct 2 '15 at 19:21
• @docscience I was trying to say the potential energy function is more rightly a field on configuration space rather than a field in space. When there is just one particle the distinction goes away, which is exactly why I emphasize the general case since the special case could easily be generalized the wrong way. – Timaeus Oct 2 '15 at 19:23

Potential energy is just energy stored in a static state -without motion. So a spring can have potential energy, and so can a body attached to the spring that's in a gravitational field. So for this type of system (undamped harmonic oscillator in a gravitational field) potential energy is not strictly defined for the spring. If the forces are conservative and energy is trapped within the system, and not lost outside the system, the energy will continue to flow between potential and kinetic energy states, and the spring and body can share the potential energy.

Potential energy like Force occur in pair. If one has some potential energy due to 2nd, 2nd will have the same potential energy as the first. In the Gravitational potential energy equation :

$U = \frac{GMm}{r}$

The potential energy is dependent on both the masses. This value is same regardless whether it is for 1st or 2nd. Both the body can do Same amount of work. But since work is $F.d$ = $m.a.s$, due to larger mass of $M$ it will undergo negligible acceleration and displacement.

Similarly, we can equally say that potential energy due to stretched or compressed spring is equal for body or the spring. Both spring and the body has equal capacity to do work when released. if you release spring of its hinges, or release the force on the object, the object and the spring will do equal amount of work on them respectively.

Hope I didn't confuse you.