The Fourier series expects that the function $f(t)$ is periodic. What if we want to use
Fourier series for a nonperiodic function? Either we can make such function periodic—but that is
not always welcome—or we can make that function periodic with size of the period $T_0 \to \infty$. **If we stretch
the period $T_0$ to infinity, then periodic expression become nonperiodic.**

So let us use Fourier series to represent periodic function and then observe what happens to Fourier series if we stretch its period $T_0$ to infinity.

The three series depicted above use only the constant term $a_0/2$ and then first three terms $b_1,\ b_2,\ b_3$ for sine and $a_1,\ a_2,\ a_3$ for cosine functions. The coefficients for series were derived from integrals (not solved here) as:

$$ \begin{align} f(t) &= \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n\cos nt\frac{\pi}{p} + b_n\sin nt\frac{\pi}{p},\hskip2em p = T_0/2\nonumber \\ a_n &= \frac{1}{\pi n} \sin \frac{\pi n}{p}\nonumber \\ b_n &= -\frac{1}{\pi n}(\cos{\frac{\pi n}{p}} -1)\nonumber \\ \end{align} $$and if we list some of the first terms:

$$ \begin{align} f_2(t) &= \frac 1 2 \color{red}{+ 0.637 \sin \pi t} + 0.212 \sin 3 \pi t + 0.127 \sin 5 \pi t + \dots \label{ref:fourier_coef1} \\ f_4(t) &= \frac 1 4 \color{blue}{+ 0.318 \sin \frac{\pi t}{2}} \color{green}{+ 0.318 \cos \frac{\pi t}{2}} \color{red}{+ 0.318 \sin \frac{2 \pi t}{2}} + 0.106 \sin \frac{3 \pi t}{2} - 0.106 \cos \frac{3 \pi t}{2} + \dots \label{ref:fourier_coef2} \\ f_8(t) &= \frac 1 8 + 0.093 \sin \frac{\pi t}{4} + 0.225 \cos \frac{\pi t}{4} \color{blue}{+ 0.159 \sin \frac{2 \pi t}{4} } \color{green}{+ 0.159 \cos \frac{2 \pi t}{4}} + 0.181 \sin \frac{3 \pi t}{4} + \label{ref:fourier_coef3} \dots \end{align} $$We can express and use more terms of these functions. The coefficient $a_n,\ b_n$ were evaluated to build the series and first one hundred of them are presented in graphs below. All the coefficients $a_n,\ b_n$ from $(\ref{ref:fourier_coef1})$ to $(\ref{ref:fourier_coef3})$ can be found in graphs below. It can be also read form the below graphs that the Fourier expansion of the above square wave function A ($T_0=2$) does not contain any cosine member $a_n\cos \omega_n t$:

Now let us show the same graphs again with slight difference. The domain of horizontal axis
will not be $n$ (sequence of the coefficient) but it will be *frequency* $\omega_n$
associated with the coefficient $a_n$ or $b_n$. The vertical axis will be normalized as well: we
will divide its values by $T_0/2$ ($T_0$ is the period of the given function).

It can be observed that: when the coefficients $a_n,\ b_n$ for a function $x(t)$ are drawn in domain of frequencies, they are closed by envelopes (one for sines, the other one for cosines). The envelope remains the same regardless the period of the given function. If we stretch the period to infinity, there will be no red bars for each coefficient, it becomes continuous, as the envelope is.

The opposite way is possible then: all the coefficients $a_n,\ b_n$ for Fourier series of a function can be read from the envelope (which is the Fourier transform of $x(t)$). Only need them to refactor considering the required period $T_0$.

**Because Fourier series involves both sines and cosines, it is reasonable rather
to work with Fourier series in terms of complex numbers** instead of real numbers:

$$
\begin{align}
X(\omega) = \int_{-\infty}^{\infty}x(t)e^{-iwt}\ dt \label{ref:fourier_transform_eq}
\end{align}
$$

**The envelope of coefficients is the Fourier transform
$\boldsymbol{X(\omega)}$ of the function $\boldsymbol{x(t)}$.** The
function $x(t)$ is transformed into domain of frequencies, where it is defined
as $X(\omega)$. The function is the same but its representation is different.
Unlike in Laplace transform, Fourier transform is easily intepretable:
transformed function $X(\omega)$ holds Fourier series' coefficients $c_n$ for
frequencies $\omega_n$. It can be also seen how much of any given frequencies
are present in $x(t)$.

Then particular coefficient for particular frequency $\omega_n$ and a periodicity $T_0$ is

$$ \begin{align} c_n = \frac{X(\omega_n)}{T_0} \label{ref:fourier_coef4}. \end{align} $$Since the Fourier transform holds representation of the given $f(t)$ in the domain of frequencies, then by means of the above formula for every $\omega_n$ the coefficient of the Fourier series can be asked to reconstruct function $x(t)$ (in term of the Fourier series—see the example below). Note that $c_n$ is a complex number. Conversion has to be done between real and complex numbers: $a_n=2\Re(c_n),\ b_n=-2\Im(c_n)$. The inverse Fourier transform is

$$ x(t) = \frac{1}{2\pi}\int_{-\infty}^{\infty}X(\omega)e^{i\omega t}\ d\omega $$Note: although not mentioned in the chapter *Laplace transform*, also inverse
Laplace transform has integral similar to the above one as a way to evaluate inverse Laplace
transform. Similarly to Laplace transform, if $X(\omega)$ is Fourier transform of $x(t)$, then we write

and transform can be also used to solve differential equations.

Now, when we have a definition and a tool $(\ref{ref:fourier_transform_eq})$ to transform a nonperiodic signal into frequency domain, we can make some example.

Find a Fourier tranform of Dirac impulse function $\delta(t)$ (a unit impulse at $t=0$).

We will use definition $(\ref{ref:fourier_transform_eq})$ to transform given function into frequency domain:

$$ X(\omega) = \int_{-\infty}^{\infty}x(t)e^{-iwt}\ dt = \int_{-\infty}^{\infty}\delta(t)e^{-iwt}\ dt $$The value of $\delta(t)$ is zero everywhere except at $t=0$. And at $t=0$, when integrated, its area is one (from definition of Dirac delta function). Further, at the point $t=0$ the member $e^{-i\omega t}$ can be considered constant and taken out of the integral. Then $e^{-i\omega t} = e^{-i\omega\cdot 0} = 1$:

$$ X(\omega) = e^{-i\omega\cdot 0} \int_{-\infty}^{\infty}\delta(t)\ dt = 1 \cdot 1 = 1 $$The result says that all the frequencies have the same coefficient. We can draw the impulse as a Fourier series. Let us choose for the purpose $T_0 = 2\pi$. The coefficient from $(\ref{ref:fourier_coef4})$ $c_n = 1/2\pi$ has real part only, so only cosine is involved with a coefficient $a_n = 2 \cdot \Re(c_n) = 1/\pi$.

$$ f(t) = \frac 1{2\pi} + \sum\frac{1}{\pi}\cos \omega_nt = \frac 1 {2\pi}+\sum_{n=1}^{\infty} \frac{1}{\pi}\cos n\pi t $$Let us draw how the impulse is represented by Fourier series if 5 and 10 terms are evaluated:

Note: there are many functions on $(-\infty,\infty)$, which do not posses a Fourier transform; e.g. $x(t) = t,\ x(t)=t^2,\ x(t)=e^t$.