I feel your pain -- been there once with my oldest girl and will probably go there again with my youngest. My oldest girl went through the same thing. Mood swings at the drop of a hat, tantrums, little things becoming major events. We tried reasoning (didn't work), spanking (didn't work), time out (didn't work), and taking things away (some resuls there).
We talked about better ways of dealing with anger and frustration and that helped a little, over time. In the end, what seemed to work best was time, consistency, seeing the trends of when this occurred (when she was tired and didn't want to do her math homework)and trying to head these off.
Good luck -- I know how emotionally exhausting it can be for moms in these situations. Many times I was in tears myself, wondering what I was doing wrong.