How is the Fourier transform a generalization to the Fourier series? I have taken a self-tought course on the subject of Fourier series
and Fourier transform and I got the message that the latter is a generalization of the first.
I know that the idea that the Fourier series assumes that the function
$f$ is $2\pi$ periodic (or $2L$ for some $L\in\mathbb{R}$) and
that the Fourier series approximate $f$ using a sum of $\cos$ and
$\sin$ functions that is evaluated in a continues way rather then
a discrete one at the points of $\mathbb{Z}$.
The motivation for the Fourier series is clear to me - this is just
the best approximation to $f$ is the span of a subvector space -
$\{e^{int}\}_{n=-\infty}^{n=\infty}$
I want a motivation for the definition of the Fourier transform:
$$
F(\omega)=\int_{-\infty}^{\infty}f(t)e^{-i\omega t}dt
$$


*

*For starter - It seems that is should be the case that if I take
$f$ which is $2\pi$periodic I would get something similar to the
Fourier series of $f$, this is what I tried:


$$
F(\omega)=\int_{-\infty}^{\infty}f(t)e^{-i\omega t}dt
$$
$$
=\sum_{n=-\infty}^{\infty}\int_{2\pi n-\pi}^{2\pi(n+2)-\pi}f(t)e^{-i\omega t}dt
$$
and since $f$ is $2\pi$ and so is $e^{-i\omega t}$ it follows that
the last integral equals to
$$
=\sum_{n=-\infty}^{\infty}\int_{-\pi}^{\pi}f(t)e^{-i\omega t}dt\,\,\,\,(1)
$$
The Fourier series is 
$$
f(t)\sim\sum_{n=-\infty}^{\infty}(\int_{-\pi}^{\pi}f(t)e^{-int}dt)e^{int}
$$
and if I allow myself to change the notation a bit 
$$
f(\omega)\sim\sum_{n=-\infty}^{\infty}(\int_{-\pi}^{\pi}f(t)e^{-int}dt)e^{in\omega}\,\,\,\,(2)
$$
I can see that $(1)$ and $(2)$ are similar, but I couldn’t get from
one to the other, I tried inserting $e^{int}e^{-int}$ into the integrand
in ($1)$, but with no success.


*There is also a definition of the Fourier series of a function
defined on $[-L,L]$ which is $2L$ periodic, I want to let $L\to\infty$
and get the definition of the Fourier transform, but I didn't manage
to do this, I had trouble taking the limit of the form 
$$
\frac{1}{2L}\int_{-L}^{L}...
$$


since as $L\to\infty$ we get $\frac{1}{2L}\to0$
Can someone please help me to understand the relation between the
two expression $(1)$ and $(2)$ and to take the limit above and
get to the definition of the Fourier transform ?
 A: The Fourier inversion theorem has two different forms:
$$f(t) \sim \sum_{n=-\infty}^{\infty} \left(\int_{-\pi}^{\pi} f(x)e^{-inx}\,dx\right) e^{int}$$
and
$$f(t) \sim \int_{-\infty}^{\infty}\left(\int_{-\infty}^{\infty} f(x)e^{-i\omega x}\,dx\right)e^{i\omega t}\,d\omega.$$
You seem to be a bit mixed up on that point since at one point you're referencing the inversion theorem (writing $f$ as its Fourier series) but at another you're only referencing the Fourier transform. This explains why you're "missing" a complex exponential: you're comparing the wrong things.
If you discretized the $\omega$ you were interested in and appropriately changed the measure from the Lebesgue measure to the counting measure, then you'd get something slightly resembling Fourier series. You still need to adjust the inner integral but that can be done by assuming $f$ is band-limited (which can be thought of as the restriction to $2\pi$ periodic functions). In some sense, the Shannon sampling theorem bridges the gap between Fourier series and Fourier transforms quite naturally.
As for how to "derive" the Fourier transform from Fourier series as you'd like to in your second point, I highly suggest looking up the heuristic argument given by Boggess in the appendix in A First Course with Fourier Analysis. If you would like, I can recreate the argument here.
A: The way that Fourier came up with the Fourier transform and its inverse is through a contorted limiting process of the Fourier series expansion on $[-c,c]$ as $c\rightarrow\infty$. Most things that Fourier did could be fully justified once Math had evolved enough, but his arguments leading to the Fourier transform were horrible and cannot be made rigorous, even though he ended up with the correct result. The simple idea behind the arguments is that if you start with $c=\pi$, then you need terms $\cos(nx)$, $\sin(nx)$ to express $f$. If you multiply the length by a positive integer $N$ so that you are looking at $[-cN,cN]$, then you need $\cos(nx/N)$ and $\sin(nx/N)$. Finally the limit results in a continuum of modes is needed to reconstruct a function $f$ on $(-\infty,\infty)$.
One way to see what is going on is to assume $f$ is continuous and vanishes outside some interval $[-R,R]$. For $N\pi > R$, you can write
\begin{align}
              f(x) & = \sum_{n=-\infty}^{\infty}e^{inx/N}\frac{1}{2\pi N}\int_{-\infty}^{\infty}e^{-int/N}f(t)dt \\
             & = \frac{1}{2\pi}\sum_{n=-\infty}^{\infty}\left[e^{ixs}\int_{-R}^{R}f(t)e^{-ist}dt\right]_{s=n/N}\frac{1}{N}
\end{align}
That looks like a Riemann sum with $\Delta s = \frac{1}{N}$ and evaluation points $\frac{n}{N}$ for $n=0,\pm 1,\pm 2,\pm 3,\cdots$. If you assume $f$ vanishes outside $[-R,R]$ as we have done, and further assume that $f'$ and $f''$ are continuous on $\mathbb{R}$, then, for $\epsilon > 0$, you can find $R_{0}$ large enough that
$$
              \left|\frac{1}{2\pi}\sum_{|n/N| > R_{0}}...\right| < \epsilon/3.
$$
and choose $N$ large enough that
$$
               \left|\left(\frac{1}{2\pi}\sum_{|n/N| \le R_{0}} ...\right) - \frac{1}{2\pi}\int_{-R_{0}}^{R_{0}}e^{isx}\int_{-R}^{R}e^{-ist}f(t)dt ds\right| < \epsilon/3
$$
and
$$
        \left|\frac{1}{2\pi}\int_{-R_{0}}^{R_{0}}e^{isx}\int_{-R}^{R}e^{-ist}f(t)dt ds-\int_{-\infty}^{\infty}e^{isx}\int_{-R}^{R}e^{-ist}f(t)dt ds\right| < \epsilon/3
$$
So, at least for some smooth compactly supported functions, you can evaluate the limit to be what you expect:
$$
          \frac{1}{2\pi}\int_{-\infty}^{\infty}e^{isx}\int_{-R}^{R}e^{-ist}f(t)dt ds = f(x).
$$
Then you can work on removing the restriction that $f$ is compactly supported.
