Are you dealing with a difficult maths problem or with difficult feelings about a maths problem?
Is the struggle with the work itself, or with your feelings – apathy, disillusionment, fury – about doing it?
It might help to shift your attention to those feelings instead of the problem in front of you. So your focus is no longer “write this article” or “make this thing” but “master my feelings about this work” or “inspire myself to finish this piece of the project.”
It might not help, of course, but working with our feelings often turns out to be the hardest part of doing good work. If you can work with them, there’s a double satisfaction in a job well done.