Trying to solve a QM harmonic oscillator problem I found out I need to calculate $\hat{p}|x\rangle$, where $\hat{p}$ is the momentum operator and $|x\rangle$ is an eigenstate of the position operator, with $\hat{x}|x\rangle = x|x\rangle$. It turns out that $\hat{p}|x\rangle$ should be equal to $-i\hbar\frac{ \partial |x\rangle }{\partial x}$. But what does this even mean? I'm not sure what to do with an expression like that. If I try to find $\langle x | \hat{p} | x_0 \rangle$, I end up with $-i\hbar \frac{\partial}{\partial x} \delta(x-x_0)$, which I'm pretty sure is not allowed even in physics, where we would scoff at phrases like "$\delta$ is really a distribution and not a function".
Edit: Motivation. I have solved Heisenberg's equation and found, for a Hamiltonian $H = p^2/2m + m\omega^2x^2/2$, that $\hat{x}(t) = \hat{x}_0 \cos(\omega t) + \frac{\hat{p}_0}{m\omega} \sin(\omega t)$. I am given that the initial state is $|\psi(0)\rangle = |x_0\rangle$, i.e., an eigenstate of position, and I have a hunch that by finding $\hat{x}(t)|x_0\rangle$ I might find a way to get $|\psi(t)\rangle$. But this is not what I need help with; I am now curious as to what $\hat{p}|x\rangle$ might be, never mind my original problem.