Buried deep within the body of a whale, underneath the heaps of muscles and tendons, lie some little, lonely bones. They are whale hips–and they are one of the stranger examples of evolution’s transforming power. Perhaps kinkier is a better word.

Some 54 million years ago, the ancestors of whales and dolphins were four-legged mammals. Their anatomy was well-adapted for moving around on land, including their hips. Here, for example, is an ancient member of the whale lineage, called Indohyus. The hip bones of these early whale relatives had scoops where the balls of their femurs could be tucked away. They had shelves where leg muscles could anchor. While the hips themselves were made up of a cluster of bones, they were fused together, and they were also joined tightly to the spine. Those firm connections allowed the animal to hold its body up against gravity, and use the forces generated by its legs to propel its body forward.

View Images Indohyus reconstruction. Thewissen et al. Nature 2007. 450, 1190-1194

Over the course of about ten million years, the ancestors of today’s whales moved into the water. They evolved seal-like bodies with stout limbs; later, their forelegs became flippers and their hind legs dwindled away. They lost their fur and their nostrils migrated from the tip of their head to above their eyes, where it became a blow hole. (I wrote about this transition in my book At the Water’s Edge.)

By 40 million years ago, the walking whales were long gone. In their place were species like Dorudon atrox. As you can see from this diagram, its body looks a lot like a living whale. And like a living whale, its hips have shrunk and become separate from its spine. Unlike today’s whales, however, Dorudon still had well-developed hind legs–albeit tiny ones.

View Images Dorudon. From M. Uhen, Annu. Rev. Earth Planet. Sci. 2010. 38:189–219

Within a few million years, those leg bones were pretty much gone, too. The diagram below shows a series of hip bones from the whale lineage, going from terrestrial species (Indohyus and Pakicetus) to more aquatic ones (Ambulocetus) to totally aquatic (Basilosaurus, which looked a lot like Dorudon) to living whales.

View Images Whale pelvic bones. From Thewissen et al 2009, Bioscience. dx.doi.org/10.1007/s12052-009-0135-2

All that remained were a tiny set of hip bones. They lay far away from the rest of the skeleton. They no longer fused to each other, and they no longer had the distinctive scoops and shelves that used to be essential for walking.

When we see whale hips at the end of this long evolutionary history, they make more sense. They are vestiges of the terrestrial history of whales. But the fact that they still linger is also puzzling. If hips were adaptations for a vanished life, then why haven’t they vanished altogether?

A new study in the journal EvolutionA new study in the journal Evolution helps to answer that question. Far from being abandoned by evolution, whale hips are still evolving today. While they may not be essential for walking, they still matter a lot to whales. (A quick editorial note: this post gets NSFW from here on out.)

To see why, we have to go back to those hips of land mammals. They are important for walking on land, but they serve other purposes, too. Among other things, they anchor muscles that control the sex organs. If these muscles are anesthetized in men, for example, they have a hard time gaining an erection.

As whale hips stopped mattering to walking, they didn’t stop mattering to having sex. In male whales, the pelvis controls the penis with an especially elaborate set of muscles. In some whale and dolphin species, these muscles make the penis downright prehensile.

View Images Dines et al, Evolution in press

Jim Dines of the Natural History Museum of Los Angeles and his colleagues have recently been studying how the sex life of whales drives the evolution of their hips. If a male animal can fertilize more eggs than other males, his genes may become more common over the generations. This process–known as sexual selection–can lead to all sorts of baroque adaptations in animals. Dines and his colleagues wondered if whale hips are also experiencing sexual selection.

Sexual selection gets stronger as the competition between males gets more intense. In some species, males fight battle for the opportunity to mate with females, and they often evolve big weapons like horns or oversized claws. In some species, the competition takes place inside the females, because a single female may mate with several males. Any strategy that lets one male’s sperm do better than another’s may become more common.

Females can make sexual selection even more intense. In some species, they have evolved elaborate reproductive organs that let them choose which male’s sperm she will fertilize her eggs with. Those female adaptations may drive the evolution of even more elaborate male organs that can overcome them.

One of the best ways to see sexual selection in action is to compare different species. As I wrote on the Loom a few years back, different species of ducks and other water fowl have huge penises and equally huge reproductive tracts. The longer the penis, the more maze-like the reproductive tract. This pattern suggests the birds are trapped in a sexual arms race.

Another way for males to increase their success is to produce more sperm, so as to overwhelm the competition. Scientists have tested this possibility by comparing primate species where males compete a lot with each other to species where there is very little competition–in other words, where the primates are monogamous. They’ve found that in the more promiscuous species, males have bigger testicles. (We humans have moderately large testicles, suggesting we’ve experienced moderate sperm competition.)

Dines and his colleagues decided to take a similar approach to whales and dolphins. They studied pelvic bones from 29 different species, and compared their dimensions to their mating systems. Some of the species the scientists looked at, like the franciscana dolphin, are monogamous. Other species are more promiscuous. Marine biologists once observed two male Northern Right whales mating with a female at the same time, for example.

A pattern emerged from their analysis–the kind of pattern you’d expect from sexual selection’s fingerprints. The more promiscuous a species was, the bigger its pelvis bones tended to be. The scientists also found that as whales evolved to become more promiscuous, their pelvic bones changed shape. These changes weren’t part of some general change to their skeleton, however. The ribs near the hips didn’t show the same patterns of size and shape change.

Dines and his colleagues can’t say what the change in the shape and size of pelvic bone does to a whale. That would require a level of intimate observation of whale sex that is simply impossible. But they have been able to get some clues by looking at other parts of male whale sexual anatomy. The whales with big hip bones also tended to have big testicles and big penises. This pattern may mean that hip bones are evolving as part of a bigger system. Whales with more competition may be using bigger hip bones to control a longer penis to deliver more sperm to females. (The new study only considers how whale hips may be selected in males. That doesn’t necessarily mean they have no function in female whales, which have hips too. Or perhaps they are the female equivalent of male nipples, carried along for the ride. For now, the subject is too mysterious for scientists to say anything firm about it.)

“Far from being mere relics of a terrestrial past,” Dines and his colleagues conclude, “cetacean pelvic bones are targets of sexual selection.” In fact, the only reason that we can still see these strange vestiges may be that they still matter to evolution, and in the most intimate way imaginable.