Mid-band magnitude gain of a Cascode Amplifier
Using this small-signal diagram 



We clearly see a voltage divider at the input. 

Therefore 
$$\frac{V_{B1}}{V_S} = \frac{R_1||R_2||(\beta_1 +1)r_{e1}}{R_S + R_1||R_2||(\beta_1 +1)r_{e1}}$$ 

Next, let us find the first stage voltage gain (Q1). This stage is working as a CE ( common-emitter) amplifier. 

$$V_{B1} = I_B\cdot(\beta_1 +1)r_{e1}$$ 

$$V_{C1} = - I_{C1} \cdot r_{e2} = I_B \cdot \beta_1 \cdot r_{e2}$$

$$\frac{V_{C1}}{V_{B1}} = -\frac{I_B \cdot \beta_1 \cdot r_{e2}}{I_B\cdot(\beta_1 +1)r_{e1}} = -\frac{r_{e2}}{r_{e1}} \cdot \frac{\beta_1}{\beta_1 +1} = -\alpha \frac{r_{e2}}{r_{e1}} $$

Now we can find the second stage gain (Q2) that works as a CB (common-base) amplifier.   

$$V_O = - I_{C2} \cdot R_C||R_L =-\alpha_2 I_{E2} R_C||R_L = -I_{C1} R_C||R_L \frac{\beta_2}{\beta_2 +1} $$ 

$$V_{C1} = - I_{C1}\times r_{e2}$$

$$\frac{V_O}{V_{C1}} = \frac{-I_{C1} R_C||R_L \frac{\beta_2}{\beta_2 +1}}{- I_{C1}\times r_{e2}} = \frac{R_C||R_L}{r_{e2}} \times \frac{\beta_2}{\beta_2 +1}$$

And finally, the overall voltage gain \$\frac{V_O}{V_S}\$ is 

$$\frac{V_O}{V_S} = - \frac{R_1||R_2||(\beta_1 +1)r_{e1}}{R_S + R_1||R_2||(\beta_1 +1)r_{e1}} \times\frac{r_{e2}}{r_{e1}}\times\frac{\beta_1}{\beta_1 +1}\times\frac{R_C||R_L}{r_{e2}} \times \frac{\beta_2}{\beta_2 +1}  $$

Any additional questions?