I'm told that swept wings perform better when an aircraft is trying to break the sound barrier. I was wondering why that would be?
It's all about the 'effective' Mach number that the wing sees. In essence, for a swept wing, the Mach number that the wing 'sees' as far as compressibility effects are concerned is the Mach number of the component of the freestream normal to the wing chord:
(Source: stanford.edu via archive.org)
By sweeping the wing back, you can get closer to the speed of sound without getting supersonic flow over the wing (remember, a wing generates lift by accelerating the air flowing over it, thereby decreasing the pressure - so you'll get supersonic flow over the wing before the freestream is supersonic). Of course, once you fly supersonic, there's really no getting around having shock waves over the wing - however, you can reduce their strength with wing sweep.
Swept wings are beneficial at transonic flight regimes (M=0.8-1.2). At transonic flight regimes there is a drastic increase in drag (CD is more or less constant up until that point) due to the effects of compressibility, which manifest themselves in local sonic regions on the wing (the plane itself can be flying at M=0.78, yet over some portions of the wing, where the pressure is low, velocities may go sonic and supersonic). There is a very large amount of wave drag in such regions. The swept wing essentially reduces the effective velocity, so the flow remains subsonic and shocks do not form over the wing, thus not leading to the generation of large amounts of drag. Check out stuff on critical Mach number (drag divergence number).
In general, swept back wings aren't better at breaking the sound barrier. Indeed, if you see the first plane to break the sound barrier in horizontal flight (the Bell X-1) it didn't have swept wings. And it was developed after swept wings were developed.
What happens to wings as you get supersonic is shockwaves flowing over the wings. Specifically control surfaces. If you get shockwaves over your control surfaces you will basically lose control.
During WW2 several P-51 Mustangs and P-38 Lightnings crashed after being unable to recover from a dive. Both planes had engines fast enough to bring them to 70% the speed of sound in horizontal flight. In a dive it is entirely possible for them to break the sound barrier. And indeed it was speculated that that's what caused the crashes. Dive breaks were retrofitted to P-38s to allow them to slow down enough in a dive to regain control.
If you want to continue flying at or beyond Mach 1 you need to avoid your control surfaces from entering shockwaves. Since shockwaves are generally conical in nature you basically have two techniques you can use:
Sweep the wing back so that they stay within the cone of the shockwave.
Make your nose longer so that you push the shockwave away from the wings (or push the wings back away from the shockwave depending on your perspective).
OK- one can fly also with straight wings supersonic- then one needs other airfoils. See e.g. the starfighter. This is a non-swept-design because Starfighter is an american design and Busemann was a german.
Disadvantage of sweep: One has boundary layer displacement and therefore it's nearly impossible to keep laminar flow.
Advantage of sweep: Reduced motion of neutral point compared to straight wing when going to supersonic. Therefore some machines with straight wings crashed because pilots couldn't recover.
----Edit --- Sweep reduces motion of the neutral point. Lowest motion is visible for a delta wing. : See Schlichting/Truckenbrodt Band 2 P. 214/227 ch. 8 pict 8.59/8.70 (my bible). Therefore sweep/delta reduces control problems, sorry.