# How to compute Gravitational potential energy

Find the potential energy of a system of four particles placed at the vertices of a square of side $\ell$. Also obtain the potential at the centre of the square.

In the question above can somebody explain what values should be taken to compute the gravitational potential energy? I cannot understand the answer given the textbook which takes "pairs" of masses and somehow sums them up.

Energy is a scalar quantity, so they are calculating potential energies for each pair of masses. and later just adding them to get the total energy. The equation of potential energy due to one mass to another is : $U=Gm_1m_2/r$ where $r$ is the distance between $m_1$ and $m_2$ masses. so for a square, you will get 6 such pairs. Calculate $U$ and add them. Now for the center, consider a unit mass there, and the distance of it from the vertices are $√(l^2+l^2)/2$=$l/√2$. And calculate similarly.
1. $${m_1, m_2...m_4}$$ are 4 masses.
2. Now $${(m_1,m_2)(m_1,m_3) (m_1,m_4), (m_2,m_3)}$$ since $${(m_1,m_2)}$$ will be same as $${(m_2,m_1)}$$ being scalar, $${(m_2,m_4), (m_3,m_4)}$$ will be the six pairs.
3. Put $${m_1}$$ on the origin, $${m_2}$$ on the $$x$$-axis, and $${m_4}$$ on the $$y$$-axis.