Piecewise linear approximation for analyzing TM modes in graded-index planar optical waveguides