Solution for harmonic oscillator using Algebraic method requires operator a and Hermitian conjugate of a which is known. But how they are obtained or derived?
a +- = 1/sqrt(2hmw)*(-+ip + mwx) . How this is obtained?
Maybe with a lot of fiddling and trial-and-errors the first time around. After which such illogical steps are carefully eliminated from all historical records. Thereafter the discovered trick is copied around, and explained as "let us introduce a = ...". Then all the nice and necessary properties can be calculated in a systematic fashion.
How do you obtain a method to solve a third-degree equation (without searching the internet or textbooks)?
Kåre Olaussen is probably right as to the actual course of events in their original discovery (typically credited to Dirac). But I think that pedagogically, this is a good question, and I would imagine that one can devise an intuitive way to "derive" the ladder operators when they are first introduced. I do not remember ever seeing such derivation in text books, though. However, I must admit that I have not read Dirac's classic textbook on QM, which would be my first place to check how they are introduced by the man himself.
But if we assume that the energy spectrum is known to be positive definite, then it makes sense to search for a diagonalized representation of H in the form |C| + a^\dagger a (C = const),because the square form should quarantee that H is positive definite and Hermitian. Then, by completing the square in the original Hamiltonian in terms of p and x operators, I think that one arrives at the correct forms of a and a^\dagger, at least up to a U(1) factor that is not expected to have any observable consequences.
I would think you Ansatz solves the problem. For simplicity we dequantise the problem, and search for a such that |a|^2 = p^2+q^2. The obvious solution is a=q+ip, up to complex conjugation. Restoring hats and all coefficients, we arrive at the ladder operators.