Many children when transitioning from one home to another will take out stress on authority figures. This is a natural defense system that many kids put up, and there is nothing wrong with your kid if they happen to behave this way. But, these issues do need to be dealt with in a manner that is appropriate for the school, and also fair for your child.
Talk to the teacher: Let the teacher know you do not approve of this behavior and you will make an effort to make sure it doesn't happen again. Explain your child has gone through a bit of stress lately, and apologize for the fact it was taken out on them.
Explain why such behavior is bad: When first talking to your child, explain why talking poorly to a teacher is not okay. It hurts their feelings. It disrupts other children's chances to learn. And there are better ways to deal with anger in the classroom.
Listen to their side of the story: Then- ask their side of the story. Let them know "Okay, I know you know what you did was wrong. But- what made you do it? Did your teacher do something to make you upset? Or another student? Or are you just feeling mad today (I feel that way some days too)?" Then LISTEN. Don't judge. Don't interrupt. Let them tell their side of the story.
Have them write an apology note: Give them a day to cool down from the episode, and then make them write an apology note to the teacher. Even if the teacher did do something wrong- have them explain in the note how the teacher's actions hurt their feelings, but they still want to apologize for acting out the way they did. This teaches your child open communication skills- that allow relationships to develop rather than walls to be build.
Offer alternative ideas: Then work together with your child to create a list of alternate ways to deal with anger in the classroom. Have them give an idea, and you give an idea. Take turns writing down good ways to deal with being mad. Here are a few ideas.
Write down your thoughts: Have your child write down what makes them angry. If they're teacher is being mean to them, have them write down their issues and bring them home to you. Together you can decide how to approach the teacher in a nice way.
Call home: If your child is truly having a very bad day, where everything is making them mad, offer to them the option to simply call home. Let them rant for a quick minute and ask your advice on how to handle things. Just letting off the steam over a phone call can make a difference in attitude.
Talk to a counselor: Again, if your kid is just having a bad day and they are super mad- taking a moment to take a visit the counselor and talk through their issues can help clear their head and let them finish the day without an issue.