How to calculate Vout from the MOSFET circuit
The output voltage Vout consists of two portions:

1.) Vout1 caused by the drain current Id of the transistor (voltage drop across r_o4),

2.) Vout2 caused (direct way) by the voltage divider between r_o4 and r_o2 .

Calculation: 

1.) Transistor is in common base configuration with Vout1=gm*(r_o2||r_o4)

2.) Vout2=Vp*[r_o4/(r_o4+r_o2)

3.) The sum of both parts Vout=Vout1+Vout2 gives the total signal output voltage. Divided by the input Vp we get the given gain expression (after some mathematical manipulations).