TITLE: Examples of orthonormal bases for $L^2[0,1]$ that are not trigonometric?
QUESTION [6 upvotes]: What are examples of orthonormal bases for $L^2([0,1],dx)$? For instance, the following trigonometric polynomials are orthonormal basis
$$\left\{1, \sqrt{2}\sin(2\pi jx),\sqrt{2}\cos(2\pi j x),\;j=1,2,\dots,\right\}$$
I know, that Legendre polynomials serve as a basis for $L^2([-1,1], ds)$, and that they are obtained as a result of Gram-Schmidt applied to $\left\{1,x^2,x^3,\dots\right\}$. When I apply Gram-Schmidt to those regular polynomials, the first two term are $\left\{1,2\sqrt{3}x-\sqrt{3}\right\}$, but latter terms become messy.
So the first question is whether there is recursive expression for the orthonormal basis for $L^2[0,1]$ based on regular polynomials, so that it can be used easily in numerical applications? 
I'm also wondering what are other examples of orthonormal bases of $L^2[0,1]$, useful for numerical purposes. For example, Haar system is a basis for this space, but it does not approximate smooth functions well.

REPLY [2 votes]: Suppose $p$ is a real continuously differentiable and strictly positive on $[0,1]$, and $q$ is a real continuous function on $[0,1]$. Choose $\alpha,\beta \in [0,\pi)$. Then there are real numbers
$$
           \lambda_{0} < \lambda_{1} < \lambda_{2} < \cdots
$$
for which non-trivial solutions $\varphi_{n}$ exist for
$$
         \left[-\frac{d}{dx}p\frac{d}{dx}+q\right]\varphi_{n} =\lambda_{n}\varphi_{n},\\
             \cos\alpha\, \varphi_{n}(a)+\sin\alpha\,\varphi_{n}'(a) = 0,\\
             \cos\beta\, \varphi_{n}(b) + \sin\beta\,\varphi_{n}'(b) = 0.
$$
When normalized to have $L^{2}[0,1]$ norm 1, the set of all such eigenfunction solutions form a complete orthonormal basis of $L^{2}[0,1]$.
Even the classical solutions where $p=1$, $q=0$ are interesting if you choose $\alpha$, $\beta$ to be non-zero. For example, choose $\alpha=\beta=\pi/4$. Then the unnormalized eigenfunctions are
$$
       e^{-x},-\cos(n\pi x)+\frac{1}{n\pi}\sin(n\pi x),\;\;\; n=1,2,3,\cdots\;.
$$
That set is a little unexpected because of the presence of $e^{-x}$. For general $\alpha$, $\beta$, the sets of functions may include two exponential type solutions and trigonometric functions with $\sqrt{\lambda_{n}}x$ arguments where values of $\sqrt{\lambda_{n}}$ are not evenly spaced.