Noise from the auxiliary power unit (APU) is becoming an increasingly important aircraft design constraint because of the noise exposure during ground operations ("ramp-noise"). Reduction of noise may be achieved by liners in the exhaust duct. In this paper, we will consider the propagation of sound through the APU exhaust duct, which is typically straight with an axially varying liner depth, a non-uniform mean flow and strong temperature gradients. We present a solution in the form of slowly varying modes of WKB type for the acoustic pressure field inside a duct with an impedance that is continuously varying in the axial direction. In cross-wise direction each WKB mode is given by eigenfunction-type solutions of the Pridmore-Brown equation. A new numerical approach based on a standard implementation of a collocation method supplemented by a path-following procedure is presented to solve this equation. We compare the results of the slowly-varying solution with a solution based on mode-matching between axial segments with constant impedance.