I am studying Lebesgue spaces and appear the concept of orthonormal basis. My professor told me that a classic result is the following: the set given by $$(\sqrt{2} \sin(n\pi x))_{n\geq 1}$$ is an orthonormal basis of $L^2(0,1)$. So he ask me how is possible obtain basis for $L^2$ on union of intervals in the form: $\mathcal{E}:=(0,a)\cup(b,c)$.
My question are: which is an orthonormal basis of $L^2(\mathcal{E})$?, the same basis works for both $L^2(0,1)$ and $L^2(\mathcal{E})$ ?.
Step 1: Orthonormal basis for $L^2(a,b)$
Let $(a,b)$ be an interval . Then the inner product for $L^2(a,b)$ is given by, $$<f,g>=\frac{1}{b-a} \int_{a}^b f(t)\overline{g(t)}dt$$ (Note that we have included the factor $\frac{1}{b-a}$ just to normalize our space to be a probability space.) Now we have the natural homeomorphism $\varphi:(a,b) \to (0,1)$ given by, $\varphi(x)=\frac{x-a}{b-a}$ .Now corresponding to your favourite Orthonormal basis of $L^2(0,1)$ say $\{e_n\}_{n \in \Bbb N}$ consider $\{\tilde{e_n}\}_{n \in \Bbb N}$ given by, $\tilde{e_n}(x):=e_n\circ\varphi(x)$ .
Exercise 1: Check that $\{\tilde{e_n}\}_{n \in \Bbb N}$ is an Orthonormal basis for $L^2(a,b)$
Step 2: Look at the union of intervals
If you are considering the union of $(a_1,b_1),(a_2,b_2)$ then either their union is a single interval namely $(\min(a_1,a_2),\max(b_1,b_2))$ or a union of two disjoint intervals. If the union is a single interval, then we already have an Orthonormal basis by Step 1. Otherwise, consider $\{\tilde{e_n}\}_{n \in \Bbb N},\{\tilde{f_m}\}_{m \in \Bbb N}$ for the two intervals obtained from Step 1 .
Step 3: Looking at the direct sum
As the set is disjoint union of two open intervals, it is easy to prove that,
Exercise 2: $L^2(\mathcal{E})=L^2(a_1,b_1) \oplus L^2(a_2,b_2)$ (in fact, as an orthogonal sum)
Exercise 3: $\{(\tilde{e_n},0),(0,\tilde{f_m}):m,n \in \Bbb N\}$ is an Orthonormal basis of $L^2(\mathcal{E})$ (where you extend $\tilde{e_n}$ to be $0$ on $(a_2,b_2)$ and $\tilde{f_n}$ to be $0$ on $(a_1,b_1)$ )
Q.E.D
Let me know if more details is required !