Why don't we use Leibniz integral rule when solving Diffusion equation using the Fourier transform?

My question concerns the solution to the diffusion equation: $$\frac{\partial{p(x,t)}}{\partial{t}}=D\frac{\partial^2{p(x,t)}}{\partial{x}^2}~.\tag{1}\label{1}$$ I have a question about the solution presented in Ian Ford's Statistical Physics: An Entropic Approach. This solution consists of defining $$G(k,t)=\int\limits_{-\infty}^{\infty}p(x,t)\mathrm{e}^{\mathrm{i}kx}\mathrm{d}x~,$$ such that $$p(x,t)=\frac{1}{2\pi}\int\limits_{-\infty}^{\infty}G(k,t)\mathrm{e}^{-\mathrm{i}kx}\mathrm{d}k~,$$ then taking Fourier transform of Eq.$$\eqref{1}$$ yields $$\int\limits_{-\infty}^{\infty}\frac{\partial{p(x,t)}}{\partial{t}}\mathrm{e}^{\mathrm{i}kx}\mathrm{d}x= \int\limits_{-\infty}^{\infty}D\frac{\partial^2{p(x,t)}}{\partial{x}^2}\mathrm{e}^{\mathrm{i}kx}\mathrm{d}x~.$$ The right-hand side is integrated by parts and on the left-hand side we exchange integration with differentiation, and we get $$\frac{\partial{G(k,t)}}{\partial{t}}=-k^2DG(k,t)~.\tag{2}\label{2}$$ The thing which I don't understand is why are we allowed to exchange the integral and the partial derivative with respect to time on the left hand side of Eq.$$\eqref{2}$$. Why don't we have to use the Leibniz integral rule

$${\frac {\mathrm{d}}{\mathrm{d}t}}\left(\int _{a}^{b}f(x,t)\,\mathrm{d}x\right)=\int _{a}^{b}{\frac {\partial }{\partial t}}f(x,t)\,\mathrm{d}x~,}$$ but then we would have $$\frac{\mathrm{d}{G(k,t)}}{\mathrm{d}{t}}=\frac{\partial{G(k,t)}}{\partial{t}}+\frac{\partial{G(k,t)}}{\partial{k}}\frac{\mathrm{d}{k}}{\mathrm{d}{t}}=-k^2DG(k,t)~,$$ which is generally different from Eq.$$\eqref{2}$$. Could you please help me understand why one doesn't use Leibnitz rule in this case? Thank you in advance for your answers.

$$k$$ is a completely independent variable from $$t$$ (just as $$x$$ is). The independence of $$x$$ and $$t$$ is the reason we are careful to use partial derivatives in the original equation. When we Fourier transform, we are replacing one independent variable ($$x$$) by another ($$k$$).