I would like to understand why \$\int_{-\infty}^{+\infty}g^2(t)cos^2(2\pi f_c t)dt = \mathcal{E}_g/2\$
\$g(t)\$ is a pulse of duration T.
the background is:
reading the book "Digital Communications" 5th Edition from Proakis chapter 3, page 99 he defines PAM signals as:
$$ s_m(t) = Re[A_m g(t)e^{j2\pi f_c t}] $$
where \$g(t)\$ is a real funciton, \$A_m\$ is real and usually \$A_m = \{\pm1, \pm3, \pm5, ... \pm (M-1)\}\$ where \$M\$ is the number of amplitudes so that \$M=2^k\$ and \$k\$ is the number of bits per symbol.
for example, if \$k=2\$, then \$M=4\$ and \$A_m = \{\pm1, \pm3\}\$
The energy of a signal \$f(t)\$ is given by the inner product:
$$\mathcal{E}_f = <f(t), f(t)> = \int_{-\infty}^{+\infty}f(t)f^*(t)dt$$ where \$f^*(t)\$ is the complex conjugate of \$f(t)\$.
For PAM, the energy of the singal \$s_m(t)\$ is: $$\mathcal{E}_s = \int_{-\infty}^{+\infty}s_m^2(t)dt$$
for the baseband signal \$s_m(t)=A_mg(t)\$ we have $$\mathcal{E}_s = A_m^2\int_{-\infty}^{+\infty}g^2(t)dt=A_m^2\mathcal{E}_g$$
then a basis for baseband PAM signals would be
$$\phi (t)=\frac{g(t)}{||g(t)||}= \frac{g(t)}{\sqrt{\mathcal{E}_g}}$$
for the bandpass PAM signals, the basis would be
$$\phi (t)=\frac{g(t)cos(2\pi f_c t)}{||g(t)cos(2\pi f_c t)||}= \frac{g(t)cos(2\pi f_c t)}{\sqrt{\int_{-\infty}^{+\infty}g^2(t)cos^2(2\pi f_c t)dt}}$$
The next step is exacly what I don't understand: the integral in the denominator is \$\int_{-\infty}^{+\infty}g^2(t)cos^2(2\pi f_c t)dt = \mathcal{E}_g/2\$. Why is that?