We show that children display facial expressions when solving mathematical problems, and that adults can infer from these facial expressions whether a child finds the problem easy or difficult. More specifically, we show an age difference in displaying facial expressions while solving math problems. Eleven-year old children display more facial expressions when solving a difficult problem than 8-year olds, and are also rated to be faced with more difficult problems by adult observers. The opposite is true for easy problems. Results of our studies can be used for the development of automatic detection of affective state in educational computer environments. These environments can then adapt the difficulty level of tasks to the individual child.