According to Razavi, \$R_{out}\$ is approximately \$r_{o2}||r_{o4}\$:
I get the same answer (assuming \$2r_{02} >> \frac{1}{g_{m3}}||r_{o3}\$):
But how did he get equation 5.27? In particular, how is \$I_{xy} = I_{d4}\$. I.e. how did he get the \$2I_{xy}\$ term (where \$I_{xy}\$ is the current through \$R_{xy}\$)? I understand that M4 will copy M3's current, but won't the copying be unequal when considering channel length modulation and if \$V_{ds3} \neq V_{ds4}\$?