Inhomogeneity in a medium will cause wave scattering, influencing the transfer of energy or information. However, it is possible to prepare a prescribed wavefront which propagates through an inhomogeneous medium with unity flux-transmittance. This phenomenon is first predicted in the context of mesoscopic electron transport. Another remarkable phenomenon is the bimodal distribution of the transmission singular values, which implies that in a lossless medium the full solution space in the scattering region can be spanned only by open channels, which are completely transmitted, and closed channels, which are completely reflected. In mesoscopic physics, random-matrix theory is usually utilized to deal with the statistical properties of matrices with randomly distributed entries since the medium is assumed to be randomly fluctuating. In this paper, we propose a method of systematically studying the maximal flux transmission through an inhomogeneous acoustic waveguide. The model is chosen to be a waveguide with varying cross-sections and a penetrable scatterer, and the method is based on the coupled mode theory. This method can be used to analyze the frequency of nearly complete transmission for an arbitrary incident wave, and to analyze the incident wave that is able to generate the maximal flux-transmittance for any given frequency. We construct the transmission matrix and the horizontal wavenumber matrix by using orthonormal basis functions, and give the expression of flux-transmittance. Then the optimal incident wave which brings the maximal transmittance through the scattering region is derived based on singular value decomposition. The optimal incident waves are independent of the evanescent modes since evanescent modes do not transfer any energy. But the evanescent modes can give rise to the multivaluedness of wave solutions with complete flux transmission. Considering the fact that acoustic waveguides can naturally resist the influence of highly oscillating perturbations since most of them correspond to evanescent modes), the maximal flux transmission in waveguide is thus found to be highly robust. Especially at a specific frequency, the complete wave transmission has perfect robustness. This proposed method can be generalized to any other frequency, to other types of scatterers, or to other kinds of boundary conditions, and can provide guidance in designing acoustic metamaterials and in highly efficient communication.