Let's consider this circuit, which is the equivalent of a small-signal MOSFET amplifier.
RG is a gate series resistance which takes into account the oxide leakage, and CGS and CGD are the well-known MOSFET parasitic capacitances.
Now, the book The Design of CMOS Radiofrequency Integrated Circuits (Lee) makes the computation of the power gain, i.e. the ratio between the power delivered to the load (by supposing matching) and the input power of the source.
Regarding the last one, it is written that:
$$P_{in}=\frac{i^2_{in}\cdot r_g}{2}$$
My question is: is the factor 1/2 due to the fact that in AC we consider RMS values, or is it due to something related to the maximum power transfer theorem? I thought it was due to the RMS, but if that is correct, the formula should use the phasor of the input current (and moreover, the book does not make any assumption about the single-frequency behaviour of the input current source). Moreover, how can I compute the power delivered to the load? I do not know if I have to use the factor 1/2 due to RMS or not.