Demand has increased for analytical solutions to determine the velocities and dispersion coefficients that describe solute transport with spatial, temporal, or spatiotemporal variations encountered in the field. However, few analytical solutions have considered spatially, temporally, or spatiotemporally dependent dispersion coefficients and velocities. The proposed solutions consider eight cases of dispersion coefficients and velocities: both spatially dependent, both spatiotemporally dependent, both temporally dependent, spatiotemporally dependent dispersion coefficient with spatially dependent velocity, temporally dependent dispersion coefficient with constant velocity, both constant, spatially dependent dispersion coefficient with spatiotemporally dependent velocity, and constant dispersion coefficient with temporally dependent velocity. The spatial dependence is linear, while the temporal dependence may be exponential, asymptotical, or sinusoidal. An advection–dispersion equation with these variable coefficients was reduced to a non-homogeneous diffusion equation using the pertinent coordinate transform method. Then, solutions were obtained in an infinite medium using Green’s function. The proposed analytical solutions were validated against existing analytical solutions or against numerical solutions when analytical solutions were unavailable. In this study, we showed that the proposed analytical solutions could be applied for various spatiotemporal patterns of both velocity and the dispersion coefficient, shedding light on feasibility of the proposed solution under highly transient flow in heterogeneous porous medium.