refraction

My problem is about rays traveling through a GRIN medium, where the refractive index is maximum at the center and decreases quadratically outward. Intuitively, I would expect rays starting above or below the axis to refract upward (away from the axis), since that seems like the way to minimize their own optical path length (shorter distance, lower index region). But in fact, the rays bend inward …