Integration by parts using Dirac delta functions From my notes I have some background information on Canonical Commutation Relations:



I can prove the first question.

Though I cannot prove the next question:



I will typeset this question also just in case the image is a bit hard to read:



*Perform the following change of variables in the integral $p^{\prime} = p + \hbar s$ and then expand the integrand in powers of $\hbar$. Prove that to ﬁrst order in $\hbar$ we have
$$\left(A_c \ast B_c\right)(x, p)=A_c\left(x,p\right)B_c\left(x,p\right)-i\hbar\frac{\partial A_c}{\partial p}\frac{\partial B_c}{\partial x}+\mathcal{O}\left(\hbar^2\right)\tag{9}$$
(Hint, you will need to remember that the Dirac delta function can be represented by
$$\delta(x-x^{\prime})=\int_{-\infty}^{\infty}\frac{dk}{\left(2\pi\right)}\,e^{ik\left(x-x^{\prime}\right)}\tag{10}
$$
You will also need to perform an integration by parts over the variable $x^{\prime}$.)



Here is my attempt at trying to prove eqn. $(9)$:
The previous result, (eqn. $(8)$) can be re-written as -
$$\left(A_c \ast B_c\right)(x, p)=\int_{-\infty}^{\infty}dx^\prime\int_{-\infty}^{\infty}\frac{dp^{\prime}}{2\pi \hbar}A_c\left(x, p^{\prime}\right)B_c\left(x^\prime,p\right)e^{i\left(p^\prime-p\right)\left(x-x^\prime\right)/\hbar}$$
Now $p^{\prime}=p+hs$, where $s$ is the new integration variable, therefore, $dp^{\prime}=\hbar ds$, here $p$ is a constant as it is not being integrated over. Therefore,
$$\left(A_c \ast B_c\right)(x, p)=\int_{-\infty}^{\infty}dx^{\prime}\int_{-\infty}^{\infty}\frac{ds}{2\pi}A_c\left(x, p+\hbar s\right)B_c\left(x^{\prime},p\right)e^{is\left(x-x^{\prime}\right)}$$
Taylor expanding the integrand in powers of $\hbar$,
$$\left(A_c \ast B_c\right)(x, p)=\int_{-\infty}^{\infty}dx^{\prime}\int_{-\infty}^{\infty}\frac{ds}{2\pi}\Big[A_c\left(x, p\right)+\hbar s\frac{\partial}{\partial p}\Big(A_c \left(x,p\right)\Big)+\mathcal{O}\left(\hbar^2\right)\Big]B_c\left(x^{\prime},p\right)e^{is\left(x-x^{\prime}\right)}$$
$$=\frac{1}{2\pi}A_c\left(x,p\right)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)\int_{-\infty}^{\infty}ds\,e^{is\left(x-x^{\prime}\right)}\tag{a}$$
$$+\frac{1}{2\pi}\hbar\frac{\partial}{\partial p}\Big(A_c \left(x,p\right)\Big)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)\color{blue}{\int_{-\infty}^{\infty}ds\,se^{is\left(x-x^{\prime}\right)}}\tag{b}$$
$$+\frac{1}{2\pi}\mathcal{O}\left(\hbar^2\right)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)\int_{-\infty}^{\infty}ds\,e^{is\left(x-x^{\prime}\right)}\tag{c}$$
Where I have taken out factors that don't depend on the integration variables $x^{\prime}$ and $s$ and multiplied out the integral into $3$ terms, it is the integrals over $s$ I would like to focus on now:
I note that $$i\frac{\partial}{\partial x^{\prime}}\left(e^{is\left(x-x^{\prime}\right)}\right)=se^{is\left(x-x^{\prime}\right)}\tag{d}$$
and the hint given in the question is,
$$\delta(x-x^{\prime})=\frac{1}{2\pi}\int_{-\infty}^{\infty}ds\,e^{is\left(x-x^{\prime}\right)}\tag{e}$$
Starting with the first term, I can make use of eqn. $(e)$,
so $(\mathrm {a})$ becomes,
$$\frac{1}{2\pi}A_c\left(x,p\right)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)2\pi\,\delta\left(x-x^{\prime}\right)=A_c\left(x,p\right)B_c\left(x,p\right)$$ by the sifting property of the Dirac delta 'function', which sets $x^\prime=x$, and is the required first term in eqn. $(9)$.
Using the same logic for the third term, $(\mathrm{c})$, things do not work out as required:
$$\begin{align}\frac{1}{2\pi}\mathcal{O}\left(\hbar^2\right)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)\int_{-\infty}^{\infty}ds\,e^{is\left(x-x^{\prime}\right)}&=\frac{1}{2\pi}\mathcal{O}\left(\hbar^2\right)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)2\pi\delta\left(x-x^{\prime}\right)\\&=\mathcal{O}\left(\hbar^2\right)B_c\left(x,p\right)\end{align}$$
It gets worse for the second term, $(\mathrm{b})$, and I can't figure out what to do. I'm sure this should be done via integration by parts and using eqn. $(\mathrm{d})$ somehow along with eqn. $(\mathrm{e})$.
Just for clarity, I will focus solely on the integral of the product of functions of $s$, marked blue in $(\mathrm{b})$, this is what I find:
$$\begin{align}\color{blue}{\int_{-\infty}^{\infty}ds\,se^{is\left(x-x^{\prime}\right)}}&=\tag{f}\bigg[-\frac{i}{x-x^{\prime}}se^{i\left(x-x^{\prime}\right)}\bigg]_{s=-\infty}^\infty-\int_{s=-\infty}^{\infty}ds\bigg[-\frac{i}{x-x^{\prime}}e^{is\left(x-x^\prime\right)}\bigg]\\&=\tag{g}\bigg[\frac{1}{x-x^{\prime}}\frac{\partial}{\partial x^{\prime}}\left(e^{is \left(x-x^{\prime}\right)}\right)\bigg]_{s=-\infty}^\infty+\frac{i}{x-x^{\prime}}\int_{s=-\infty}^{\infty}ds\,e^{is\left(x-x^\prime\right)}\\&=\tag{h}\bigg[\frac{1}{x-x^{\prime}}\frac{\partial}{\partial x^{\prime}}\left(e^{is \left(x-x^{\prime}\right)}\right)\bigg]_{s=-\infty}^\infty+\frac{2\pi i}{x-x^{\prime}}\delta\left(x-x^\prime\right)\end{align}$$
In $(\mathrm{f})$ I have used the formula for integration by parts, $$\int_{v=-\infty}^\infty udv=\Big[uv\Big]_{v=-\infty}^{\infty}-\int_{v=-\infty}^\infty vdu$$
Where, in the first term on the RHS of $(\mathrm{g})$ I used eqn. $(\mathrm{d})$,
$$se^{is\left(x-x^{\prime}\right)}=i\frac{\partial}{\partial x^{\prime}}\left(e^{is\left(x-x^{\prime}\right)}\right)$$
Lastly, in the second term of $(\mathrm{h})$ I made use of eqn. $(\mathrm{e})$,
$$\int_{-\infty}^{\infty}ds\,e^{is\left(x-x^{\prime}\right)}=2\pi\,\delta(x-x^{\prime})$$
Of course, this has all gone horribly wrong as even if I reinstate the full form of $(\mathrm{b})$,
$$\frac{1}{2\pi}\hbar\frac{\partial}{\partial p}\Big(A_c \left(x,p\right)\Big)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)\color{blue}{\int_{-\infty}^{\infty}ds\,se^{is\left(x-x^{\prime}\right)}}$$
$$=\frac{1}{2\pi}\hbar\frac{\partial}{\partial p}\Big(A_c \left(x,p\right)\Big)\int_{-\infty}^{\infty}dx^{\prime}B_c\left(x^{\prime},p\right)\color{blue}{\Bigg\{}\bigg[\frac{1}{x-x^{\prime}}\frac{\partial}{\partial x^{\prime}}\left(e^{is \left(x-x^{\prime}\right)}\right)\bigg]_{s=-\infty}^\infty+\frac{2\pi i}{x-x^{\prime}}\delta\left(x-x^\prime\right)\color{blue}{\Bigg\}}$$
both the terms in the blue curly braces are undefined, the first because of the limits and the second because the Dirac delta function sets $x=x^{\prime}$ which causes problems for the denominator.

