What do you do when you're stuck? I'm pretty sure almost all mathematicians have been in a situation where they found an interesting problem; they thought of many different ideas to tackle the problem, but in all of these ideas, there was something missing- either the "middle" part of the argument or the "end" part of the argument. They were stuck and couldn't figure out what to do.


*

*In such a situation what do you do?

*Is the reason for the "missing part" the incompleteness in the theory of the topic that the problem is related to? What can be done to find the "missing part"?


For tenure-track/tenure professors, maybe this is not a big deal because they have "enough" time and can let the problem "stew" in the "back-burner" of their mind, but what about limited-time positions, e.g. PhD students, postdocs, etc., where the student/employee has to prove their capability to do "independent" research so that they can be hired for their next position? I think for these people it is quite a bit of a problem because they can't really afford to spend a "lot" of time thinking about the same problem.
 A: My personal experience - it helps to listen to some talks, not necessarily very closely related to your problem, ideally not online, so you can discuss it with somebody after the talk, etc. Try to find analogies, maybe even superficial ones, the more unexpected the better. It is not only about thinking out of the box, what is more important is that somebody might be "digging from the opposite side" for the same thing you are after.
A: Sometimes it's good the keep the problem in the back of your mind while you do other stuff that appears irrelevant. Here is Stanislaw Ulam's account of the invention of the Monte Carle Method--from Los Alamos Science Special Issue 1987. Anything may suggest a way to tackle your problem.

The first thoughts and attempts I made ... were suggested by a question which occurred to me in 1946 as I was convalescing from an illness and playing solitaires. The question was what are the chances that a Canfield solitaire laid out with 52 cards will come out successfully? After spending a lot of time trying to estimate them by pure
combinatorial calculations, I wondered whether a more practical method than
“abstract thinking” might not be to lay it out say one hundred times and
simply observe and count the number of successful plays. This was already possible to envisage with the beginning of the new era of fast computers, and I immediately thought of problems of neutron diffusion and other questions of mathematical physics, and more generally how to change processes described by certain differential equations into an equivalent form interpretable
as a succession of random operations. Later...  described the idea to John von Neumann and we began to plan actual calculations.”

