If $x(t)$ is periodic with period $T$ and it satisfies dirichlet conditions we can represent it as:
$x(t)=\sum_{n=-\infty}^{\infty}c_n e^{J\frac{2\pi nt}{T}}$
Power of $x$ is defined as: $P=\frac{1}{T}\int_{-T/2}^{T/2}{|x(t)|^2}dt$
So how does the equation $P$ = $\sum_{n=-\infty}^{\infty}|c_n|^2$ hold true?
recall $x(t)=\sum_{n=-\infty}^{\infty}c_n e^{J\frac{2\pi nt}{T}}$
before pluging $x(t)$ on to the definition of power: $P=\frac{1}{T}\int_{-T/2}^{T/2}{|x(t)|^2 dt}$
represent ${|x(t)|}^2$ as $x(t){x(t)}^* $
$x(t)=\sum_{n=-\infty}^{\infty}c_n e^{J\frac{2\pi nt}{T}}$ ==>
${x(t)}^*=\sum_{n=-\infty}^{\infty}c_n^* e^{-J\frac{2\pi nt}{T}}$
change variable $n$ with $r$ on summation of ${x(t)}^*$:
${x(t)}^*=\sum_{r=-\infty}^{\infty}c_r^* e^{-J\frac{2\pi rt}{T}}$
$ {|x(t)|}^2 = x(t){x(t)}^∗ =$
$ [\sum_{n=-\infty}^{\infty}c_n e^{J\frac{2\pi nt}{T}}]\times [\sum_{r=-\infty}^{\infty}c_r^* e^{-J\frac{2\pi rt}{T}}]$
according to distributive law of multiplication we can write:
$ {|x(t)|}^2 = \sum_{n=-\infty}^{\infty}\sum_{r=-\infty}^{\infty}[c_n e^{J\frac{2\pi nt}{T}}c_r^* e^{-J\frac{2\pi rt}{T}}]$
=>
$ {|x(t)|}^2 = \sum_{n=-\infty}^{\infty}\sum_{r=-\infty}^{\infty}[c_n c_r^* e^{J\frac{2\pi (n-r)t}{T}} ]$
instead of plugging $x(t)$ on the definition of power, plug $ |x(t)|^2$:
$P=\frac{1}{T}\int_{-T/2}^{T/2}{|x(t)|^2 dt} =$
$ \frac{1}{T}\int_{-T/2}^{T/2}{[\sum_{n=-\infty}^{\infty}\sum_{r=-\infty}^{\infty}[c_n c_r^* e^{J\frac{2\pi (n-r)t}{T}} ]] dt}$
Take the integral inside as $c_n$ and $c_r$ are independent of $t$:
$P=\frac{1}{T}{\sum_{n=-\infty}^{\infty}\sum_{r=-\infty}^{\infty}[\int_{-T/2}^{T/2}c_n c_r^* e^{J\frac{2\pi (n-r)t}{T}} dt}]$
call the Integral as $I$:
$I=\int_{-T/2}^{T/2}c_n c_r^* e^{J\frac{2\pi (n-r)t}{T}} dt$
$I$ is a piecewise function of integers n and r:
$I(n,r) = \left\{ \begin{array}{lr} T |c_n|^2, & \text{if } n = r\\ \frac{Tc_n {c_r^*}\sin(\pi(n-r))}{\pi(n-r)}, & \text{if } n\neq r \end{array} \right\}$
As $n$ and $r$ are both integers $(n-r)$ is also an integer.
So, sine of integer multiple of $pi$ radians gives always zero no matter whether it's zero, positive or negative. ==>
$I(n,r) = \left\{ \begin{array}{lr} T |c_n|^2, & \text{if } n = r\\ \frac{Tc_n {c_r^*}\times 0}{\pi(n-r)}, & \text{if } n\neq r \end{array} \right\}$
Finally:
$I(n,r) = \left\{ \begin{array}{lr} {T |c_n|^2}, & \text{if } n = r\\ {0}, & \text{if } n\neq r \end{array} \right\}$
recall $P=\frac{1}{T}{\sum_{n=-\infty}^{\infty}\sum_{r=-\infty}^{\infty}[\int_{-T/2}^{T/2}c_n c_r^* e^{J\frac{2\pi (n-r)t}{T}} dt}]$
replace the integral with $I(n,r)$ :
$P=\frac{1}{T} {\sum_{n=-\infty}^{\infty}\sum_{r=-\infty}^{\infty} I(n,r) }$
As $I$ is zero, for $r\neq n$:
$P=\frac{1}{T} {\sum_{n=-\infty}^{\infty}\sum_{r=n}^{n} I(n,r) }$
can be simplified into:
$P=\frac{1}{T} {\sum_{n=-\infty}^{\infty}I(n,n) }$
$P=\frac{1}{T} {\sum_{n=-\infty}^{\infty}T |c_n|^2}$
$P={\sum_{n=-\infty}^{\infty}|c_n|^2}$
done!