Please may I have some hints or tips on how to get the correct terms, $(\mathrm{b})$ and $(\mathrm{c})$ and hence reach the correct expression, $(9)$?
In other words, how can I show that
$$\left(A_c \ast B_c\right)(x, p)=A_c\left(x,p\right)B_c\left(x,p\right)-i\hbar\frac{\partial A_c}{\partial p}\frac{\partial B_c}{\partial x}+\mathcal{O}\left(\hbar^2\right)\,\,?$$

For reference, the part of the handwritten solution involving the Taylor expansion is written as

$$\left(A_c \ast B_c\right)(x, p)=\int_{-\infty}^{\infty}dx^{\prime}\int_{-\infty}^{\infty}\frac{ds}{2\pi}\Big[A_c\left(x, p\right)+\hbar s\frac{\partial}{\partial p}\Big(A_c\left(x,p\right)\Big)\Big]B_c\left(x^{\prime},p\right)e^{is\left(x-x^{\prime}\right)}+\mathcal{O}\left(\hbar^2\right).$$

But this just seems nonsensical to me since the question specifically asked for the integrand to be Taylor expanded, so putting $\mathcal{O}\left(\hbar^2\right)$ outside the integral is not a Taylor expansion of the integrand.
What have I overlooked here?
 A: Just use the following manipulation of the integral in line (b):
