Complex power using phasors derivation
The error is in that you're using the amplitude instead of the RMS value:

$$P = V_{RMS} \cdot I_{RMS} \cdot cos(\theta) $$

but for sinusoidal signals, \$V_{RMS}=\dfrac{V_{M}}{\sqrt{2}}\$ and \$I_{RMS}=\dfrac{I_{M}}{\sqrt{2}}\$ so multiplying:

$$P = \frac{1}{\sqrt{2}} \frac{1}{\sqrt{2}} V_{M} \cdot I_{M} \cdot cos(\theta)

 = \frac{1}{2} V_{M} \cdot I_{M} \cdot cos(\theta) =\\

 = \sqrt{\frac{1}{T} \int_T [p(t)]^2 \:\mathrm{d}t}


$$