# Derivation of Potential Energy for two masses attached to three springs

1. Sep 8, 2012

### Yondaime5685

First of all, my question isn't completely unrelated to a homework question. I know how to answer that question using definitions in the book and mechanically get to the end. But I wanted to start from basic principles and arrive at the same answer. This lead to a contradiction which sent me on a tangent to solve a more general question of my homework question.

The homework question was to setup the Lagrangian for a system with two masses that are identical and between them are two springs that have the same spring constant. Also the floor is frictionless, so no gravitational force need be concerned with.

Crude picture: (Masses are the circles.)
$|--k---m--k--m$
$|-----O-----O$
$|-----x_1----x_2$

Now I can write the Lagrangian. Kinetic is easy: $T= .5m[(x_1)^2+(x_2)^2]$

The potential is also easy, if you go with the logic of how many different ways can the masses be displaced: $x_1$, $x_2-x_1$, & $x_2$

$U = .5k[(x_1)^2+(x_1-x_2)^2]$

Now the rest of the question is easy since $L=T-U$ and so on...

But this is where I went back and wanted to derive the potential from scratch instead of arriving at it by "analyzing" the problem and deducing the U. (From here on, I'm going back to the classical example of two different masses & three spring constants, which is a generalization of my original homework question.)
$|--k_1---m_1--k_2--m_2---k_3--$
$|------O------O-------|$
$|------x_1------x_2------$

So I added up the forces for the two masses:
→$F_1= m_1(\frac{dx_1}{dt})^2= -(k_1+k_2)x_1+k_2x_2$
→$F_2= m_2(\frac{dx_2}{dt})^2= k_2x_1-(k_3+k_2)x_2$

Next I use $F=-∇U → -∫F\cdot dr= U$ to get the potential for each:
→Since the system is one-dimensional, I just use the x coordinate for the integration.
→$-∫F_1dx= -[∫-(k_1+k_2)x_1dx+∫k_2x_2dx]=\frac{1}{2}(k_1+k_2)(x_1)^2-\frac{1}{2}k_2(x_2)^2=U_1$
→$-∫F_2dx= -[∫k_2x_1dx-∫(k_3+k_2)x_2dx]=-\frac{1}{2}k_2(x_1)^2+\frac{1}{2}(k_3+k_2)(x_2)^2=U_2$

So now I can add those together, to get the total potential energy, $U_{Total}$:
→$U_{Total}=U_1+U_2=[\frac{1}{2}(k_1+k_2)(x_1)^2-\frac{1}{2}k_2(x_2)^2]+[-\frac{1}{2}k_2(x_1)^2+\frac{1}{2}(k_3+k_2)(x_2)^2]$
→$U_{Total}=\frac{1}{2}(k_1+k_2)(x_1)^2-\frac{1}{2}k_2[(x_1)^2+(x_2)^2]+\frac{1}{2}(k_3+k_2)(x_2)^2$

Now this is where the contradiction happens with any source I go to look up the "right" potential energy for a system like this. For example, on page 430-431 on Taylor has the Potential energy as:
→$U_{Total}=\frac{1}{2}(k_1+k_2)(x_1)^2-k_1x_1x_2+\frac{1}{2}(k_2+k_3)(x_2)^2$

The only difference being the middle terms:
→$-\frac{1}{2}k_2[(x_1)^2+(x_2)^2]\neq-k_1x_1x_2$ (Well, they only equal each other when $x_1=x_2$.)

So obviously I did something that I thought was right but isn't. Was it that I couldn't add up the potential energy like I did..? Or was it that I didn't consider all the forces when I was setting them up for each mass..? (For this question, even Taylor started with the same setup for his differential equations.)

Sorry for the very long post. This has been bugging me literally all day. I would very much appreciated if someone can shed some light on this for me.

TL;DR Lol, I know some people are busy :tongue2::
How to get from this step of Forces:
→$F_1= m_1(\frac{dx_1}{dt})^2= -(k_1+k_2)x_1+k_2x_2$
→$F_2= m_2(\frac{dx_2}{dt})^2= k_2x_1-(k_3+k_2)x_2$

To this Total Potential Energy of the system:
→$U_{Total}=\frac{1}{2}k_1(x_1)^2+\frac{1}{2}k_2(x_1-x_2)^2+\frac{1}{2}k_3(x_2)^2$
Or
→$U_{Total}=\frac{1}{2}(k_1+k_2)(x_1)^2-k_2x_1x_2+\frac{1}{2}(k_2+k_3)(x_2)^2$

Without just simply writing out the Potential Energy from "analyzing" the 2 mass 3 spring system..?

Last edited: Sep 9, 2012
2. Sep 9, 2012

### andrien

$$U_{Total}=\frac{1}{2}(k_1+k_2)(x_1)^2-k_1x_1x_2+\frac{1}{2}(k_2+k_3)(x_2)^2$$
I just think that K1x1x2 type term should be K2x1x2.I have not checked other things however your integration of forces is wrong because the terms are some x1 ,x2 type and you are integrating with respect to some x which you have not defined anywhere.so it is better to stick to the definition of potential energy of the spring to calculate potential energy and in that way you can do it rather easily.

3. Sep 9, 2012

### Yondaime5685

^ Yes you are right. I just typed it wrong when I was reading it off of Taylor. Thanks

For the integration, yes I made it really general and simplified, but it is right. I'm still integrating along the general x-axis since both variables, though they are named different, still vary in the x-direction. (Note the change from "dr" to "dx" since the dot product would reduce down to dx. Where $\vec{dr}=dx\hat{x}+dy\hat{y}+dz\hat{z}$)

Also you should read the beginning of my post. I can do it the easy way like you said, but I want to know the derivation. Not for the homework's sake but for my own personal understanding of the physics and the corresponding math derivation.

Thanks again for pointing out that misprint.

Last edited: Sep 9, 2012
4. Sep 9, 2012

### andrien

yes they both vary along x axis but you can not integrate them in the way you are doing because you can
$$-∫F_1dx= -[∫-(k_1+k_2)x_1dx+∫k_2x_2dx]=\frac{1}{2}(k_1+k_2)(x_1)^2-\frac{1}{2}k_2(x_2)^2=U_1$$
in this expression write x2-x1 as single variable of x and integration would be different .In your derivation potential energy like containing $$k_2(x_2)^2$$ is coming out negative which is not the case.so be careful.

5. Sep 9, 2012

### Yondaime5685

Hmm... I see what you mean. Let me look into that in the morning. It is about 2:15 in the morning for me and I got to get some shut eye.

From a quick glance, I would argue that I never wrote down my forces in "$x_2-x_1$" terms, so I would not run into that. But I'm sleep deprived so I may not see some obvious things.

I'll reply back sometime tomorrow. Thanks.

6. Sep 9, 2012

### andrien

perhaps you would like to see how it will come out from the force.
U=∫k1x1dx1+∫k2(x2-x1)d(x2-x1)+∫k3x2dx2
From this expression you will found out your potential energy as required.be sure to verify it

7. Sep 9, 2012

### Staff: Mentor

F1 is the derivative of U (all of it!) with respect to x1.
F2 is the derivative of U (all of it!) with respect to x2.

Therefore, from integrating F1 in x1 in you get:
$$U=-\frac{1}{2}(k_1+k_2)x_1^2 + k_2 x_2 x_1 + f(x_2)$$
where f(x2) is the integration constant (which might depend on x2)
In a similar way, F2 leads to
$$U=-\frac{1}{2}(k_3+k_2)x_2^2 + k_2 x_1 x_2 + f(x_1)$$
Apart from a constant, this defines a unique U:
$$U=-\frac{1}{2}\left((k_3+k_2)x_2^2+(k_1+k_2)x_1^2 \right) + k_2 x_1 x_2$$
And this is the correct potential.

8. Sep 9, 2012

### Yondaime5685

Ahh... That was my gap in my understanding. I don't know why I didn't see it that way from the beginning. With that in mind, I derived the right potential.

Thank you guys for helping!