Just started learning Fourier series and am having a rough time trying to wrap my head around the textbook. Below are two excerpts from the book each followed up a question. Many thanks in advance!
"The theory of Fourier series deals with the representation of an "arbitrary" $2\pi$ periodic function $u$ as an (infinite) sum of multiples of these functions.
$$u(x)= \sum_{n=0}^\infty (a_n \cos{nx}+b_n \sin{nx}) \tag 1$$
can be rewritten using Euler's formulae as
$$u(x)= \sum_{n=-\infty}^\infty c_n e^{inx} \tag 2."$$
Question 1
How do I get from equation (1) to equation (2)? My attempt gives me-
$$(a_n \cos{nx}+b_n \sin{nx})=e^{inx}\bigg( \frac{a_n}{2}+\frac{b_n}{2i}\bigg)+e^{-inx}\bigg( \frac{a_n}{2}-\frac{b_n}{2i}\bigg) \text{???}$$
Also why do the limits of summation change from $\sum_{n=0}^\infty$ to $\sum_{n=-\infty}^{\infty}$?
Further the textbook goes on to explain-
"Now suppose that (2) is uniformly convergent. Then the sum $u(x)$ is continuous. Multiply both sides by $e^{-imx}$ and integrate from $0$ to $2\pi$. Since the convergence is uniform the right hand side can be integrated term-wise. This yields
$$\int\limits_{0}^{2\pi}u(x)e^{-imx}dx=\sum_{n=-\infty}^{\infty} c_n \int\limits_{0}^{2\pi} e^{i(n-m)x}dx=2\pi c_m$$
Where all the integrals in the sum are zero except the one with $m=n$ which equals $2\pi$."
Question 2
What is the reason for multiplying by $e^{-imx}$? Also I do not understand the final statement about all the integrals summing to zero? If we sum between two finite numbers e.g. between $-3$ and $3$ then we get-
$$c_{-3}(-2\pi)+c_{-2}(2\pi)+c_{-1}(-2\pi)+c_{0}(2\pi)+c_{1}(-2\pi)+c_{2}(2\pi)+c_{3}(-2\pi)$$
How can we possibly say that this sums to zero if we do not know the values of the $c_{n}$'s?
You got $$(a_n \cos{nx}+b_n \sin{nx})=e^{inx}\bigg( \frac{a_n}{2}+\frac{b_n}{2i}\bigg)+e^{-inx}\bigg( \frac{a_n}{2}-\frac{b_n}{2i}\bigg)=e^{inx}c_n+e^{-inx}d_n$$ so $$\sum_{n=0}^{\infty} (a_n \cos{nx}+b_n \sin{nx})=\sum_{n=0}^{\infty} e^{inx}c_n+\sum_{n=0}^{\infty}e^{-inx}d_n=\sum_{n=0}^{\infty} e^{inx}c_n+\sum_{-n=0}^{\infty}e^{inx}d_{-n}$$ since $c_n=\overline{d_n}$ then this will be $$=\sum_{n=0}^{\infty} e^{inx}c_n+\sum_{-n=0}^{\infty}e^{inx}\overline{c_n}=\sum_{n=-\infty}^{\infty} e^{inx}c_n$$
Note that for $n\neq m$ with $k=n-m\neq0$ $$\int\limits_{0}^{2\pi} e^{i(n-m)x}dx=\int\limits_{0}^{2\pi} e^{ikx}dx=\dfrac{e^{ikx}}{ik}\Big|_{0}^{2\pi}=\dfrac{e^{ik2\pi}-1}{ik}=0$$ and for $n=m$ $$\int\limits_{0}^{2\pi} e^{i(0)x}dx=\int\limits_{0}^{2\pi} dx=x\Big|_{0}^{2\pi}=2\pi$$