I used ladder operaters to solve for the wavefunctions of a harmonic oscillator. I want to know, are ladder operaters universal? What i meant by universal is that, can they used to solve for the wavefunctions of any kind of potentials, or their use is limited to some cases only? If no, why not? If yes, how they are used in cases such as potential well, where the energy difference is not constant among consecutive states?

There are two wide classes of problems in which one can introduce ladder operators.

The first kinds are those problems for which the Hamiltonian is factorizable and - surprise surprise - the method there is called "The factorization method". A good review can be found in Infeld, Leopold, and T. E. Hull. "The factorization method." Reviews of modern Physics 23.1 (1951): 21 (behind a pay wall) or alternatively in this paper. It is not limited harmonic-type potential and has been used in supersymmetric quantum mechanics. Section 2 of this paper provides some features of the general method.

The second kind is when the problem has a natural (Lie) algebraic structure. Problems in this category would include harmonic oscillator (with Heisenberg-Weyl Lie algebra), spin and other angular momentum problems (with $su(2)$ Lie algebra), general n-dimensional oscillator problems (with $su(n)$ Lie algebra), and various other types with $so(m)$ and $sp(m)$ Lie algebraic structures.

In fact, a huge fraction of known analytical solutions to the Schroedinger equation have a (Lie) algebraic structure. The hydrogen atom spectrum for instance is related to the $so(4)$ Casimir invariant.

You can always write down the operators

$$\hat{a} = \sqrt{\frac{m\omega}{2\hbar}} (\hat{x} + \frac{i}{m\omega}\hat{p})\\ \hat{a}^\dagger = \sqrt{\frac{m\omega}{2\hbar}} (\hat{x} - \frac{i}{m\omega}\hat{p})\\$$

They act on the Hilbert space $L^2 (\mathbb{R},dx)$. You could write down your new Hamiltonian in terms of these. This is because you know how the Hamiltonian is written in terms of $\hat{x}$ and $\hat{p}$ and how those are written in terms of $\hat{a}$ and $\hat{a}^\dagger$, but you will get a total mess.

$$\hat{H} = \frac{\hat{p}^2}{2m} + \frac{1}{2} m \omega^2 \hat{x}^2 - \frac{1}{2} m \omega^2 \hat{x}^2 + V(\hat{x})\\ \tilde{V} (\hat{x}) = - \frac{1}{2} m \omega^2 \hat{x}^2 + V(\hat{x})\\ \hat{H} = \hbar \omega (\hat{a}^\dagger \hat{a} + \frac{1}{2}) + \tilde{V} (\sqrt{\frac{\hbar}{2m\omega}} (\hat{a} + \hat{a}^\dagger))$$

You know how $\hat{a}$ and $\hat{a}^\dagger$ commute with the first part, so you can understand the spectrum of the harmonic oscillator, but that second term gives you messy commutation relations. So using these operators $\hat{a}$ and $\hat{a}^\dagger$ for other potentials becomes maximally unhelpful.

For simplicity assume $\tilde{V}$ is some polynomial so just plugging in the full expression $\sqrt{\frac{\hbar}{2m\omega}} (\hat{a} + \hat{a}^\dagger)$ for $x$ everywhere and expanding everything out.

• However, it might be easier to use ladder operators (for polynomial potential) to solve Schrodinger equation numerically : you get a much nicer matrix to diagonalize (if you truncate to high enough occupation number) than if you try to discretize Schrodinger wave-equation.