If you want to promote the spread of science and technology, be as enthusiastic about it as you can – that's the conclusion of a new study that found interest in STEM subjects could be contagious amongst students in the classroom.

Not only that, a positive vibe in lessons can also improve grades and lead to more people following careers in the sciences, according to the study of 6,772 students from 50 universities and schools across the United States.

The team from Florida International University says the onus is on colleges to get students engaged and on the rest of us to rave about just how brilliant STEM (science, technology, engineering and mathematics) subjects are.

"People have been found to readily catch the emotions of others and we see this happening in science classroom environments," says lead researcher Zahra Hazari. "This really emphasises the importance of having engaging environments to hook students to science and motivate them towards learning."

After factoring out differences in gender, family support, academic achievement, quality of teaching, and prior interest in STEM classes, the researchers found that the level of interest from peers had a "significant effect" on science career choices.

This trend was observed across biology, chemistry, and physics, and in most cases average grade levels also reflected how keen fellow students were, though the effect wasn't as great.

In other words, working in a STEM classroom where the people around you are genuinely interested in what's being studied can help to get you more interested too.

Even students who weren't all that keen on science before were shown to develop an interest if their classmates did, the study showed.

The good news for teachers is they can inspire a group without going around each student individually – get enough of the class interested and that enthusiasm should rub off on other people.

However, the researchers admit getting students interested and motivated in STEM classes is difficult, because the work is often challenging and complex.

Many other studies have previously looked at the same idea of emotional contagion, the way that other people's attitudes also affect how we feel. Scientists think that it can influence our moods and even our deepest fears.

This positive or negative contagion could be particularly strong in students, suggest the researchers behind the new study, because our personal characters are still being developed and defined.

But the researchers warn there's still a lot of work to do in figuring out how to put across the benefits of STEM studies and careers, particularly to underrepresented groups.

"Recent studies indicate that many capable high school students are opting out of STEM careers in favour of other preferences and that the underrepresentation of women and marginalised racial/ethnic groups in STEM jobs is still a major concern," write the researchers in their published paper.

The challenges of getting and keeping students interested in STEM is real then, but some of the solutions might be pretty straightforward – if you've got a love for all things science, tell a friend about it.

The research has been published in Science Advances.