Vous êtes sur la page 1sur 4

*************** COMPOSITE TRAPEZOIDAL'S RULE *************

Problem no.1 ∫sqrtf(1+x*x) from 1 to 5

***** CASE 1 *****

************* OUTPUT *************


x0 = 1.000000 and f(x0) = 1.414214
x1 = 2.000000 and f(x1) = 2.236068
x2 = 3.000000 and f(x2) = 3.162278
x3 = 4.000000 and f(x3) = 4.123106
x4 = 1.000000 and f(x4) = 5.099020
Value of integral between [1.0, 5.0] is 12.778068

***** CASE 2 *****


************* OUTPUT *************
x0 = 1.000000 and f(x0) = 1.414214
x1 = 1.500000 and f(x1) = 1.802776
x2 = 2.000000 and f(x2) = 2.236068
x3 = 2.500000 and f(x3) = 2.692582
x4 = 3.000000 and f(x4) = 3.162278
x5 = 3.500000 and f(x5) = 3.640055
x6 = 4.000000 and f(x6) = 4.123106
x7 = 4.500000 and f(x7) = 4.609772
x8 = 1.000000 and f(x8) = 5.099020
Value of integral between [1.0, 5.0] is 12.761626

Problem no.2 ∫(0.2+25*x+3*x*x)dx from 0 to 2

***** CASE 1 *****


*************** OUTPUT ************
x0 = 0.000000 and f(x0) = 0.200000
x1 = 0.500000 and f(x1) = 13.450000
x2 = 1.000000 and f(x2) = 28.200001
x3 = 1.500000 and f(x3) = 44.450001
x4 = 0.000000 and f(x4) = 62.200001
Value of integral between [0.0, 2.0] is 58.649998

***** CASE 2 *****

*************** OUTPUT ************


x0 = 0.000000 and f(x0) = 0.200000
x1 = 0.050000 and f(x1) = 1.457500
x2 = 0.100000 and f(x2) = 2.730000
x3 = 0.150000 and f(x3) = 4.017500
x4 = 0.200000 and f(x4) = 5.320000
x5 = 0.250000 and f(x5) = 6.637500
x6 = 0.300000 and f(x6) = 7.970000
x7 = 0.350000 and f(x7) = 9.317500
x8 = 0.400000 and f(x8) = 10.680000
x9 = 0.450000 and f(x9) = 12.057500
x10 = 0.500000 and f(x10) = 13.450000
x11 = 0.550000 and f(x11) = 14.857500
x12 = 0.600000 and f(x12) = 16.280001
x13 = 0.650000 and f(x13) = 17.717501
x14 = 0.700000 and f(x14) = 19.170000
x15 = 0.750000 and f(x15) = 20.637501
x16 = 0.800000 and f(x16) = 22.120001
x17 = 0.850000 and f(x17) = 23.617500
x18 = 0.900000 and f(x18) = 25.129999
x19 = 0.950000 and f(x19) = 26.657499
x20 = 1.000000 and f(x20) = 28.200001
x21 = 1.050000 and f(x21) = 29.757502
x22 = 1.100000 and f(x22) = 31.330000
x23 = 1.150000 and f(x23) = 32.917500
x24 = 1.200000 and f(x24) = 34.520000
x25 = 1.250000 and f(x25) = 36.137501
x26 = 1.300000 and f(x26) = 37.770000
x27 = 1.350000 and f(x27) = 39.417500
x28 = 1.400000 and f(x28) = 41.079998
x29 = 1.450000 and f(x29) = 42.757500
x30 = 1.500000 and f(x30) = 44.450001
x31 = 1.550000 and f(x31) = 46.157501
x32 = 1.600000 and f(x32) = 47.880001
x33 = 1.650000 and f(x33) = 49.617500
x34 = 1.700000 and f(x34) = 51.370003
x35 = 1.750000 and f(x35) = 53.137501
x36 = 1.800000 and f(x36) = 54.920002
x37 = 1.850000 and f(x37) = 56.717503
x38 = 1.900000 and f(x38) = 58.529999
x39 = 1.950000 and f(x39) = 60.357502
x40 = 0.000000 and f(x40) = 62.200001
Value of integral between [0.0, 2.0] is 58.402504

Problem no.3 ∫1/(1+x*x)dx from 0 to 1

***** CASE 1 *****


