Energy
$ E = \int_{t1}^{t2}{|x(t))|^2dt} $
Usint this result let us consider an example,
$ = \int_{0}^{2 \pi}{|cos(t)|^2dt} $
$ = \int_{0}^{2 \pi}\frac{1 + cos(2t)}{2}dt $
$ =\frac{2 \pi}{2} + \frac{1}{4} sin(4 \pi) $
$ =\frac{2 \pi}{2} $
Power
$ P = \frac{1}{2 \pi - 0} \int_{0}^{2 \pi}{|cos(t)|^2dt} $
$ = \frac{1}{2 \pi} \int_{0}^{2 \pi}\frac{[1 + cos(2t)]}{2}dt $
$ =\frac{1}{2} $