Compute the Fourier transform of a $L^2$ function. Let $f\in L^2(\mathbb R)$. Is it possible to compute the Fourier transform of an $L^2(\mathbb R)$ function ? I'm asking this question because in a book I'm reading, they take the Fourier transform of a function $f\in L^2(\mathbb R)$ but for me there is no reason to have that $$\int_{\mathbb R}f(x)e^{-2i\pi x\xi }dx$$
is convergent. So, could it be a mistake from the author ?
 A: The Fourier transform is a bijection from $\mathcal S(\mathbb R)\longrightarrow \mathcal S(\mathbb R),$ where $\mathcal S(\mathbb R)$ denote the space of Schwartz function. It can be prolonged from $L^2(\mathbb R)\longrightarrow L^2(\mathbb R)$ as follow : $\mathcal S(\mathbb R)$ is dense in $L^2$, therefore, if $f\in L^2(\mathbb R)$, there is $(f_n)\subset \mathcal S(\mathbb R)$ s.t. $$f_n\longrightarrow f\quad \text{in }L^2(\mathbb R),$$
and we define $$\hat f:=\lim_{n\to \infty }\hat f_n\quad \text{in }L^2(\mathbb R).$$
But if $f\in L^2(\mathbb R)$ and $f\notin L^1(\mathbb R)$, then $$\hat f(\xi)\neq \int_{\mathbb R}f(x)e^{-2i\pi x\xi}dx,$$
a priori.
This definition is motivated by the linearity of Fourier transform, Plancherel's equality and the completeness of $L^2(\mathbb R)$. 
A: Being $L^2(\mathbb{R})\backslash L^1(\mathbb{R})\neq\emptyset$ and being $\int_\mathbb{R}f(x)e^{-2\pi ix\xi}dx$ well defined as a Lebesgue integral iff $f\in L^1(\mathbb{R})$, you are absolutely right to complain.
By the way, you can define the Fourier transform $\mathcal{F}$ for $L^2(\mathbb{R})$ by a little detour, first defining it by that formula for $L^1(\mathbb{R})$ functions, then proving that $$\forall f\in L^1(\mathbb{R})\cap L^2(\mathbb{R}), \|\mathcal{F}(f)\|_2=\|f\|_2,$$
so the Fourier transform is an isometry and then can be extended uniquely to an isometry on the whole $L^2(\mathbb{R})$ by continuity and density.
Now, having defined the Fourier transform in $L^2(\mathbb{R})$ via this indirect route, you might ask yourself if there is a more practical procedure to compute it. The first idea that comes to mind is to try to give meaning to the $L^1(\mathbb{R})$ formula: $$ \mathcal{F}(f)(\xi)=\int_\mathbb{R}f(x)e^{-2\pi ix\xi}dx,$$
also in the $L^2(\mathbb{R})$ context.
As initially said, this can't be, in general, interpreted as a Lebesgue integral. However, what about interpreting it as a improper integral? After all, for subsets $K\subset\mathbb{R}$ of finite Lebesgue measure, by Holder inequality, we have that $L^2 (K)\subset L^1 (K)$ and so, if $f\in L^2 (\mathbb{R})$ and $M>0$, it is well defined the integral: $$\int_{-M}^Mf(x)e^{-2\pi i x\xi}dx,$$ and we can try to get the limit of this quantity as $M\rightarrow\infty$. So the question: does it hold true for $f\in L^2 (\mathbb{R})$ that $$\mathcal{F}(f)(\xi)=\lim_{M\rightarrow\infty} \int_{-M}^Mf(x)e^{-2\pi i x\xi}dx?$$
Well, by Carleson's theorem, this limit exists for a.e. $\xi\in\mathbb{R}$ and that formula holds true if interpreted as an a.e. $\xi\in\mathbb{R}$ equality. So, at the end, we have recovered a meaning for the original formula via an improper integral, obtaining in this manner an explicit way to calculate the Fourier transform of a $L^2(\mathbb{R})$ function.
A: The pointwise convergence known as Carleson's theorem is a delicate problem in the sense that the proof is about 10 pages.The paper by Carleson focused on the Fourier series convergence while simpler proofs focused on convergence of Fourier transform , nevertheless the two are equivalent and the $ L^2$ convergence is not difficult to prove:
Given an $L^2$ function $f(t)$, 
define $$\hat{f_n}(s)=\int_{-n}^{n}f(t)e^{-ist}dt$$  
It can be easily shown using Plancherel theorem that there is some $g(s) \in L^2$ and $$\lim_{n\rightarrow\infty}\int_{-\infty}^{\infty}(\hat{f_n}(s)-g(s))^2ds=0$$
$$\int_{-\infty}^{\infty}(g(s))^2ds=\int_{-\infty}^{\infty}(f(t))^2dt$$
How to show $$\lim_{n\rightarrow\infty}\int_{-a}^{a}\left(\frac{1}{{2\pi}}\int_{-n}^{n}g(s)e^{ist}ds-f(t)\right)^2dt=0$$  where $a \in R$ :
First prove it for $f$ with compact support then generalise it to $L^2$ using inequalities.
Proof for  $f(t) $ of compact support and $\in L^2$  :
clearly $f(t) \in L^1$ without loss of generality assume $f(t)=0$ outside $[-\pi,\pi]$ since we can always replace   $f(t)$ with $f(t')$ such as $t=\frac{n}{2\pi} t'$ for $n \in N$ and $t' \in R$.
define $${g}(s)=\lim_{n\to\infty}\int_{-n}^{n}f(t)e^{-ist}dt$$ 
The relationship between fourier transform and fourier series for $f(t)$ above follows from
$$(1)  \lim_{n\rightarrow\infty}\int_{-\pi}^{\pi}(\frac{1}{\pi}\int_{-\pi}^{\pi}f(t+u)\frac{sin(n+\frac{1}{2})u}{2sin(u/2)}du-\frac{1}{\pi}\int_{-\pi}^{\pi} f(t+u)\frac{sin(n+\frac{1}{2})u}{u}du)^2dt=0$$
which is simply consequence of Riemann-Lebesgue Lemma applied to the function $ f (t+u) k (u) $, where $k(u)=\frac{1}{2sin(u/2)}-\frac{1}{u}$  , using remainder term for the Taylor's series of $sin(u/2)$, it easily seen $k(u) $  is bounded over $[-\pi, \pi]$
$$(2)\frac{1}{2\pi} \int_{-(n+\frac{1}{2})}^{(n+\frac{1}{2})}g(s)e^{ist}ds=\frac{1}{\pi}\int_{-\infty}^{\infty}f(t+u)\frac{sin(n+\frac{1}{2})u}{u}du$$
This can be derived from fubini's theorem and  this theorem : $\mu$ is Lebesgue outer measure, $ A $  is a measurable set with finite measure. For all $n$ ,  $\int_Af_n^2d\mu \le k $ where $ k \in R $ , {$ f_n $} is uniformly integrable
Norm convergence for Fourier series  :
$$(3)  \lim_{n\rightarrow\infty}\int_{-\pi}^{\pi}(\frac{1}{\pi}\int_{-\pi}^{\pi}f(t+u)\frac{sin(n+\frac{1}{2})u}{2sin(u/2)}du-f(t))^2dt=0$$
using Riemann Lebesgue Lemma on (2) we have $$\frac{1}{2\pi} \int_{-(n+\frac{1}{2})}^{(n+\frac{1}{2})}g(s)e^{ist}ds=\frac{1}{\pi}\int_{-\pi}^{\pi}f(t+u)\frac{sin(n+\frac{1}{2})u}{u}du$$
Using Norm convergence of fourier series (3), Riemann-Lebesgue lemma, Cauchy-Schwartz Inequality,$a^2+b^2 \ge 2ab$ and (1) and (2) we have:
$$\lim_{n\rightarrow\infty}\int_{-\pi}^{\pi}\left(\frac{1}{2\pi}\int_{-(n+\frac{1}{2})}^{n+\frac{1}{2}}g(s)e^{ist}ds-f(t)\right)^2dt=0$$
Proof for $f(t) \in L^2$:
define $f_m=f_{[-m,m]}$ where $m \in N$ and its fourier transform is $\hat{f_m}$
$$\lim_{m\rightarrow\infty} f_m=f$$ 
By Plancherel theorem : $\lim_{m\rightarrow\infty} \hat{f_m}=\lim_{m\rightarrow\infty}\int_{-m}^{m}f(t)e^{-ist}dt=\hat{f}$ in sense of $L^2$ 
our previous result for function with compact support : $$\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-n}^{n}\hat{f_m}(s)e^{ist}ds-f_m(t))^2dt =0 $$
$$\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-n}^{n}\hat{f_m}(s)e^{ist}ds-f_m(t))^2dt=\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-n}^{n}\hat{f_m}(s)e^{ist}ds-f_m(t)_{[-\pi,\pi]})^2dt =\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-n}^{n}\hat{f_m}(s)e^{ist}ds-f(t))^2dt=\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-n}^{n}\hat{f_n}(s)e^{ist}ds-f(t))^2dt=0 $$
There is a subsequence {$n$} such that $\hat{f_n} \to \hat{f} $ ae. Let's work with such subsequence 
$$\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-n}^{n}\hat{f}(s)e^{ist}ds-\frac{1}{2\pi}\int_{-n}^{n}\hat{f_n}(s)e^{ist}ds)^2dt =$$$$\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{\pi}\int_{-\infty}^{\infty}(f(t+u)_{[-\infty,-n]}+f(t+u)_{[n,\infty]})\frac{sin(n+\frac{1}{2})u}{u}du)^2dt $$ $$\le 2(||f(u)_{[-\infty,-n]}+f(u)_{[n,\infty]}||_{L^2}+||\frac{sin(n+\frac{1}{2})u}{u}||_{L^2})^{-1/2}$$ by Cauchy-Scwartz ineqaulity
because $a^2+b^2 \ge 2ab$ , it follows from Cauchy-Schwartz inequality that:
$\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-n}^{n}\hat{f}(s)e^{ist}ds-f(t))^2dt\le$ 
$\lim_{n\to \infty}\int_{-\pi}^{\pi}(|\frac{1}{2\pi}\int_{-n}^{n}\hat{f}(s)e^{ist}ds-f_n(t)|+|f_n(t)-f(t)|)^2dt=0 $ 
we proved the result for some sequence {$n$} to see the result holds for all $n$ we observe that 
$$\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-(n+1)}^{(n+1)}\hat{f}(s)e^{ist}ds-\int_{-n}^{n}\hat{f}(s)e^{ist}ds)^2dt \le$$$$\lim_{n\to \infty}\int_{-\pi}^{\pi}(\frac{1}{2\pi}\int_{-(n+1)}^{(-n)}|\hat{f(s)}|ds+\frac{1}{2\pi}\int_{n}^{(n+1)}|\hat{f(s)}|ds)^2dt \le \lim_{n\to \infty} \frac{1}{2\pi}(||\hat{f}_{[-n-1,-n]}||_{L^2}+||\hat{f}_{[n,n+1]}||_{L^2})^2=0$$ by Hölder's Inequality
