How to distribute an operator on a product of functions? How would an operator act when it is applied on a product of functions? Let's say we have:
$\hat{A}f(x)g(x)$
Is this equivalent to $\hat{A}[f(x)g(x)]$ or $[\hat{A}f(x)]g(x)$?
An example would be if $\hat{A}$ is the momentum operator: $\hat{p}=-i\hbar\frac{\partial}{\partial{x}}$
If the former is correct, then $\hat{p}f(x)g(x) = -i\hbar(f'(x) \cdot g(x) +g'(x) \cdot f(x))$.
If the latter is correct, then $\hat{p}f(x)g(x) = -i\hbar f'(x)g(x)$.
 A: It depends on the author and the context as both can be used. The standard however, is the former: $\hat Afg=\hat A[fg]$.
Let me also note, because this is a point which often causes confusion early on in a student's exposure to quantum mechanics, that $\hat A$ acts on everything to the right by convention, even things that aren't yet written there. This is the same reason why, when computing the commutator $[\hat x,\hat p]=i\hbar$ we write
$$
[\hat x,\hat p]=\hat x\hat p-\hat p\hat x=-i\hbar\left(x\frac{d}{dx}-\frac{dx}{dx}-x\frac{d}{dx}\right).
$$
For the application of the product rule here to make sense, we need to understand the operators to act on everything to the right, including what could be there, regardless of whether we write a symbol in or not.
This fact can further be traced back to the definition of these things as operators on a Hilbert space. Clearly operators can act on each other just the same as matrices can act on each other by multiplication, but the result of multiplying two operators should still itself be an operator. That is, an object which is able to act on a vector (wavefunction). So, this handwavy statement that operators should act on everything to the right, even if we don't write something in is the statement that these objects should always be prepared for a wavefunction to sit there on the right to be acted upon.
