Integration over (a,b)

An integral of the form,

[Maple Math] ,

can always be transformed to an integral over [Maple Math] by the transformation

[Maple Math] :

> restart:

> xt:=((b-a)*t+b+a)/2;

[Maple Math]

> subs(t=-1,xt);

[Maple Math]

> subs(t=1,xt);

[Maple Math]

> diff(xt,t);

[Maple Math]

> gt:=t->(b-a)*f(((b-a)*t+b+a)/2)/2;int(gt(t),t=-1..1);

[Maple Math]

[Maple Math]

Indeed:

> f:=x->sin(2.*x)*exp(-x);

[Maple Math]

> int(f(x),x=1..3);

[Maple Math]

> a:=1.;b:=3;gt:=t->(b-a)*f(((b-a)*t+b+a)/2)/2;

[Maple Math]

[Maple Math]

[Maple Math]

> int(gt(t),t=-1..1);

[Maple Math]

This shows that indeed, the integral in [Maple Math] produces the same result as the integral in [Maple Math] .

We can now apply Gaussian quadrature on the integral in [Maple Math] :

> r[1]:=-0.8611363116:r[2]:=-0.3399810436:r[3]:=-r[2]:r[4]:=-r[1]:c[1]:=0.3478548451:c[2]:=0.6521451549:c[3]:=c[2]:c[4]:=c[1]:

> gauss4:=0:for i from 1 to 4 do gauss4:=gauss4+c[i]*gt(r[i]): od: gauss4;

[Maple Math]

>