************* OUTPUT *************
x0 = 0.000000 and f(x0) = 1.000000
x1 = 0.000000 and f(x1) = 0.500000
Value of integral between [0.0, 1.0] is 0.750000

***** CASE 2 *****


************* OUTPUT ************
x0 = 0.000000 and f(x0) = 1.000000
x1 = 0.500000 and f(x1) = 0.800000
x2 = 0.000000 and f(x2) = 0.500000
Value of integral between [0.0, 1.0] is 0.775000

***** CASE 3 *****

************* OUTPUT *************


x0 = 0.000000 and f(x0) = 1.000000
x1 = 0.050000 and f(x1) = 0.997506
x2 = 0.100000 and f(x2) = 0.990099
x3 = 0.150000 and f(x3) = 0.977995
x4 = 0.200000 and f(x4) = 0.961538
x5 = 0.250000 and f(x5) = 0.941176
x6 = 0.300000 and f(x6) = 0.917431
x7 = 0.350000 and f(x7) = 0.890869
x8 = 0.400000 and f(x8) = 0.862069
x9 = 0.450000 and f(x9) = 0.831601
x10 = 0.500000 and f(x10) = 0.800000
x11 = 0.550000 and f(x11) = 0.767754
x12 = 0.600000 and f(x12) = 0.735294
x13 = 0.650000 and f(x13) = 0.702988
x14 = 0.700000 and f(x14) = 0.671141
x15 = 0.750000 and f(x15) = 0.640000
x16 = 0.800000 and f(x16) = 0.609756
x17 = 0.850000 and f(x17) = 0.580552
x18 = 0.900000 and f(x18) = 0.552486
x19 = 0.950000 and f(x19) = 0.525624
x20 = 0.000000 and f(x20) = 0.500000
Value of integral between [0.0, 1.0] is 0.785294

Problem no.4 ∫x(2+x*x*x)dx from 0 to 1

***** CASE 1 *****

*************** OUTPUT ************


x0 = 0.000000 and f(x0) = 0.000000
x1 = 0.250000 and f(x1) = 0.503906
x2 = 0.500000 and f(x2) = 1.062500
x3 = 0.750000 and f(x3) = 1.816406
x4 = 0.000000 and f(x4) = 3.000000
Value of integral between [0.0, 1.0] is 1.220703

***** CASE 2 *****


************ OUTPUT ************
x0 = 0.000000 and f(x0) = 0.000000
x1 = 0.100000 and f(x1) = 0.200100
x2 = 0.200000 and f(x2) = 0.401600
x3 = 0.300000 and f(x3) = 0.608100
x4 = 0.400000 and f(x4) = 0.825600
x5 = 0.500000 and f(x5) = 1.062500
x6 = 0.600000 and f(x6) = 1.329600
x7 = 0.700000 and f(x7) = 1.640100
x8 = 0.800000 and f(x8) = 2.009600
x9 = 0.900000 and f(x9) = 2.456100
x10 = 0.000000 and f(x10) = 3.000000
Value of integral between [0.0, 1.0] is 1.203330

*****CASE 3 *****
************* OUTPUT **********
x0 = 0.000000 and f(x0) = 0.000000
x1 = 0.050000 and f(x1) = 0.100006
x2 = 0.100000 and f(x2) = 0.200100
x3 = 0.150000 and f(x3) = 0.300506
x4 = 0.200000 and f(x4) = 0.401600
x5 = 0.250000 and f(x5) = 0.503906
x6 = 0.300000 and f(x6) = 0.608100
x7 = 0.350000 and f(x7) = 0.715006
x8 = 0.400000 and f(x8) = 0.825600
x9 = 0.450000 and f(x9) = 0.941006
x10 = 0.500000 and f(x10) = 1.062500
x11 = 0.550000 and f(x11) = 1.191506
x12 = 0.600000 and f(x12) = 1.329600
x13 = 0.650000 and f(x13) = 1.478506
x14 = 0.700000 and f(x14) = 1.640100
x15 = 0.750000 and f(x15) = 1.816406
x16 = 0.800000 and f(x16) = 2.009600
x17 = 0.850000 and f(x17) = 2.222006
x18 = 0.900000 and f(x18) = 2.456100
x19 = 0.950000 and f(x19) = 2.714506
x20 = 0.000000 and f(x20) = 3.000000
Value of integral between [0.0, 1.0] is 1.200833

Centres d'intérêt liés