Wave reflection and transmission from anisotropic layers through Riccati equations