Everyone who was once a child knows the incredible, simple joy that comes from blowing bubbles and watching an ultra-thin layer of liquid bob through the air before bursting apart. While it seems like magic when you’re a little kid, it turns out the mystery behind how bubbles work is not much more clear for adults. What’s the recipe that separates making a good bubble from making a bad bubble?

A team of mathematicians from New York University decided to take on the super daunting task of solving that mystery, and their findings, published in the latest issue of Physical Review Letters, brings us closer to understand how to blow the perfect bubble.

Okay, let’s be clear: it’s not as if the team decided they just had to figure out how to blow the perfect bubble and inspire a new generation of master bubble blowers. According to Leif Ristroph, a mathematician at New York University and a coauthor of the new paper, the study originated from a desire to learn more about fluid-structure interactions: problems where an object (in this instance, an object made of liquid film) is influenced by changes in an external flowing fluid (in this case, wind generated by blowing). And there are, in fact, relevant reasons to study bubble blowing.

“It’s a huge area of research,” says Ristroph. “We’ve studied things like why a flag flaps in the breeze and how clay or some erodible material gets reshaped by flowing water. We wanted to study the important problem of how liquid films interact with flows, and what better problem to start with than blowing bubbles!”

It’s difficult to control, measure, and observe bubbles moving through the air with great precision. To bypass these complications, the team quickly realized they ought to create bubbles and visualize their movements underwater, a medium that’s easier to control. So they made films in water with common oils (like olive oil) and coaxed the water flow to form bubbles with help from a wire loop. The oil bubble is proxy for a soap film bubble, while the water is a proxy for wind. “Every good experiment involves a trick,” says Ristroph.

Throughout several different experiments and observations, Ristroph and his colleagues determined two ways a liquid film can stretch, grow, and inflate as it pinches off into a bubble. “One way is to blow with a steady but sufficiently fast wind, which simply causes aerodynamic pressures to overpower the surface tension of the film that wants to make it stay flat,” he says. This means blowing steadily on the film or moving the wand through the air at a fixed speed that allows a bubble to form and pinch off.

“The second way,” he says, “is to blow gently on a film that is already bulged out or deformed.” This could be accomplished by delivering a sharp puff of air that helps eject a bubble off the wand, even after the burst of wind tapers off.

The ideal wind speed is actually contingent on how big of a bubble wand you’re using. Ristroph and his colleagues developed a mathematical formula for what constitutes the optimal wind speed for blowing a bubble, assuming you’re blowing perpendicularly onto the film: U = √(5.6 x gamma / rho * R), where U is the wind speed, gamma is the surface tension coefficient between the two fluids involved, rho is the density of fluid you’re blowing, and R is the radius of the bubble wand.

“Bigger loops require smaller speeds,” says Ristroph. “Counterintuitively, bigger films are easier to blow into a bubble.” He provides a scenario for a typical child blowing typical bubbles in typical conditions: the bubble wand as having a radius (R) of 1 centimeter, gamma as 25 dyne per centimeter for soapy water, and rho as 1.2*10-3 g/cm3 for air—we get an optimal speed, U, of 340 centimeters per second, or about 8 miles per hour. For context, the average human sneeze is about 39 miles per hour (and has been recorded to maximum speeds of over 100 miles per hour). While blowing air is a different process, an 8 mile-per-hour speed is definitely doable, even for a child.

Although the study examined oil bubbles in water, Ristroph emphasizes the results apply to any liquid medium that can be made into a thin film within another gas or liquid. “The key ingredient to making films is a surfactant, a chemical additive to the film liquid that helps to let it survive and last as a film,” he says. “Soap itself plays this role for usual soap films.”

Besides arming the world with a mathematical formula for the perfect bubble, the team believes the findings serve larger implications into how certain materials in the world work. “Films as materials behave strangely as you push on them with a flow,” says Ristroph. “As you increase the flow speed, the film does not deform much at all until just before it’s ready to bubble or pop, then it deforms all at once.” He and his colleagues hope to use this new detailed understanding of the process to create more efficient aerosols, emulsifying compounds, and foams for industrial and commercial use. “These are essential to many products we use everyday, and they are all made by blowing one fluid into another to make many little bubbles or droplets.”

For the rest of us, however, the most relevant way to make sense of the new findings is to plug some numbers into the formula and start blowing bubbles. There’s no practical way to actually measure how fast you’re blowing into your wand of choice, but that shouldn’t stop you from trying to zero in on the perfect wind speed.