I ride my bicycle to school everyday with a backpack filled with books, papers, and a laptop . Some days I also carry a second backpack with gym clothes and shoes. There isn't room to fit the gym clothes in the backpack, nor would I want to even if they could fit (sweaty clothes and papers don't mix). But carrying two bags is awkward too, the second bag can't be easily carried comfortably alongside the first, it gets in the way of pedaling etc.
I had hoped to find a product out there where you can get an backpack which can attach a secondary bag, similar to how hikers attach sleeping rolls to the top of their backpacks. While some backpacks come with bungee cords on the front, it's not clear that this can be used to attach a bag.
This answer to a similar question shows a hiking backpack which includes a smaller detachable daypack. This is far too large for a daily commute though.
Other than that, what I was imagining doesn't appear to exist.
What solution will allow you to best carry a heavy backpack and a light gym back comfortably and portably, especially for when cycling? How would you combine your gym bag with your backpack?