At this point on Professor Strang's lecture on Fourier series online, and after deriving the coefficients of the expression of a function $f(x)$ as an infinity sum of cosine harmonic functions:
$$a_k = \color{red}{\frac{1}{\pi}}\int_{-\pi}^\pi f(x) \cos kx dx$$
resulting from
$$\int_{-\pi}^\pi \cos^2 kx dx = \pi$$
he mentions that if, instead of cosines, we were working with complex coefficients, the formula would be identical, but with
$$\frac{1}{2\pi}$$
in front:
$$c_k = \color{red}{\frac{1}{2\pi}}\int_{-\pi}^\pi f(x) e^{-ikx} dx$$
How is this term calculated? I presume there is some immediate way of seeing it based on complex symmetry, but I couldn't find the formal derivation.
I see how in the case of the "DC" term $a_o,$ the normalization factor is also $\frac{1}{2\pi}:$
$$\begin{align} \int_{-\pi}^{\pi}f(x)\cos x \mathrm dx &=\int_{-\pi}^{\pi}a_0 \left( \cos x\right)^2\mathrm dx\\ &=a_o\int_{-\pi}^{\pi}\cos^2 x \mathrm dx &=a_0 2\pi \end{align}$$
Euler formula: \begin{align*} \sin(x) = \frac {\mathrm e^{\mathrm ix} - \mathrm e^{-\mathrm ix}} {2\mathrm i}, \\ \cos(x) = \frac {\mathrm e^{\mathrm ix} + \mathrm e^{-\mathrm ix}} {2}. \end{align*}
Explicitly, collect $\cos(nx)$ terms we have $$ a_n = c_n + c_{-n}, \tag{1} $$ collect $\sin(nx)$ terms we have $$ b_n =\mathrm i (c_n - c_{-n}), \tag{2} $$ then by $(1)-\mathrm i(2)$, we have $$ c_n = \frac 12 (a_n - \mathrm i b_n) = \frac 1{2\pi} \int_{-\pi}^\pi f(x)(\cos(nx) - \mathrm i\sin(nx))\mathrm dx = \color{\red}{\frac 1{2\pi}} \int_{-\pi}^\pi f(x) \mathrm e^{-\mathrm inx} \mathrm dx, $$ similarly for $c_{-n}$. Hence the coefficient.