A: Here is an answer which may be math-specific: If you are stuck in some proof of some claim that you believe is true:
Add the missing piece as assumption and continue as planned.
A: A little buddhism goes a long way here, it seems.
There is a slight difference between being stuck and being obsessed.
As the saying goes, doing the same thing over and over again and expecting a different result is the definition of insanity.
So, if by stuck you mean obsessively trying to remove a single obstacle despite it's not being ready to move, I'm not so sure of the value of this.
On the other hand, if by stuck you mean that you are filling in more and more detail around the obstacle in order to "soften it up", then this is quite a healthy process.
I mention the buddhism, because "it is stuck" is much healthier than "I am stuck" (although a buddhist may not even acknowledge that anything is stuck at all). Mathematicians are a bit too obsessed with the "I", and this creates undue emotional distress and paralysis. As you mention, this situation is much worse for those who don't have the luxury of time. This creates a very sad situation, because being all bunched up like this really messes with the ability to relax and perceive what is right in front of you. Rather than naturally growing a point of view, you end up endlessly beating yourself up for trying to repeatedly stuff a square block in a round hole.
If you stop taking things so seriously, you will find that it is enough to attend to the problem and obstacle fluidly, and enjoy the process of exploring around the obstacle. A good problem provides many opportunities to do this.
You might ask what constitutes a good problem, even. Stubbornly chasing the accolades of breaking a hard problem looks a little silly if you stand back far enough, especially when contrasted with enjoying the unfolding of a breathtaking structure that is "ripe", so to speak.
I get the impression that too many people are in love with the idea of being a mathematician, more than with the mathematics itself. If you honestly investigate the quality of your experience in doing math, maybe a break is in order, or a career shift, or a problem shift. Good mathematics is supposed to be fun. I think we forget this much too often!
Regarding the career trajectory, there are economic realities to consider. Everyone feels that their work/research/contribution should be valuable to the development of their subject. This is certainly true, but I think we tend to overvalue our own contributions. In the grand scheme of things, only a few of us will find a fruitful enough direction to support a career in research. (I am not one of these, although I've had some rewarding ideas.) If you put the "I" on the back burner, this is easier to accept. Maybe, despite your interest in obsessing over a problem, your effort would be better spent elsewhere? Maybe you fit into the world differently than you plan to? Ironically, accepting this reality may be the best way to get "unstuck" on your problem.
Once I was talking with Peter Jones from Yale about this sort of thing. I was talking to him about how hard I was working on such and such and how I had to learn to do this and that thing better and change my focus in such a way. Peter said to me, "That's funny, I always just did what I liked!" I realized afterward that there was a sobering reality to this. He just fit into his part of the mathematical world a bit more naturally than the rest of us. All of his experience perhaps led naturally to where he was. Others, like me, were forcing it.

Edit:
Here is a Zen Koan:

A monk asked Tozan, "How can we escape the cold and the heat?" Tozan replied, "Why not go where there is no cold and heat?" "Is there such a place?", the monk asked. Tozan commented, "When cold, be thoroughly cold; when hot be hot through and through."

So there is an answer the OP's question akin to the above Koan:

When stuck, be thoroughly stuck.

A: One stochastic algorithm that sometimes works for me:

*

*Take Pólya's "How to solve it" from bookshelf.


*Open at random page, and read for a few pages.


*Now attempt problem again.
A: I think there's some good advice on how to conduct research in J.E. Littlewood's "The Mathematician's Art of Work", included in Littlewood's miscellany, CUP, 1986.

"A sine qua non is an intense conscious curiosity about the subject, with a craving to exercise the mind on it, quite like physical hunger ... Given the strong drive, it communicates itself in some form to the subconscious, which does all the real work, and would seem to be always on duty. Lacking the drive, one sticks."


"Minor depressions will occur, and most of a mathematician's life is spent in frustration, punctuated with rare inspirations. A beginner can't expect quick results; if they are quick they are pretty sure to be poor."

Littlewood includes a section of research strategy, too long to quote here, which I believe is very worthwhile reading.
A: In my experience, one key aspect to avoid getting stuck is the choice of problem in the first place. With a good project, there are many smaller questions or computations to be done when you are stuck at a particularly difficult point with the main project. Doing these tasks might not solve your particular issue, but are still productive research hours.
Of course, choosing good problems is a difficult skill and requires a lot of practice. Here are a few guidelines which I have found helpful.

*

*Choose a problem which you believe you can make some progress with, rather than one you would really likely to solve. In particular, it is generally a good idea to minimize how "clever" you need to be in order to make progress. Trying to come up with a big new idea is a high-risk, high-reward gamble and generally not advisable unless you have a good reason to believe you will be successful.
(1a. Personally, learning this skill forced me to put aside my ego and take a more professional approach to math, in which producing research is my job. Too often, mathematical culture ties people's worth to their research ability, and consciously decoupling from this was really helpful for me.)


*Building on the previous advice, once you have an established set of tools, it is often possible to find questions where these techniques may be applied. This can be the source of relatively low-hanging fruit, because it is possible to apply familiar ideas in a new setting.
(2a. One particularly good source of problems come from papers which relate several different areas of mathematics. Oftentimes, having expertise in one area provides the insights to solve problems which arise in these works. So these papers are worth reading.)


*With a good project, there are often many opportunities to prove smaller results. For example, it is often possible to sharpen existing results or establish quantitative estimates using existing techniques, and this can be a fruitful activity when you are stuck. Personally, I tend to favor projects with a quantitative aspect rather than trying to prove novel qualitative results. The reason is that even if I fail at my main task, it still might be possible to improve some epsilon from $\frac{1}{100}$ to $\frac{1}{10}$ and make some small progress.


*It can be tempting to attack a problem endlessly (and I am can certainly be guilty of this), but it is also a mathematical skill to understand when the methods you are using are unable to resolve the issue at hand. As such, when you get to a sticking point, it is worthwhile to really understand the strengths and limitations of your techniques to determine whether it is merely a technical issue that you can resolve or a fundamental difficulty. As such, learning when to quit a problem, at least temporarily, is an invaluable skill.


*(Addition, as requested) Consider what advantage you have over other mathematicians in working on this problem.  It could be that you think you have the right combination of knowledge or have done some calculations you think no one else has.  It could simply be that no one else has spent much time on the problem, or no one else has the right combination of time to spend and access to your advisor.  It could be that no one else cares about this problem.  (Hopefully, that is because you think there is some reason to care about this problem that others haven't realized.)  But if you think Person X is better at solving this problem than you from every angle, and you think Person X has worked on this problem but not solved it, then there is probably a reason you don't know why Person X hasn't solved it, and you will probably end up running into it also.
Feel free for anyone else to add advice on how they choose research problems to minimize the probability of getting stuck.
A: The only generic advice that can be offered here is that deciding what to do in this situation is quite a difficult skill, but one that you are expected to develop as a PhD student. You ultimately might have to think of the “cost-benefit” analysis.
Is the time and energy which you would expend continuing to work on this problem likely to be worthwhile?  Or could you say “I learned a lot by working on this” but move on as it will probably not be worthwhile to stay with it further?
As you know the area, the problem and the techniques, you are probably the only one who can answer that question in a definitive way, but if in doubt make sure to discuss it with your supervisor.
Finally, I think this question would be much better suited to Academia Stack Exchange (where I think there a few mathematicians anyway who might be better positioned to answer such a question).
A: Read more papers, related to your problem. You can get inspiration, or stumble upon a proof of exactly what you are looking for. It could also be that you learn some technique in a proof.
I recently realized that a proof of something I needed was already proved in an earlier paper of mine, but it was not actually stated in the actual theorem (since I did not know of that particular application at that time).
A: Not much changes with tenure -- we do not suddenly change our habits after a decade of working.
Our job is and has always been to advance the science. Since the most important unsolved problems tend to be also the most well-known, it usually means that we are almost (but not always!) perpetually stuck on the problems that we really want to solve.
Practically, this means that we spend most of our time trying to gain insights that would help us on a few important problems. So, when we are stuck, we 1) make toy problems encapsulating some of the difficulties 2) seek generalizations that would remove distractions 3) read more, or talk to others in a hope to broaden our knowledge 4) work on something else to avoid getting into fruitless loops.
However, we always remember the problems that we must, eventually, solve.
