In this paper, we propose a different method to study wave propagation in longitudinally invariant waveguides with arbitrary index profile. In our method, both the electric field and the refractive index profile are expanded into two Fourier cosine series. With these series substituted into the wave equation, a differential matrix equation can then be obtained. We show here that such a matrix equation can be solved and an explicit expression for the wave field at any longitudinal position along an optical waveguide can be obtained. The solution proposed in this method can thus exclude the use of the beam propagation algorithm. This study demonstrates that our approach yields the same results as those obtained by using commercial softwares in which a beam propagation method with the Pade approximation is used.