I saw this and I could have written it, it reminds me so much of my son, he's almost 7, and I homeschool him also.

Just about every single time he has trouble (or even has imagined trouble) with something new, usually math or piano, I can guarantee a temper tantrum.

When he throws a mega temper tantrum, I send him to time out, end of story. He didn't go on his own at first, but he now knows what is coming when his anger escalates. 6 minutes, and then it's like some crazy magic his mood improves, and he does what he's told to do.

Some other things I noticed that help...

If I sit with him while working through the problems, even if I really don't say anything, he seems to be a lot calmer and happier when I'm just there, listening to him.

We have a regular schedule everyday, he knows what he needs to do everyday, by the end of the day. Otherwise he loses time on the weekend, to catch up with what he missed during the week... and he loves his no homework days so he strives to get it done.

He is so, so, so much worse if I throw him off schedule and go on vacation or randomly decide to take days off. Maybe he thinks life should be carefree like that all the time. Because he flips out after breaks, we don't take much time off. I give him easy days, so I can have a bit of a break, but it's much easier for both of us if he does school on designated school days.

I try to be an example to him, remind him that no one is perfect, not even me.

I also instead of congratulating him on how smart he is (which is hard because he is soooo smart), smart is not necessarily a trait that is going to get him places in life, so I try to congratulate him for working hard and go overboard with extra compliments when he takes initiative to go ahead and figure it out on his own.

Hope this helps