8. (10%) Suppose the sinusoidal voltage and current across an circuit component are $v(t) = V{\mathrm{in}} \cos(\omega t + \theta{\mathrm{v}})$ and $i(t) = I{\mathrm{in}} \cos(\omega t + \theta{\mathrm{i}})$, respectively. Show the average power (over a complete period) delivered to the component is
$$P = \frac{V{\mathrm{in}} I{\mathrm{in}}}{2} \cos(\theta{\mathrm{v}} - \theta{\mathrm{i}})$$