The unsteady motion of two elastic systems described by nonlinear differential equations in generalized coordinates is considered. It is believed that in the initial state or during the transformation process, these two systems are connected to each other in a finite number of points by elastic or geometric holonomic bonds. Based on the principle of virtual displacements (D’Alembert-Lagrange), the equations of motion of the composite system in the same generalized coordinates are obtained taking into account the constraints. In this case, elastic bonds are taken into account by adding the potential energy of deformation of the connecting elements, which is expressed using the conditions of the connection through the generalized coordinates of the two systems. Geometric bonds are taken into account in the variational equation by adding variations to the work of unknown reactions of bond retention at their small possible changes and are expressed through variations of the generalized coordinates of the systems under consideration. From this extended variational equation, equations of the composite system are obtained, to which algebraic equations of geometric relationships are added. This approach is equivalent to the approach of obtaining equations in generalized coordinates with indefinite Lagrange multipliers representing reactions in bonds. As an example, we consider a system consisting of a bending elastic, inextensible cantilever beam that performs non-linear quadratic longitudinal-transverse vibrations, at the end of which a heavy rigid body is pivotally connected, which rotates through a finite angle. The beam bending is represented by the Ritz method by two generalized coordinates. Two linear constraints on the displacements of the beam and the body in the hinge are satisfied exactly, and the third nonlinear constraint, representing the condition of inextensibility of the beam, is added to the equations of motion of the system, including an unknown reaction to hold this constraint. Numerical solutions of the initial problem of forced nonlinear vibrations of a beam with an attached body are obtained in two versions with comparisons: 1) the nonlinear coupling is satisfied analytically accurately, and the unknown reaction is excluded from the vibration equations; 2) the connection is differentiated in time and is satisfied by numerical integration together with the differential equations of motion of the system.