How to come up with an non-trivial idea in theoretical computer science? I am a PhD student working in theoretical computer science. I have read the research papers of many researcher and I have seen many tools and mathematics they use for designing an algorithm. For example see this research paper [Primality in P]. I would not say this research paper is based on one or two ideas but it is based upon many ideas which requires serious mathematics. I am struggling to come up with those kind of ideas from couple of years. I have worked on one problem for many months, but there is nothing non-trivial coming into my mind. All the ideas which have come into my mind till now are trivial and of very little use to theoretical computer science researchers. I am wondering how to come up with a machinery which will enable me to generate non-trivial results.

Question : How to come up with a non-trivial idea in theoretical computer science? I know there are different meanings to the word "non-trivial idea". For me, it is something publishable and interesting to the theoretical computer science community. I have seen some research papers in which they define few (mathematical) terms then design the algorithm using the defined terms. I wondering how to come up with such things.

One advice I have got from my research friends and seniors is to read the research papers carefully and read the mathematics (theorems and proofs) very carefully, try to do the proofs on your own and try to extend them.
Almost certainly there are lists of open problems in your particular subfield.  Find them and read them.  Although it's rather unlikely you will be able to solve these problems --- at least right away ---, use them as a starting point.  Can you solve some particular cases?  Can you solve a less general problem?  Can you show a more general problem is computationally difficult?
Read what other people are doing.  This means making a list of the conferences and journals in your area, and devoting at least an hour a day to reading papers in them.  There is no need to understand everything at once.  Try to familiarize yourself with the general themes, then pick one or two papers that seem interesting or fundamental and immerse yourself in them.  Study the
techniques and proofs.  Can you apply them to similar or related problems?  Work out specific examples in detail, to the extent possible.
When reading any result, ask yourself:  are all the hypotheses necessary?  What if the hypotheses are weakened or strengthened?  Are the bounds really optimal?  If only an upper bound is proved, can you prove a matching lower bound?