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

∫π

−π

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√

∫π

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√

(eikx− e−ikx

)=

(−i√

π

1− cos(kπ)

k

) √2√

2π(2isinkx)

414 CHAPTER 17. INNER PRODUCT SPACESIn addition, e* = e~* becausee®* = cosx —isinx = cos(—x) +isin(—x) =e *: _ 1 pikxIt follows that the functions Tmae fork € {—n,—(n—1),---,-1,0,1,---,(n-1) ns} =I,form an orthonormal set in V, the inner product space of continuous functions defined on[—2, 2] with the inner product given bya[| fe)e@ars (F.2).I will verify this now. Let k,/ be two integers in [,,k Al1 _ 1 i(k—l)xike Giledy = / i(k-Dxgy — £ Fa[« ellXdx ie x kay= cos(k—1)m—cos(k—1)(—z) =0Also x 4 1 1 opm——eik* ___eikx dy = > / e'dx = 1.[, V20 V2 20 J—nExample 17.5.1 Let V be the inner product space of piecewise continuous functions de-fined on |—2, 1] and let U be the span of the (vectors) fel Let_ lifx>0ro)=4 -lifx<0Find 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 ++ cos (x) is even andx sin (x) is odd,nt . —i2 th[fe ree a= al sin (—kx) dx_ -iV21—cos(ka) [7 _oS ff lar=0.Therefore, the best approximation is" ( ~i 1—cos(kt)\ V2 in» (a k ) aaThe term for k can be combined with the term for —k to yielda) AZ (det) = (piosetn) ak=-—n(2isinkx)