An analytical solution is derived for one-dimensional transient heat conduction in a composite slab consisting of layers, whose heat transfer coefficient on an external boundary is an arbitrary function of time. The composite slab, which has thermal contact resistance at − 1 interfaces, as well as an arbitrary initial temperature distribution and internal heat generation, convectively exchanges heat at the external boundaries with two different time-varying surroundings. To obtain the analytical solution, the shifting function method is first used, which yields new partial differential equations under conventional types of external boundary conditions. The solution for the derived differential equations is then obtained by means of an orthogonal expansion technique. Numerical calculations are performed for two composite slabs, whose heat transfer coefficient on the heated surface is either an exponential or a trigonometric function of time. The numerical results demonstrate the effects of temporal variations in the heat transfer coefficient on the transient temperature field of composite slabs.