Differentiating Equation containing modulo operation
They are simply calculating the derivative for \$0&lt;\theta_R&lt;\pi\$, and not giving a solution for the points of discontinuity.
The discontinuity happens because the brushes transfer from one slip ring to the other at that angle. But the real physical system won't have a mathematical discontinuity there. There will be some dead zone where the brushes lose contact with either slip ring, or some more complicated transition if the brushes can contact both slip rings at the same time.
This analysis chooses to ignore this complexity and just give a solution for all the other rotation angles, which will give a useful approximation for the overall behavior of the motor.