GAUSS ERROR INTEGRAL

Lets approximate the function f(x)=sin(x) with the function s(x)=C1*x + C3*x3 + C5*x5
The calculation will not be easy any more. Do it with maple.

You think you already know a solution ? C1=1, C3= -1/3! and C5=1/5!
Ok, but perhaps Gauss approximation is the better one ?
We ll compare it finally ...


We start at the same point as in the easy example:

b   b  
s ( x, ap )] * δs(ap)/δap dx= f(x)* δs(ap)/δap dx ,   p=0..n
a
(1)
a
(2)

Its easy to compute

ds/dC0=x
ds/dC1=x3
ds/dC2=x5


So the system we have to solve for C1 C3 C5 is ...

b   b  
(C5*x5+C3*x3+C1*x)*x dx = sin(x)*x dx ,   p=1
a
a
b   b  
(C5*x5+C3*x3+C1*x)*x3 dx = sin(x)*x3 dx ,   p=2
a
a
b   b  
(C5*x5+C3*x3+C1*x)*x5 dx = sin(x)*x5 dx ,   p=3
a
a

 

Its not easy to do and I have got to admit, solution being a little bit long :-)
Thats because I solved it for all a and b

Choosing values for a and b (the optimizing interval) our function gets much easier:
Example:
a=0 b=Pi

C1=  0.9878621255
C3= -0.1552714092
C5=  0.005643117749

Here the result

You see, computers are good for computing !

Setting a=0, we can plot a nice graphics. Showing the error (s(x,b)-sin(x))**2



We can even optimize up to b=4.5 without the error getting too big
So lets do that just for fun.

back to GAUSS
back to mathematics