The moment of inertia of an n -body system is given by I = ∑ ∑ i = 1 n m i q i ⋅ ⋅ q i = ∑ ∑ i = 1 n m i ‖ q i ‖ 2 and the virial is given by Q = ⁠ 1 / 2 ⁠ ⁠ dI / dt ⁠. Then the Lagrange–Jacobi formula states that d 2 I d t 2 = 2 T − − U .