summaryrefslogtreecommitdiff
path: root/50/CH5/EX5.18/ex_5_18.sce
blob: 08ce9df7a0650e7dda6b8aab96e112a38bd64e45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// example 5.18
// caption: gauss-chebyshev method

// we write the integral as I=integral f(x)/sqrt(1-x^2) in the range [-1,1];
// where f(x)=(1-x^2)^2*cos(x)

deff('[y]=f(x)','y=(1-x^2)^2*cos(x)');

// 1) since , from gauss chebyshev one point rule;
I1=(3.14)*f(0)

// 2) since , from gauss chebyshev two point rule;
I2=(3.14/2)*f(-1/sqrt(2))+f(1/sqrt(2))

// 3) since , from gauss chebyshev three point rule;
I=(3.14/3)*(f(-sqrt(3)/2)+f(0)+f(sqrt(3)/2)) 


// and 4) since , from gauss legendre three point rule;
I=(1/9)*(5*f(-sqrt(3/5))+8*f(0)+5*f(sqrt(3/5)))