How to promote algebraic expressions to operators in quantum mechanics? Okay, I know that in quantum mechanics the quantum observable is obtained from the classical observable by the prescription 
$$ X \rightarrow x,\quad P \rightarrow -i\hbar\frac{\partial}{\partial x} $$ 
in the position basis. Now my questions are: 


*

*What if $x$ or $p$ appears in the denominator in a classical expression? 

*How to promote this to a quantum expression? What would be the meaning of division by an operator?
My expression likely contains a mixture of $x$ and $p$. For e.g., it could contain terms like $$\frac{p}{x^2}$$ or $$\frac{xp}{(x^2 + a^2)^{3/2}}.$$ 


*

*How to resolve products of non-commuting operators like $x$, $p$ in a satisfactory way?

 A: A different approach from what Michael Brown wrote is to use a Taylor expansion in order to turn your function of the operator into a polynomial. You can then - in principle - evaluate the action of each term on your states and then contract the expression again. This effectively leads to the same expressions as Michael Borwn's approach but you might be more comfortable with it.
A: The general problem of converting classical expressions to quantum operator ones is in general unsolvable because classical mechanics is an approximation to quantum mechanics and not the other way around. There is always an ambiguity in how to order noncommuting operators. You have to handle it on a case by case basis, and there are a number of "quantization" schemes out there. In general these can lead to different quantum theories which have to be distinguished experimentally.
Anyway, in your case it is probably fine just to use the eigenvalue decomposition:
$$ \frac{1}{x} \to \frac{1}{\hat{x}} \equiv \int \mathrm{d}x\ |x\rangle \frac{1}{x} \langle x |, $$
$$ \frac{1}{p} \to \frac{1}{\hat{p}} \equiv \int \mathrm{d}p\ |p\rangle \frac{1}{p} \langle p |, $$
etc., where $|x\rangle,|p\rangle$ are the orthonormal eigenvectors of position and momentum resp. You can use $\langle x|x'\rangle=\delta(x-x')$ to show that $\frac{1}{\hat{x}}$ has the desired action on position eigenstates. You can also clearly generalise this sort of thing, e.g. $\sqrt{p}\to\sqrt{\hat{p}}\equiv\int \mathrm{d}p\ |p\rangle \sqrt{p} \langle p |$. To give a real example, the following operator, called the resolvent, is very important in quantum scattering theory:
$$ \hat{R}(z) = \frac{1}{\hat{H}-z} = \sum_n \frac{|n\rangle\langle n|}{E_n - z}, $$
where $z$ is a complex number.
You'll have ambiguities if the classical expression is something like $p/x$ or $\sqrt{px}$ or whatever, since $\hat{p}$ and $\hat{x}$ don't commute.
