When you're walking or running, your legs are doing most of the work, but your arms are involved, too. And how they move depends on your gait.

As we walk, our arms usually hang naturally at our sides and are mostly straight. But when we run, our arms typically swing while bent at the elbow.

Why is that? Researchers recently investigated how arm position affects energy efficiency, and they found that walking with bent arms was actually less energy efficient than walking with straight arms.

Related: Why Do Men Run Faster Than Women?

A bent arm has a shorter arc than a straight arm; bent arms therefore require less energy to swing back and forth and should be more efficient for both running and walking, the researchers initially hypothesized.

But if bent arms are more energy efficient, why don't walkers naturally bend their arms? To find out, the authors of the new study examined the movements of eight people — four men and four women — on treadmills. As the subjects walked and ran (performing both activities with straight arms and then with bent arms), the scientists used infrared cameras and motion-capture software to record the subjects' movements and construct 3D digital models of their bodies.

Two weeks later, the subjects repeated these treadmill sessions while wearing breathing masks, so the researchers could collect metabolic data representing the participants' energy use.

When the subjects ran with straight arms, they reported that it felt awkward. But there was no notable difference in energy efficiency, whether their arms were bent or straight, the researchers reported.

However, the scientists found that when their subjects walked with bent arms, their energy expenditure increased by about 11%, likely because it required more effort to keep their arms bent while moving at a relatively slow speed. Their experiments shed light on why people naturally hold their arms straight when they walk, "but the reason for stereotyped bent arm running remains unclear," according to the study.

According to a 2014 study, arm swinging costs energy while running, but holding them steady takes even more energy. That's because arm swinging reduces the motion of the torso, that study, published in the Journal of Experimental Biology, found.

The relationship between arm movements and gaits could help explain how arm proportions evolved in the human family tree, the researchers of the new study added.

Our extinct relatives Australopithecus and Homo habilis, which lived millions of years ago, had arms that were longer relative to their legs than they are in modern humans. Australopithecus and Homo habilis forearms were also longer relative to their upper arms, according to the study.

But shorter forearms — and a shorter arm overall — swing less. Shorter arms would therefore benefitted modern humans during long-distance running; selection for this trait could have shaped the evolution of human arm bone length, the scientists wrote.

"Modern arm proportions emerged in Homo erectus, and coincided with the evolution of endurance running as an important hominin behavior," the researchers reported.

The findings were published online July 9, 2019, in the Journal of Experimental Biology.

Originally published on Live Science.