06.09.2021 Views

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 5. APPROXIMATION THEORY 204<br />

Theorem 92. 1. If φ j (x) is a polynomial of degree j for j =0, 1, ..., n, then φ 0 , ..., φ n are<br />

l<strong>in</strong>early <strong>in</strong>dependent.<br />

2. If φ 0 , ..., φ n are l<strong>in</strong>early <strong>in</strong>dependent <strong>in</strong> P n , then for any q(x) ∈ P n , there exist unique<br />

constants c 0 , ..., c n such that q(x) = ∑ n<br />

j=0 c jφ j (x).<br />

Exercise 5.3-2: Prove that if {φ 0 ,φ 1 , ..., φ n } is a set of orthogonal functions, then they<br />

must be l<strong>in</strong>early <strong>in</strong>dependent.<br />

We have developed what we need to solve the least squares problem us<strong>in</strong>g orthogonal<br />

polynomials. Let’s go back to the problem statement:<br />

Given f ∈ C 0 [a, b], f<strong>in</strong>d a polynomial P n (x) ∈ P n that m<strong>in</strong>imizes<br />

E =<br />

∫ b<br />

a<br />

w(x)(f(x) − P n (x)) 2 dx = 〈f(x) − P n (x),f(x) − P n (x)〉<br />

<strong>with</strong> P n (x) written as a l<strong>in</strong>ear comb<strong>in</strong>ation of orthogonal basis polynomials: P n (x) =<br />

∑ n<br />

j=0 a jφ j (x). In the previous section, we solved this problem us<strong>in</strong>g calculus by tak<strong>in</strong>g<br />

the partial derivatives of E <strong>with</strong> respect to a j and sett<strong>in</strong>g them equal to zero. Now we will<br />

use l<strong>in</strong>ear algebra:<br />

〈<br />

E = f −<br />

n∑<br />

a j φ j ,f −<br />

j=0<br />

〉<br />

n∑<br />

a j φ j = 〈f,f〉−2<br />

j=0<br />

= ‖f‖ 2 − 2<br />

= ‖f‖ 2 − 2<br />

= ‖f‖ 2 −<br />

n∑<br />

a j 〈f,φ j 〉 + ∑ ∑<br />

a i a j 〈φ i ,φ j 〉<br />

j=0<br />

i j<br />

n∑<br />

n∑<br />

a j 〈f,φ j 〉 + a 2 j 〈φ j ,φ j 〉<br />

j=0<br />

n∑<br />

a j 〈f,φ j 〉 +<br />

j=0<br />

n∑ 〈f,φ j 〉 2<br />

+<br />

α j<br />

j=0<br />

n∑<br />

j=0<br />

j=0<br />

n∑<br />

a 2 jα j<br />

j=0<br />

[ 〈f,φj 〉<br />

√<br />

αj<br />

− a j<br />

√<br />

αj<br />

] 2<br />

.<br />

M<strong>in</strong>imiz<strong>in</strong>g this expression <strong>with</strong> respect to a j is now obvious: simply choose a j = 〈f,φ j〉<br />

[<br />

〈f,φj 〉<br />

√ αj<br />

that the last summation <strong>in</strong> the above equation, ∑ ]<br />

n<br />

√ 2,<br />

j=0<br />

− a j αj vanishes. Then we<br />

have solved the least squares problem! The polynomial that m<strong>in</strong>imizes the error E is<br />

α j<br />

so<br />

P n (x) =<br />

n∑<br />

j=0<br />

〈f,φ j 〉<br />

α j<br />

φ j (x) (5.13)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!