Few things are said to be easier than riding a bike but scientists investigating our ability have discovered that it is actually extremely complicated.

The researchers from three different countries took more than three years to come up with a mathematical formula to mimic what most children can do by the age of 10.

The complex equation, which takes into account inertia, gyroscopic and centrifugal forces as well as gravity, has 31 numbers and symbols and nine sets of brackets.

The formula boils down to: Inertia forces + gyroscopic forces + the effects of gravity and centrifugal forces = the leaning of the body and the torque applied to the handlebars of a bike.

Or put more simply, if you do not pedal fast enough to keep moving while keeping the bike straight, you fall over.

The equation produced by scientists from universities in Holland, the USA and Nottingham has come to light during research by Halfords to compile tips for parents teaching their children to ride a bike.

With National Cycle Week this week, more people than ever are being encourage to get on a bike and Halfords was hoping to help cut down on the agony suffered by youngsters when going though that rite of passage when first taking to two wheels.

Paul McClenaghan, the commercial director of Halfords, said: “It turns out that getting off on the right foot on a bicycle, ditching the stabilisers and speeding away from your anxious parents is actually much more complex that people realised.

“Once you master the technique as the saying goes it’s something you never forgot, but there is a great deal of science behind the skill.”

Dr Arend Schwab of Delft University of Technology in the Netherlands who helped develop the equation explains that ever since the inventions of the bicycle in the 1860s mathematicians have been trying to use Newton’s laws of motion to explain its unique movement and ability to balance.

“People more than a hundred years ago were trying to figure out why a two wheeled bicycle, given forward momentum, like a push, would seem to balance by itself,” said Dr Schwab.

The meticulous mathematical account of bike riding and their continued research may eventually lead to better bike design with improved stability and safety, something that has also attracted the attention of British bike retailing giant Halfords.

Dr Schwab said: “Using our equation we can simulate the motion of a bike and predict whether it will remain stable or not, under certain conditions, such as if it goes over a bump, or is hit by a gust of wind.

“This equation is aimed at enabling a bike designer to change certain features and to see the overall finished effect on the bike, without having to actually manufacture it first.

“For instance if you are designing a folding bike with smaller wheels or one with a shorter wheel base this equation allows you to interpret how design changes will affect the stability and behaviour of the bike.”