414 CHAPTER 17. INNER PRODUCT SPACES
In addition, eix = e−ix because
eix = cosx− isinx = cos(−x)+ isin(−x) = e−ix
It follows that the functions 1√2π
eikx for
k ∈ {−n,−(n−1) , · · · ,−1,0,1, · · · ,(n−1) ,n} ≡ In
form an orthonormal set in V, the inner product space of continuous functions defined on[−π,π] with the inner product given by∫
π
−π
f (x)g(x)dx≡ ⟨ f ,g⟩ .
I will verify this now. Let k, l be two integers in In,k ̸= l∫π
−π
eikxeilxdx =∫
π
−π
ei(k−l)xdx =ei(k−l)x
i(k− l)|π−π
= cos(k− l)π− cos(k− l)(−π) = 0
Also ∫π
−π
1√2π
eikx 1√2π
eikxdx =1
2π
∫π
−π
e0xdx = 1.
Example 17.5.1 Let V be the inner product space of piecewise continuous functions de-fined on [−π,π] and let U be the span of the (vectors)
{eikx}n
k=−n. Let
f (x) =
{1 if x≥ 0−1 if x < 0
Find the vector of U which is closest to f in the mean square sense (In the norm defined bythis inner product).
First of all, you need to find the Fourier coefficients. Since x 7→ cos(x) is even andx 7→ sin(x) is odd, ∫
π
−π
f (x)1√2π
e−ikxdx =−i2√
2π
∫π
0sin(−kx)dx
=−i√
2√π
1− cos(kπ)
k,∫
π
−π
f (x)dx = 0.
Therefore, the best approximation is
n
∑k=−n
(−i√
π
1− cos(kπ)
k
) √2√
2πeikx
The term for k can be combined with the term for −k to yield(−i√
π
1− cos(kπ)
k
) √2√
2π
(eikx− e−ikx
)=
(−i√
π
1− cos(kπ)
k
) √2√
2π(2isinkx)