Higher-order derivatives of rigid body dynamics with application to the dynamic balance of spatial linkages. (January 2021)