Analysis of inhomogeneous and anisotropic waveguides by the finite element method