The flexible couplings are just the ticket for this type of problem.
The thing to watch out for is their length. Make sure that they are long enough to go between the two end pieces because during flexing, it might be possible to spring off the end if they are to short.
Cheers
Ken