(n.) The act of deriving equations just for the sake of deriving them, at no apparent gain to the student.
In verb form, to mathturbate is to perform such menial mathematical labor.
mathturbatory: characterized by excessive mathturbation
"The professor spent three hours deriving the equation on the board because he thought it would help us understand the concept better; really, however, he just confused us with his senseless mathturbation."
"The homework problem required hours of mathturbation, with the end result being a simple identity that appears in the index of every text."
The state of mind resulting in an action that a person, usualy male, feels when forced to attend a math class of any kind. They become bored sitting in the back of the class and feel the need to undo/remove their pants behind the math textbook. They then partake in some enjoyable activities resulting in self satisfaction that helps them to survive the remainder of the math class.