figure fourier approximations of the unit step function on the interval ( )truncating the infinite sum in ( to and termsgiving the dotted bluedashed redand solid green curvesrespectively starting from any countable basiswe can use the gram-schmidt procedure to obtain an orthonormal basisas illustrated in the following example example (legendre polynomialstake the function space (rw(xdx)where ( {- we wish to construct an orthonormal basis of polynomial functions starting from the collection of monomialsi where ik using gram-schmidtthe first normalized zero-degree polynomial is /ki / to find ( polynomial of degree )project (the identity functiononto the space spanned by the resulting projection is :hg ig written out as (xz (xdx ( - - dx henceg ( )/ki is linear functionthat isof the form (xax the constant is found by normalization kg - (xdx dx - so / the gram-schmidt procedurewe find (xthat (xcontinuing / ( ) ( / ( xandin general dk gk ( ( ) kdx these are the (normalizedlegendre polynomials the graphs of and are given in figure legendre polynomials