I was reading:
https://en.wikipedia.org/wiki/Fourier_series#Definition
Where they begin to motivate the theory of fourier series using finite sized expansions.
And the first equation has me a bit stuck.
The author writes:
$$ s_N(x) = \sum_{n=1}^{N} A_n \sin \left( \frac{2\pi nx}{P} + \phi_n\right)$$
Now suppose something was approximated by the series
$$ s_N(x)=\sin(2\pi x ) + \frac{1}{2} \sin\left(2\pi x + \frac{1}{2} \right)+\frac{1}{4}\sin \left(2\pi x + \frac{1}{4} \right) + ...$$
Or more generally
$$ s_n(x) = \sum_{k=0}^{\infty} a_k \sin \left(2\pi x + b_k \right) $$
Its not obvious to me that, if the series converges, it necessarily can be written as $c_1 \sin \left( 2 \pi x + c_2 \right)$
One can I suppose decompose the sine terms into complex exponentials and see that phase shift corresponds to multiplication by a constant, but its not obvious that these series can then be recombined into a single $\sin$ term.
How can I show this fact, since otherwise I feel I am on shaky ground (intuition-wise) for assuming that we can approximate any function.
Ok, you have a series with partial sums $s_N$ of the form $$ s_N(x) = \sum_{n=1}^N A_n\sin(2\pi x+\phi_n). $$ We will prove the following surprising fact below:
By the trigonometric product formula, \begin{align*} s_N(x) &= \sum_{n=1}^NA_n(\sin\phi_n\cos(2\pi x) + \cos\phi_n\sin(2\pi x))\\ &= \left(\sum_{n=1}^NA_n\sin\phi_n\right)\cos(2\pi x) + \left(\sum_{n=1}^NA_n\cos\phi_n\right)\sin(2\pi x). \end{align*} Denote the sums in parentheses by $a_N$ and $b_N$, respectively. By the Wiki article, $$ s_N(x) = B_N\sin(2\pi x + \psi_N) $$ with $B_N = \sqrt{a_N^2+b_N^2}$ and $\psi_n = \arctan2(a_N,b_N)$. Now, note that $a_N = s_N(0)\to a$ and $b_N = s_N(1/4)\to b$ as $N\to\infty$. Hence, $B_N\to B:= \sqrt{a^2 + b^2}$. By putting $0$ and $1/4$ into $s_N$, we also see that $\sin\psi_N\to a/B$ and $\cos\psi_N\to b/B$. Hence, also $\psi_N$ converges to some $\psi\in[-\pi,\pi]$. It follows that \begin{align*} |s_N(x) - B\sin(2\pi x+\psi)| &= \left|B_N\sin(2\pi x+\psi_N) - B\sin(2\pi x+\psi)\right|\\ &\le |B_N-B||\sin(2\pi x+\psi_N)| + |B||\sin(2\pi x+\psi_N) - \sin(2\pi x + \psi)|\\ &\le |B_N-B| + |B||\psi_N-\psi|, \end{align*} whicch proves that $s_N$ to converges uniformly to $s(x) := B\sin(2\pi x+\psi)$.