Oh boy.
Complaining and whining is my kryptonite! I have found the two forms I deal with in my son require different approaches.
The first (and most prominent) is the routine response of whine when most anything is asked of my son. To deal with this, I had to totally divorce myself from my mama mode for a few weeks. Mama was concerned that the complaints/whining meant something about her teaching, curriculum choices, etc. I adopted a teacher persona and started school at nine every stinking day for a while, closed off the dining rooms doors, and made it clear that nonsense like whining/complaining would result in a loss of our daily piece of candy, and the various sources of media. I encouraged him to ask for help, and we practiced doing that in a clear non whine-infected tone of voice. After two or three days of this, I was amazed that he did it. Schoolwork was finished in 2 hours instead of taking him forever.
The second form of grumbling Popped up three months into our school year. This is the time when much of our curriculum has moved beyond the review period and we're covering new material, doing more writing, and working on assimilating new info. School has gone from being mostly done in two hours to taking 3 hours or more. In this scenario, the grumbling is usually accompanied by tears before it gets my attention. This is mental fatigue.
For mental fatigue, I try to do school smarter with an eye to the clock. Since writing tends to bog my son down, I write for him on select activities. Just this small change keeps him fresh, and he sticks with me to the end of school. The grumbling stops when our formal school subjects are confined to that two hour period.
Peace,
Stella