Two hypothetical planets of masses m and m are at rest when they are infinite distance apart. Because of the gravitational force they move towards each other along the line joining their centres. What is their speed when their separation is 'd'? (Speed of m is v and that of m is v)

Since no external force acts on the two-planet system, the net linear momentum is conserved. Initially, both planets are at rest at infinite separation, so the total initial momentum is zero.
From conservation of linear momentum, ,
As gravity is a conservative force, the total mechanical energy of the system remains constant.
Total initial energy at is .
At separation , the total energy is
Equating :
Substituting the value of from equation (1):
By symmetry or by substituting back into equation (1):
Tagged Gravitational potential energy of systems. Machine-assigned, so read it as a strong shortlist rather than a verdict.