We present an analytical solution of the advection–diffusion equation of integer and fractional order applied to the dispersion of pollutants in the planetary boundary layer. The solution is obtained using the Laplace decomposition method, and the perturbation is obtained by homotopy, considering the Caputo derivative in the fractional case. To obtain the solution, two types of eddy diffusivities are used: in the integer-order equation, the eddy diffusivity is dependent on the longitudinal distance from the source (K $$ \propto $$ x and K $$ \propto $$ x2); in the fractional-order equation, the eddy diffusivity is constant. To validate the model, the results are compared with experimental data from the literature (Copenhagen and Prairie Grass). In the Copenhagen experiment, which was conducted under moderately unstable conditions, the best results are obtained under the influence of the memory effect with the eddy diffusivity dependent upon the source distance as K $$ \propto $$ x (with constant eddy diffusivity in the equation with a fractional derivative). However, in the strongly convective case of the Prairie Grass experiment, the best results are obtained only when the eddy diffusivity depends on the source distance as K $$ \propto $$ x2.