Examples of orthonormal bases for $L^2[0,1]$ that are not trigonometric? 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.
 A: 
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,12x-6\right\}$, but latter terms become messy.

Yes, one can obtain the Legendre polynomials from performing the Gram-Schmidt procedure to $\{1,x,x^2,\dots\}$ with weight function $w(x)=1$ on the interval $-1<x<1$, but this is just one way to obtain them. 
Another would be as the eigenfunctions of Legendre's equation,
$$
(1-x^2)y''-2xy'+\lambda y=0, \quad -1<x<1,
$$
subject to the boundary conditions $y,y'$ remain bounded as $x\to -1^+, 1^-$.
These can be mapped onto $0<x<1$ by a simple change of variables (doing so they are called the shifted Legendre functions).
Similarly, one can obtain the Chebyshev functions from Chebyshev's equation on $-1<x<1$, Bessel functions from Bessel's equation on $-\ell<x<\ell$, and associated Legendre functions on $-1<x<1$, to name a few. If you are okay with orthogonal families on unbounded intervals, check out the Laguerre and Hermite functions.
There are other complete orthogonal families which are neither polynomial nor trigonometric in nature. See, for example, the Haar wavelets, the Walsh functions, and their generalizations.
PS I have spoken in terms of orthogonal families. You can easily make any of these orthonormal by simply dividing each member of the family by its norm.
A: 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.
