When solving differential equations, it seems like we often have to guess the form of the solution beforehand. How does one know what to try? It seems natural to the authors of textbooks to try say a power series solution or some other form, but I don't quite understand how they know. Also, there tends to also be the method of guessing a form of the solution then verifying later that it is valid, but won't we risk unwittingly compromise generality? Thanks.
i think that knowing and studying a bunch of existing forms is essential to one be able to develop the ability to look at an equation and recognize a pattern that would allow to transform the equation in a known form (usually with the help of a reparametrization, or a variable transformation).
Usually this pattern matching approach works because there are not too many forms whose exact solution are known
As lurscher has said, the way one knows what to try is by studying enough examples to get an idea of what's likely to work next time.
In some situations, it's not really guesswork; it's a theorem that if the equation is of such-and-such a form, then the solution is of such-and-such another form. Textbooks will generally draw your attention to such theorems.
As to the question of losing generality, there are also theorems that tell you how many solutions to expect, whether it's exactly one, or a one-parameter infinite family, or a two-parameter family, etc. In situations where such a theorem applies, once you have found, by whatever means, the appropriate number of solutions, you know that you aren't missing any.