高斯近似

1.(a) fx= x2高斯近似

step 1: calculate qi高斯近似

q0=a0-<a0,q0>q0=1;高斯近似

q1=a1-<a1,q0>q0=32x-1;高斯近似

step 2: calculate ci高斯近似

c0=<f,q0>=01fq0dx=13;高斯近似

c1=<f,q1>=01fq1dx=36;高斯近似

step 3: calculate p(x)

px=c0q0+c1q1=x-16;高斯近似

step 4: get result

r=min01(fx-p(x))2dx= 1180≈0.00555….高斯近似

高斯近似

Fig 1. f(x) = x^2

 

(b) fx= x3/2高斯近似

step 1: calculate qi高斯近似

q0=a0=1;高斯近似

q1=a1-<a1,q0>q0=32x-1;高斯近似

q2=a2-<a2,q0>q0-<a2,q1>q1高斯近似

=180x2-x+16;高斯近似

step 2: calculate ci高斯近似

c0=<f,q0>=01fq0dx=25;高斯近似

c1=<f,q1>=01fq1dx=6335;高斯近似

c2=<f,q2>=01fq2dx=25105;高斯近似

step 3: calculate p(x)

px=c0q0+c1q1=47x2+1635x-2105;高斯近似

step 4: get result

r=min01(fx-p(x))2dx= 144100≈2.26e-5.高斯近似

高斯近似

Fig 2. f(x) = x^(3/2)

(c) Program in Matlab to Calculate qi高斯近似, ci高斯近似 and p(x), then get the figure as follow

 

高斯近似

Fig 3. f(x) = 1/(1+x^2)