I am reading Martin Plenio's lecture notes on Quantum Mechanics from the Imperial College. In page 63 he wants to prove the relation $$[\hat{x},\hat{p}]=i\hbar $$ via $$\langle x | [\hat{x},\hat{p}]|\psi\rangle=\langle x | \hat{x}\hat{p}-\hat{p}\hat{x}|\psi\rangle \overset{?}{=} \langle x | i\hbar|\psi\rangle.\tag{1}$$
I have proven that $$\langle x | \hat{p}|\psi\rangle = \frac{\hbar}{i}\frac{\partial}{\partial x}\langle x |\psi\rangle.$$
From (1) I get $$\langle x | \hat{x}\hat{p}-\hat{p}\hat{x}|\psi\rangle = x \langle x | \hat{p}|\psi\rangle - \langle x | \frac{\hbar}{i}\frac{\partial}{\partial x}\left(\int dx\ x|x\rangle\langle x|\psi\rangle\right),$$
where $$\hat{p} = \frac{\hbar}{i}\frac{\partial}{\partial x}$$ and $$\hat{x} = \int dx\ x |x\rangle\langle x|.$$
If I could get the bra $\langle x |$ into the integral then I would get $$x \langle x | \hat{p}|\psi\rangle - \frac{\hbar}{i}\frac{\partial}{\partial x}\left( x\langle x|\psi\rangle\right),$$
which would lead to the desired result. However I don't see how getting the bra into the integral would be possible. Any help is appreciated (I have seen the proof in other questions here, but they take $|\psi\rangle$ as an eigenvector of $\hat{x}$). How could I make progress with this way of proving the relation? Any help is very much appreciated!