How do I calculate the deflection and stress of a beam that is rotating freely (for example in space) when a moment is being applied to it, for example by rocket motors at the ends of the beam?
To do this, first calculate the linear and angular acceleration of the beam produced by the applied loads, assuming it is a rigid body.
Then calculate the distributed inertia loads that are equivalent to the acceleration (i.e. mass $\times$ acceleration for each point in the body).
Finally, apply the opposite of the inertia loads plus the applied loads. The total load on the system is now zero, so you can fix it at any point (e.g. its center of mass) and there will be no reaction where you fix it.
As a example (ignoring rotation, to keep it simple) consider a rocket modeled as a uniform bar of length $L$, cross section $A$, and mass $m$, with an axial force $F$ applied at one end.
The rigid body acceleration is $F/m$ in the axial direction.
The corresponding inertia loads are a uniform distributed force $F/L$ applied along the length of the beam.
So, you do a stress analysis with the force $F$ at the end, plus a distributed load $-F/L$ along the length. The result is that the internal axial stress varies linearly, from $F/A$ at the point where it is applied, down to zero at the other end.
Computer software may have an option to do all this automatically, called "inertia relief" or something similar.
If the moment applied starts from zero and grows up to the final level in a short period of time, such as a perturbation, it will cause the rod to vibrate roughly similar to diapason or if it is a rod its first mode of vibration with trace a pattern like X in the space.
If the moment applied holds steady after initial impact the rod will vibrate and rotate.
The Duhamel intgral can be applied in simple cases, but in real world situations like the effect of impact of a car crash into the road guard rail the use FEM methods is preferred.