They were also less likely to feel tired or mentally drained, the findings, presented at the British Psychological Society annual conference in Brighton show.
Prof David Kennedy, director of the brain, performance and nutrition research centre at Northumbria University, and a co-author of the study, said that chocolate could be beneficial for mentally challenging tasks.
The findings suggest students who binge on chocolate when revising for exams may gain a real benefit from doing so.
“For things that are difficult to do, mentally demanding things that maybe crop up in your work it could help,” Prof Kennedy said.
The flavanols, part of a group of chemicals called polyphenols, work by increasing the flow of blood into the brain.
For the study 30 maths volunteers were asked to count backwards in groups of three from a random number between 800 and 999 generated by a computer.
The findings show that they could do the calculations more quickly and more accurately after they had been given the drink.
However, the same was not true when the maths group was asked to count backwards in groups of seven, which the researchers described as a more complex task, requiring a slightly different part of the brain.
The findings also show that the maths volunteers did not get as tired doing the calculations if they had been given the cocoa drink, despite being asked to do them over and over for an hour.
The researchers gave the maths volunteers a total of 500mg of flavanol.
Although the amount was too great to be found naturally in the diet, researchers said that people should ensure that they have lots of flavanols, also found in fruit and vegetables, on a regular basis.
Emma Wightman, one of the study’s lead researchers, said: “You can get bars of chocolate that have 100mg of flavanol, and we are also going to look at the effect of lower doses of flavanol on the brain.”
Dark chocolate contains higher quantaties of the chemical than plain or milk chocolate.
Prof Kennedy added: “The amount that you are giving is more than in the diet but there is quite a lot of evidence that general amounts are protective against declining function and that kind of thing.
“The more fruit and vegetables and things that are high in polyphenols the better that is for your brain in the long run.”