$$
\begin{align}\text{(b)}=\int_{-\infty}^{\infty}dx'B_c(x',p)\int_{-\infty}^{\infty}se^{is(x-x')}ds&=\int_{-\infty}^{\infty}dx'B_c(x',p)(-i)\frac{\partial}{\partial t}\int_{-\infty}^{\infty}e^{ist}ds\Bigg|_{t=x-x'}\\&=\int_{-\infty}^{\infty}dx'B_c(x',p)(-i)\frac{\partial}{\partial t}\delta(t)\Bigg|_{t=x-x'}\\&=\int_{-\infty}^{\infty}dtB_c(x-t,p)(-i)\frac{\partial}{\partial t}\delta(t)
\end{align}$$
In the last line, a change of variables was performed $t=x-x'$. Now use integration by parts to remove the derivative from the delta function and obtain
$$\text{(b)}=i\int_{-\infty}^{\infty}dt\frac{\partial}{\partial t}B_c(x-t,p)\delta(t)=-i\frac{\partial}{\partial x}B_c(x,p)$$
which after multiplying with the rest of line (b) gives the desired result.
I think you may have misinterpreted what the author means by $\mathcal{O}(\hbar^2)$. They mean that the error to the truncated asymptotic series is bounded above by $\hbar^2$ multiplied by some function of $x,p$ as given here.  However, your treatment in line (c) in trying to manipulate the symbol algebraically, is simply not allowed. Roughly speaking, in order to be able to use the big-O symbol you have to show that the next order term is finite in at least a neighborhood of the expansion variable (here $\hbar$).
To write a proof for this you would need some natural assumptions on the functions $A_c,B_c$. First start by claiming that the Taylor series for $A_c(x,p+\hbar s)$ exists around $s=0$ and hence by application of Taylor's theorem we have that
$$A_c(x,p+\hbar s)=A_c(x,p)+\hbar s\frac{\partial A_c(x,p)}{\partial p}+\frac{\hbar^2s^2}{2!}\frac{\partial^2A(x,p)}{\partial p^2}\Bigg|_{p=z},~~ p\leq z\leq p+\hbar s$$
Here if you assume that the 2nd partial derivative is continuous (which should be sufficient for most function quantum physicists may be interested in), it's also bounded. Now substitute and get the correct second order remainder for line (c)
$$\frac{\hbar^2}{2}\int ds\int dx' B_c(x',p)\frac{\partial^2A_c(x,q)}{\partial q^2}\Bigg|_{q=z(p,s)}s^2e^{is(x-x')}$$
This quantity could be bounded above using the bound which is guaranteed by continuity of the 2nd derivative we just assumed $$\Bigg|\frac{\partial^2A_c(x,q)}{\partial q^2}\Bigg|_{q=z(p,s)}\Bigg|\leq M_2(x)$$
which yields an expression for the second order remainder
$$|R_2(x.p)|\leq\frac{\hbar^2}{2}M_2(x)\frac{\partial^2 B_c(x,p)}{\partial x^2}$$
which shows that, indeed this series is $\mathcal{O}(\hbar^2)$. Personally, I do not believe that the author wants you to delve at such a level of mathematical detail and make technical assumptions such as the above though, they just want you to ignore terms higher than linear.
Note: To show that $\int_{-\infty}^\infty s e^{is(x-x')}\frac{ds}{2\pi}=-i\delta'(x-x')$ within the class of distributions requires integrating against a Schwartz test function and involves at least one integration by parts:
$$
\begin{align}\int_{-\infty}^\infty dx\int_{-\infty}^\infty\frac{ds}{2\pi} s e^{is(x-x')}\phi(x)&=\int_{-\infty}^\infty \frac{ds}{2\pi}\int_{-\infty}^\infty dx\left(-i\frac{\partial}{\partial x}\right)e^{is(x-x')}\phi(x)\\&=\int_{-\infty}^\infty\frac{ds}{2\pi}e^{-isx'}\int dx e^{isx}i\phi'(x)\\&= \int_{-\infty}^\infty\frac{ds}{2\pi}e^{isx'}\mathcal{F}[i\phi'(-x)](s)\\&=\mathcal F^{-1}[\mathcal{F}[i\phi'(-x)](s)](x')\\=i\phi'(x')=-i\int\delta'(x-x')\phi(x)dx&\Rightarrow \int_{-\infty}^\infty s e^{is(x-x')}\frac{ds}{2\pi}=-i\delta'(x-x')\end{align}
$$
where in line 2 I use IBP ignoring boundary terms, in line 3 I identify the Fourier transform of $i\phi'(x)$, in line 4 I identify the inverse fourier transform of that Fourier transform and in line 5 I use the Fourier inversion theorem.
