Está en la página 1de 38

Mtodos Numricos

Ejercicio 1.-Dada la integral

1
0

1 x2
dx se pide:
1 x2

a) Calcularla de forma exacta.


>> int('(1-x^2)/(1+x^2)',0,1)
Warning: The method char/int will be removed in a future relase. Use sym/int instead. For example
int(sym('x^2')).
> In char.int at 10

ans =

pi/2 1

b) Calcular la estimacin proporcionada por la frmula de Simpson bsica.


>> f=inline('(1-x.^2)./(1+x.^2)')

f=

Inline function:
f(x) = (1-x.^2)./(1+x.^2)

>> y=simpson(f,0,1)

y=

0.5667

c) Calcular la estimacin de la frmula de Simpson compuesta de 11 sumandos.

>> simpcomp(f,0,1,11)

h=

0.0455

X=

Columns 1 through 10

0 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091

Columns 11 through 20

0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636

Columns 21 through 23

0.9091 0.9545 1.0000

Y=

Columns 1 through 10

1.0000 0.9959 0.9836 0.9635 0.9360 0.9018 0.8615 0.8161 0.7664 0.7133

Columns 11 through 20

0.6575 0.6000 0.5414 0.4824 0.4235 0.3653 0.3081 0.2523 0.1980 0.1456

Columns 21 through 23

0.0950 0.0465

y=

0.5708

ans =

0.5708

d) Aplicar la frmula de Gauss de tres puntos.

>> CuadraturaGauss(f,0,1,3)

ans =

0.5705

Ejercicio 2.-Sea

f ( x) x 2

1 3
1 4
x
x . Averiguar el nmero de veces que hay que dividir el intervalo
3
12

(0,2) para que al estimar el valor de

f ( x) dx usando las frmulas compuestas de los trapecios y de Simpson

el error (en valor absoluto) sea inferior a 10

>> f=inline('((x.^2)+( (1/3)*(x.^3))- ((1/12)*(x.^4)))')


f=
Inline function:
f(x) = ((x.^2)+( (1/3)*(x.^3))- ((1/12)*(x.^4)))
>> y = trapecomp(f,0,2,45)

Y=
Columns 1 through 10
0 0.0020 0.0081 0.0185 0.0334 0.0528 0.0770 0.1060 0.1401 0.1792
Columns 11 through 20
0.2235 0.2732 0.3283 0.3888 0.4550 0.5267 0.6042 0.6875 0.7765 0.8714
Columns 21 through 30
0.9722 1.0789 1.1915 1.3100 1.4344 1.5648 1.7011 1.8432 1.9912 2.1450
Columns 31 through 40
2.3045 2.4698 2.6407 2.8172 2.9991 3.1865 3.3792 3.5771 3.7801 3.9881
Columns 41 through 46
4.2010 4.4186 4.6408 4.8674 5.0983 5.3333

y=
3.4675

y=
3.4675

>> f=inline('((x.^2)+( (1/3)*(x.^3))- ((1/12)*(x.^4)))')


f=
Inline function:
f(x) = ((x.^2)+( (1/3)*(x.^3))- ((1/12)*(x.^4)))

>> simpcomp(f,0,2,6)
h=
0.1667

X=
Columns 1 through 10
0 0.1667 0.3333 0.5000 0.6667 0.8333 1.0000 1.1667 1.3333 1.5000
Columns 11 through 13
1.6667 1.8333 2.0000

Y=
Columns 1 through 10
0 0.0293 0.1224 0.2865 0.5267 0.8472 1.2500 1.7360 2.3045 2.9531
Columns 11 through 13
3.6780 4.4737 5.3333

y=
3.4666

ans =
3.4666

Ejercicio 3.- Elabore un programa que calcule la integral de una funcin utilizando el mtodo de Romberg.

>> f=inline('(1-x.^2)./(1+x.^2)')
f=
Inline function:
f(x) = (1-x.^2)./(1+x.^2)
>> y = romberg(f,0,1,2)
y=
0.500000000000000

0.550000000000000 0.566666666666667

Ejercicio 4:

La siguiente secuencia permite ver la grfica de f(x)

>> x=[-1 -0.5 0 1 1.75 2.5 3.25];


>> y=[2 -3 1.
5 -1 0.5 0.75 -2];
>> xx=-1:0.01:3.5;
>> yy=spline(x,y,xx);
>> plot(x,y,'o',xx,yy)

Para este caso, se puede aplicar la regla de Simpson de 1/3 en el intervalo [-1,0], la regla del
trapecio en el intervalo [0,1] y la regla de Simpson de 3/8 en el intervalo [1,3.25].
I1 =
I2 =

( )

[ (

[ ( )

( )
( )

I3 =

( )]

( )]

[ ( )

)]

Por lo tanto, la integral buscada es la suma de las tres integrales anteriores:


( )

-0.955729

EJERCICIOS PROPUESTOS
1. Dada la integral

2
dx 0.75
x3

a) Mediante el mtodo de los trapecios, calcular aproximadamente con 8, 16, 32 y 64 sub intervalos;
verifique que a medida en que el paso se duplica, el error disminuye aproximadamente en la cuarta
parte.
>> f=inline('(2./x.^3)')
f=
Inline function:
f(x) = (2./x.^3)
>> y = trapecomp(f,1,2,8)
Y=
Columns 1 through 5
2.000000000000000 1.404663923182442 1.024000000000000 0.769346356123216 0.592592592592593

Columns 6 through 9
0.466090122894857 0.373177842565598 0.303407407407407 0.250000000000000

y=
0.757284780595764

y=
0.757284780595764
>> y = trapecomp(f,1,2,16)
Y=
Columns 1 through 5
2.000000000000000 1.667412985955628 1.404663923182442 1.194343198717014 1.024000000000000
Columns 6 through 10
0.884569700896232 0.769346356123216 0.673296622010356 0.592592592592593 0.524288000000000
Columns 11 through 15
0.466090122894857 0.416196717979983 0.373177842565598 0.335889130345648 0.303407407407407
Columns 16 through 17
0.274982377228022 0.250000000000000

y=
0.751828561118687

y=
0.751828561118687
>> y = trapecomp(f,1,2,32)
Y=
Columns 1 through 5
2.000000000000000 1.823635807106881 1.667412985955628 1.528536443148688 1.404663923182442
Columns 6 through 10
1.293822675853355 1.194343198717014 1.104806217232253 1.024000000000000 0.950885796781823
Columns 11 through 15

0.884569700896232 0.824279623177833 0.769346356123216 0.719187928669410 0.673296622010356


Columns 16 through 20
0.631228147905570 0.592592592592593 0.557046808727656 0.524288000000000 0.494048292135001
Columns 21 through 25
0.466090122894857 0.440202314662439 0.416196717979983 0.393905334335086 0.373177842565598
Columns 26 through 30
0.353879466286523 0.335889130345648 0.319097862975280 0.303407407407407 0.288729012560523
Columns 31 through 33
0.274982377228022 0.262094726191476 0.250000000000000

y=
0.750457607364025

y=
0.750457607364025
>> y = trapecomp(f,1,2,64)
Y=
Columns 1 through 5
2.000000000000000 1.909105143377333 1.823635807106881 1.743193145433448 1.667412985955628
Columns 6 through 10
1.595962363283807 1.528536443148688 1.464855788170802 1.404663923182442 1.347725163681793
Columns 11 through 15
1.293822675853355 1.242756740740741 1.194343198717014 1.148412053455062 1.104806217232253
Columns 16 through 20
1.063380381673661 1.024000000000000 0.986540368545144 0.950885796781823 0.916928856374839
Columns 21 through 25
0.884569700896232 0.853715448809282 0.824279623177833 0.796181642300794 0.769346356123216
Columns 26 through 30
0.743703623847290 0.719187928669410 0.695738026012148 0.673296622010356 0.651810079355311
Columns 31 through 35
0.631228147905570 0.611503717743111 0.592592592592593 0.574453281733984 0.557046808727656

Columns 36 through 40
0.540336535439076 0.524288000000000 0.508868767476689 0.494048292135001 0.479797790298949
Columns 41 through 45
0.466090122894857 0.452899686858871 0.440202314662439 0.427975181279351 0.416196717979983
Columns 46 through 50
0.404846532394255 0.393905334335086 0.383354866919513 0.373177842565598 0.363357883480248
Columns 51 through 55
0.353879466286523 0.344727870469302 0.335889130345648 0.327349990291038 0.319097862975280
Columns 56 through 60
0.311120790382391 0.303407407407407 0.295946907840035 0.288729012560523 0.281743939787207
Columns 61 through 65
0.274982377228022 0.268435456000000 0.262094726191476 0.255952133951512 0.250000000000000

y=
0.750114431141496

y=
0.750114431141496

b) Repetir utilizando la frmula de Simpson


>> f=inline('(2./x.^3)')
f=
Inline function:
f(x) = (2./x.^3)
>> simpcomp(f,1,2,8)
h=
0.062500000000000

X=

Columns 1 through 5
1.000000000000000 1.062500000000000 1.125000000000000 1.187500000000000 1.250000000000000
Columns 6 through 10
1.312500000000000 1.375000000000000 1.437500000000000 1.500000000000000 1.562500000000000
Columns 11 through 15
1.625000000000000 1.687500000000000 1.750000000000000 1.812500000000000 1.875000000000000
Columns 16 through 17
1.937500000000000 2.000000000000000

Y=
Columns 1 through 5
2.000000000000000 1.667412985955628 1.404663923182442 1.194343198717014 1.024000000000000
Columns 6 through 10
0.884569700896232 0.769346356123216 0.673296622010356 0.592592592592593 0.524288000000000
Columns 11 through 15
0.466090122894857 0.416196717979983 0.373177842565598 0.335889130345648 0.303407407407407
Columns 16 through 17
0.274982377228022 0.250000000000000

y=
0.750009821292995

ans =
0.750009821292995
>> simpcomp(f,1,2,16)
h=
0.031250000000000

X=
Columns 1 through 5
1.000000000000000 1.031250000000000 1.062500000000000 1.093750000000000 1.125000000000000
Columns 6 through 10

1.156250000000000 1.187500000000000 1.218750000000000 1.250000000000000 1.281250000000000


Columns 11 through 15
1.312500000000000 1.343750000000000 1.375000000000000 1.406250000000000 1.437500000000000
Columns 16 through 20
1.468750000000000 1.500000000000000 1.531250000000000 1.562500000000000 1.593750000000000
Columns 21 through 25
1.625000000000000 1.656250000000000 1.687500000000000 1.718750000000000 1.750000000000000
Columns 26 through 30
1.781250000000000 1.812500000000000 1.843750000000000 1.875000000000000 1.906250000000000
Columns 31 through 33
1.937500000000000 1.968750000000000 2.000000000000000

Y=
Columns 1 through 5
2.000000000000000 1.823635807106881 1.667412985955628 1.528536443148688 1.404663923182442
Columns 6 through 10
1.293822675853355 1.194343198717014 1.104806217232253 1.024000000000000 0.950885796781823
Columns 11 through 15
0.884569700896232 0.824279623177833 0.769346356123216 0.719187928669410 0.673296622010356
Columns 16 through 20
0.631228147905570 0.592592592592593 0.557046808727656 0.524288000000000 0.494048292135001
Columns 21 through 25
0.466090122894857 0.440202314662439 0.416196717979983 0.393905334335086 0.373177842565598
Columns 26 through 30
0.353879466286523 0.335889130345648 0.319097862975280 0.303407407407407 0.288729012560523
Columns 31 through 33
0.274982377228022 0.262094726191476 0.250000000000000

y=
0.750000622779137

ans =
0.750000622779137
>> simpcomp(f,1,2,32)
h=
0.015625000000000

X=
Columns 1 through 5
1.000000000000000 1.015625000000000 1.031250000000000 1.046875000000000 1.062500000000000
Columns 6 through 10
1.078125000000000 1.093750000000000 1.109375000000000 1.125000000000000 1.140625000000000
Columns 11 through 15
1.156250000000000 1.171875000000000 1.187500000000000 1.203125000000000 1.218750000000000
Columns 16 through 20
1.234375000000000 1.250000000000000 1.265625000000000 1.281250000000000 1.296875000000000
Columns 21 through 25
1.312500000000000 1.328125000000000 1.343750000000000 1.359375000000000 1.375000000000000
Columns 26 through 30
1.390625000000000 1.406250000000000 1.421875000000000 1.437500000000000 1.453125000000000
Columns 31 through 35
1.468750000000000 1.484375000000000 1.500000000000000 1.515625000000000 1.531250000000000
Columns 36 through 40
1.546875000000000 1.562500000000000 1.578125000000000 1.593750000000000 1.609375000000000
Columns 41 through 45
1.625000000000000 1.640625000000000 1.656250000000000 1.671875000000000 1.687500000000000
Columns 46 through 50
1.703125000000000 1.718750000000000 1.734375000000000 1.750000000000000 1.765625000000000
Columns 51 through 55
1.781250000000000 1.796875000000000 1.812500000000000 1.828125000000000 1.843750000000000
Columns 56 through 60

1.859375000000000 1.875000000000000 1.890625000000000 1.906250000000000 1.921875000000000


Columns 61 through 65
1.937500000000000 1.953125000000000 1.968750000000000 1.984375000000000 2.000000000000000

Y=
Columns 1 through 5
2.000000000000000 1.909105143377333 1.823635807106881 1.743193145433448 1.667412985955628
Columns 6 through 10
1.595962363283807 1.528536443148688 1.464855788170802 1.404663923182442 1.347725163681793
Columns 11 through 15
1.293822675853355 1.242756740740741 1.194343198717014 1.148412053455062 1.104806217232253
Columns 16 through 20
1.063380381673661 1.024000000000000 0.986540368545144 0.950885796781823 0.916928856374839
Columns 21 through 25
0.884569700896232 0.853715448809282 0.824279623177833 0.796181642300794 0.769346356123216
Columns 26 through 30
0.743703623847290 0.719187928669410 0.695738026012148 0.673296622010356 0.651810079355311
Columns 31 through 35
0.631228147905570 0.611503717743111 0.592592592592593 0.574453281733984 0.557046808727656
Columns 36 through 40
0.540336535439076 0.524288000000000 0.508868767476689 0.494048292135001 0.479797790298949
Columns 41 through 45
0.466090122894857 0.452899686858871 0.440202314662439 0.427975181279351 0.416196717979983
Columns 46 through 50
0.404846532394255 0.393905334335086 0.383354866919513 0.373177842565598 0.363357883480248
Columns 51 through 55
0.353879466286523 0.344727870469302 0.335889130345648 0.327349990291038 0.319097862975280
Columns 56 through 60
0.311120790382391 0.303407407407407 0.295946907840035 0.288729012560523 0.281743939787207
Columns 61 through 65

0.274982377228022 0.268435456000000 0.262094726191476 0.255952133951512 0.250000000000000

y=
0.750000039067320

ans =
0.750000039067320
>> simpcomp(f,1,2,64)
h=
0.007812500000000

X=
Columns 1 through 5
1.000000000000000 1.007812500000000 1.015625000000000 1.023437500000000 1.031250000000000
Columns 6 through 10
1.039062500000000 1.046875000000000 1.054687500000000 1.062500000000000 1.070312500000000
Columns 11 through 15
1.078125000000000 1.085937500000000 1.093750000000000 1.101562500000000 1.109375000000000
Columns 16 through 20
1.117187500000000 1.125000000000000 1.132812500000000 1.140625000000000 1.148437500000000
Columns 21 through 25
1.156250000000000 1.164062500000000 1.171875000000000 1.179687500000000 1.187500000000000
Columns 26 through 30
1.195312500000000 1.203125000000000 1.210937500000000 1.218750000000000 1.226562500000000
Columns 31 through 35
1.234375000000000 1.242187500000000 1.250000000000000 1.257812500000000 1.265625000000000
Columns 36 through 40
1.273437500000000 1.281250000000000 1.289062500000000 1.296875000000000 1.304687500000000
Columns 41 through 45
1.312500000000000 1.320312500000000 1.328125000000000 1.335937500000000 1.343750000000000
Columns 46 through 50

1.351562500000000 1.359375000000000 1.367187500000000 1.375000000000000 1.382812500000000


Columns 51 through 55
1.390625000000000 1.398437500000000 1.406250000000000 1.414062500000000 1.421875000000000
Columns 56 through 60
1.429687500000000 1.437500000000000 1.445312500000000 1.453125000000000 1.460937500000000
Columns 61 through 65
1.468750000000000 1.476562500000000 1.484375000000000 1.492187500000000 1.500000000000000
Columns 66 through 70
1.507812500000000 1.515625000000000 1.523437500000000 1.531250000000000 1.539062500000000
Columns 71 through 75
1.546875000000000 1.554687500000000 1.562500000000000 1.570312500000000 1.578125000000000
Columns 76 through 80
1.585937500000000 1.593750000000000 1.601562500000000 1.609375000000000 1.617187500000000
Columns 81 through 85
1.625000000000000 1.632812500000000 1.640625000000000 1.648437500000000 1.656250000000000
Columns 86 through 90
1.664062500000000 1.671875000000000 1.679687500000000 1.687500000000000 1.695312500000000
Columns 91 through 95
1.703125000000000 1.710937500000000 1.718750000000000 1.726562500000000 1.734375000000000
Columns 96 through 100
1.742187500000000 1.750000000000000 1.757812500000000 1.765625000000000 1.773437500000000
Columns 101 through 105
1.781250000000000 1.789062500000000 1.796875000000000 1.804687500000000 1.812500000000000
Columns 106 through 110
1.820312500000000 1.828125000000000 1.835937500000000 1.843750000000000 1.851562500000000
Columns 111 through 115
1.859375000000000 1.867187500000000 1.875000000000000 1.882812500000000 1.890625000000000
Columns 116 through 120
1.898437500000000 1.906250000000000 1.914062500000000 1.921875000000000 1.929687500000000

Columns 121 through 125


1.937500000000000 1.945312500000000 1.953125000000000 1.960937500000000 1.968750000000000
Columns 126 through 129
1.976562500000000 1.984375000000000 1.992187500000000 2.000000000000000

Y=
Columns 1 through 5
2.000000000000000 1.953847995680790 1.909105143377333 1.865718069241859 1.823635807106881
Columns 6 through 10
1.782809672720441 1.743193145433448 1.704741756846009 1.667412985955628 1.631166160383269
Columns 11 through 15
1.595962363283807 1.561764345575452 1.528536443148688 1.496244498739129 1.464855788170802
Columns 16 through 20
1.434338950696719 1.404663923182442 1.375801877895773 1.347725163681793 1.320407250317407
Columns 21 through 25
1.293822675853355 1.267946996764460 1.242756740740741 1.218229361963037 1.194343198717014
Columns 26 through 30
1.171077433208891 1.148412053455062 1.126327817125978 1.104806217232253 1.083829449548088
Columns 31 through 35
1.063380381673661 1.043442523644301 1.024000000000000 1.005037523234117 0.986540368545144
Columns 36 through 40
0.968494349820019 0.950885796781823 0.933701533238723 0.916928856374839 0.900555517027188
Columns 41 through 45
0.884569700896232 0.868960010640570 0.853715448809282 0.838825401568054 0.824279623177833
Columns 46 through 50
0.810068221187060 0.796181642300794 0.782610658892128 0.769346356123216 0.756380119645108
Columns 51 through 55
0.743703623847290 0.731308820629434 0.719187928669410 0.707333423163002 0.695738026012148
Columns 56 through 60
0.684394696439757 0.673296622010356 0.662437210036918 0.651810079355311 0.641409052448746

Columns 61 through 65
0.631228147905570 0.621261573194610 0.611503717743111 0.601949146303082 0.592592592592593
Columns 66 through 70
0.583428953199286 0.574453281733984 0.565660783222913 0.557046808727656 0.548606850182457
Columns 71 through 75
0.540336535439076 0.532231623509837 0.524288000000000 0.516501672721022 0.508868767476689
Columns 76 through 80
0.501385524014494 0.494048292135001 0.486853527952293 0.479797790298949 0.472877737269276
Columns 81 through 85
0.466090122894857 0.459431793946740 0.452899686858871 0.446490824767608 0.440202314662439
Columns 86 through 90
0.434031344643201 0.427975181279351 0.422031167067051 0.416196717979983 0.410469321110050
Columns 91 through 95
0.404846532394255 0.399325974424235 0.393905334335086 0.388582361770269 0.383354866919513
Columns 96 through 100
0.378220718626796 0.373177842565598 0.368224219478738 0.363357883480248 0.358576920416825
Columns 101 through 105
0.353879466286523 0.349263705712446 0.344727870469302 0.340270238060759 0.335889130345648
Columns 106 through 110
0.331582912211130 0.327349990291038 0.323188811727652 0.319097862975280 0.315075668644048
Columns 111 through 115
0.311120790382391 0.307231825796798 0.303407407407407 0.299646201638133 0.295946907840035
Columns 116 through 120
0.292308257346709 0.288729012560523 0.285207966068560 0.281743939787207 0.278335784134325
Columns 121 through 125
0.274982377228022 0.271682624111063 0.268435456000000 0.265239829558135 0.262094726191476
Columns 126 through 129
0.258999151366869 0.255952133951512 0.252952725573120 0.250000000000000

y=
0.750000002443967

ans =
0.750000002443967

4.

Se conoce que la integral siguiente resuelta analticamente da como resultado 1.4626

>> f = inline('exp(x.^2)')
f=
Inline function:
f(x) = exp(x.^2)
>> trapecomp(f,0,1,5)
Y=
1.0000 1.0408 1.1735 1.4333 1.8965 2.7183

y=
1.4807

ans =
1.4807

>> trapecomp(f,0,1,50)
Y=

Columns 1 through 8
1.0000 1.0004 1.0016 1.0036 1.0064 1.0101 1.0145 1.0198
Columns 9 through 16
1.0259 1.0329 1.0408 1.0496 1.0593 1.0699 1.0816 1.0942
Columns 17 through 24
1.1078 1.1225 1.1384 1.1553 1.1735 1.1929 1.2136 1.2357
Columns 25 through 32
1.2591 1.2840 1.3105 1.3386 1.3683 1.3999 1.4333 1.4687
Columns 33 through 40
1.5062 1.5459 1.5879 1.6323 1.6793 1.7291 1.7818 1.8375
Columns 41 through 48
1.8965 1.9589 2.0251 2.0951 2.1693 2.2479 2.3312 2.4196
Columns 49 through 51
2.5133 2.6127 2.7183

y=
1.4628

ans =
1.4628
>> trapecomp(f,0,1,500)
Y=
Columns 1 through 8
1.0000 1.0000 1.0000 1.0000 1.0001 1.0001 1.0001 1.0002
Columns 9 through 16
1.0003 1.0003 1.0004 1.0005 1.0006 1.0007 1.0008 1.0009
Columns 17 through 24
1.0010 1.0012 1.0013 1.0014 1.0016 1.0018 1.0019 1.0021
Columns 25 through 32
1.0023 1.0025 1.0027 1.0029 1.0031 1.0034 1.0036 1.0039
Columns 33 through 40

1.0041 1.0044 1.0046 1.0049 1.0052 1.0055 1.0058 1.0061


Columns 41 through 48
1.0064 1.0067 1.0071 1.0074 1.0078 1.0081 1.0085 1.0089
Columns 49 through 56
1.0093 1.0097 1.0101 1.0105 1.0109 1.0113 1.0117 1.0122
Columns 57 through 64
1.0126 1.0131 1.0135 1.0140 1.0145 1.0150 1.0155 1.0160
Columns 65 through 72
1.0165 1.0170 1.0176 1.0181 1.0187 1.0192 1.0198 1.0204
Columns 73 through 80
1.0210 1.0215 1.0221 1.0228 1.0234 1.0240 1.0246 1.0253
Columns 81 through 88
1.0259 1.0266 1.0273 1.0279 1.0286 1.0293 1.0300 1.0307
Columns 89 through 96
1.0315 1.0322 1.0329 1.0337 1.0344 1.0352 1.0360 1.0368
Columns 97 through 104
1.0376 1.0384 1.0392 1.0400 1.0408 1.0416 1.0425 1.0433
Columns 105 through 112
1.0442 1.0451 1.0460 1.0469 1.0478 1.0487 1.0496 1.0505
Columns 113 through 120
1.0515 1.0524 1.0534 1.0543 1.0553 1.0563 1.0573 1.0583
Columns 121 through 128
1.0593 1.0603 1.0613 1.0624 1.0634 1.0645 1.0656 1.0666
Columns 129 through 136
1.0677 1.0688 1.0699 1.0711 1.0722 1.0733 1.0745 1.0756
Columns 137 through 144
1.0768 1.0780 1.0792 1.0803 1.0816 1.0828 1.0840 1.0852
Columns 145 through 152
1.0865 1.0877 1.0890 1.0903 1.0916 1.0929 1.0942 1.0955

Columns 153 through 160


1.0968 1.0982 1.0995 1.1009 1.1022 1.1036 1.1050 1.1064
Columns 161 through 168
1.1078 1.1092 1.1107 1.1121 1.1136 1.1151 1.1165 1.1180
Columns 169 through 176
1.1195 1.1210 1.1225 1.1241 1.1256 1.1272 1.1287 1.1303
Columns 177 through 184
1.1319 1.1335 1.1351 1.1367 1.1384 1.1400 1.1417 1.1433
Columns 185 through 192
1.1450 1.1467 1.1484 1.1501 1.1519 1.1536 1.1553 1.1571
Columns 193 through 200
1.1589 1.1607 1.1625 1.1643 1.1661 1.1679 1.1698 1.1716
Columns 201 through 208
1.1735 1.1754 1.1773 1.1792 1.1811 1.1831 1.1850 1.1870
Columns 209 through 216
1.1889 1.1909 1.1929 1.1949 1.1969 1.1990 1.2010 1.2031
Columns 217 through 224
1.2052 1.2073 1.2094 1.2115 1.2136 1.2158 1.2179 1.2201
Columns 225 through 232
1.2223 1.2245 1.2267 1.2289 1.2311 1.2334 1.2357 1.2379
Columns 233 through 240
1.2402 1.2425 1.2449 1.2472 1.2496 1.2519 1.2543 1.2567
Columns 241 through 248
1.2591 1.2615 1.2640 1.2664 1.2689 1.2714 1.2739 1.2764
Columns 249 through 256
1.2789 1.2815 1.2840 1.2866 1.2892 1.2918 1.2944 1.2971
Columns 257 through 264
1.2997 1.3024 1.3051 1.3078 1.3105 1.3132 1.3160 1.3187
Columns 265 through 272
1.3215 1.3243 1.3271 1.3300 1.3328 1.3357 1.3386 1.3415

Columns 273 through 280


1.3444 1.3473 1.3503 1.3532 1.3562 1.3592 1.3622 1.3653
Columns 281 through 288
1.3683 1.3714 1.3745 1.3776 1.3807 1.3839 1.3871 1.3902
Columns 289 through 296
1.3934 1.3967 1.3999 1.4032 1.4064 1.4097 1.4130 1.4164
Columns 297 through 304
1.4197 1.4231 1.4265 1.4299 1.4333 1.4368 1.4402 1.4437
Columns 305 through 312
1.4472 1.4508 1.4543 1.4579 1.4615 1.4651 1.4687 1.4724
Columns 313 through 320
1.4761 1.4798 1.4835 1.4872 1.4910 1.4947 1.4985 1.5024
Columns 321 through 328
1.5062 1.5101 1.5140 1.5179 1.5218 1.5258 1.5297 1.5338
Columns 329 through 336
1.5378 1.5418 1.5459 1.5500 1.5541 1.5582 1.5624 1.5666
Columns 337 through 344
1.5708 1.5750 1.5793 1.5836 1.5879 1.5922 1.5966 1.6009
Columns 345 through 352
1.6054 1.6098 1.6142 1.6187 1.6232 1.6278 1.6323 1.6369
Columns 353 through 360
1.6415 1.6461 1.6508 1.6555 1.6602 1.6650 1.6697 1.6745
Columns 361 through 368
1.6793 1.6842 1.6891 1.6940 1.6989 1.7039 1.7089 1.7139
Columns 369 through 376
1.7189 1.7240 1.7291 1.7342 1.7394 1.7446 1.7498 1.7551
Columns 377 through 384
1.7603 1.7656 1.7710 1.7764 1.7818 1.7872 1.7927 1.7981
Columns 385 through 392

1.8037 1.8092 1.8148 1.8204 1.8261 1.8318 1.8375 1.8432


Columns 393 through 400
1.8490 1.8548 1.8607 1.8666 1.8725 1.8784 1.8844 1.8904
Columns 401 through 408
1.8965 1.9026 1.9087 1.9148 1.9210 1.9273 1.9335 1.9398
Columns 409 through 416
1.9462 1.9525 1.9589 1.9654 1.9719 1.9784 1.9849 1.9915
Columns 417 through 424
1.9982 2.0048 2.0115 2.0183 2.0251 2.0319 2.0387 2.0457
Columns 425 through 432
2.0526 2.0596 2.0666 2.0737 2.0808 2.0879 2.0951 2.1023
Columns 433 through 440
2.1096 2.1169 2.1243 2.1317 2.1391 2.1466 2.1541 2.1617
Columns 441 through 448
2.1693 2.1769 2.1847 2.1924 2.2002 2.2080 2.2159 2.2238
Columns 449 through 456
2.2318 2.2398 2.2479 2.2560 2.2642 2.2724 2.2807 2.2890
Columns 457 through 464
2.2973 2.3057 2.3142 2.3227 2.3312 2.3398 2.3485 2.3572
Columns 465 through 472
2.3660 2.3748 2.3836 2.3925 2.4015 2.4105 2.4196 2.4287
Columns 473 through 480
2.4379 2.4471 2.4564 2.4658 2.4752 2.4846 2.4941 2.5037
Columns 481 through 488
2.5133 2.5230 2.5327 2.5425 2.5524 2.5623 2.5723 2.5823
Columns 489 through 496
2.5924 2.6025 2.6127 2.6230 2.6333 2.6437 2.6542 2.6647
Columns 497 through 501
2.6753 2.6860 2.6967 2.7074 2.7183

y=
1.4627

ans =
1.4627
>> trapecomp(f,0,1,1000)
Y=
Columns 1 through 8
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
Columns 9 through 16
1.0001 1.0001 1.0001 1.0001 1.0001 1.0002 1.0002 1.0002
Columns 17 through 24
1.0003 1.0003 1.0003 1.0004 1.0004 1.0004 1.0005 1.0005
Columns 25 through 32
1.0006 1.0006 1.0007 1.0007 1.0008 1.0008 1.0009 1.0010
Columns 33 through 40
1.0010 1.0011 1.0012 1.0012 1.0013 1.0014 1.0014 1.0015
Columns 41 through 48
1.0016 1.0017 1.0018 1.0019 1.0019 1.0020 1.0021 1.0022
Columns 49 through 56
1.0023 1.0024 1.0025 1.0026 1.0027 1.0028 1.0029 1.0030
Columns 57 through 64
1.0031 1.0033 1.0034 1.0035 1.0036 1.0037 1.0039 1.0040
Columns 65 through 72
1.0041 1.0042 1.0044 1.0045 1.0046 1.0048 1.0049 1.0051
Columns 73 through 80
1.0052 1.0053 1.0055 1.0056 1.0058 1.0059 1.0061 1.0063
Columns 81 through 88
1.0064 1.0066 1.0067 1.0069 1.0071 1.0073 1.0074 1.0076
Columns 89 through 96

1.0078 1.0080 1.0081 1.0083 1.0085 1.0087 1.0089 1.0091


Columns 97 through 104
1.0093 1.0095 1.0097 1.0098 1.0101 1.0103 1.0105 1.0107
Columns 105 through 112
1.0109 1.0111 1.0113 1.0115 1.0117 1.0120 1.0122 1.0124
Columns 113 through 120
1.0126 1.0129 1.0131 1.0133 1.0135 1.0138 1.0140 1.0143
Columns 121 through 128
1.0145 1.0147 1.0150 1.0152 1.0155 1.0157 1.0160 1.0163
Columns 129 through 136
1.0165 1.0168 1.0170 1.0173 1.0176 1.0178 1.0181 1.0184
Columns 137 through 144
1.0187 1.0189 1.0192 1.0195 1.0198 1.0201 1.0204 1.0207
Columns 145 through 152
1.0210 1.0212 1.0215 1.0218 1.0221 1.0224 1.0228 1.0231
Columns 153 through 160
1.0234 1.0237 1.0240 1.0243 1.0246 1.0250 1.0253 1.0256
Columns 161 through 168
1.0259 1.0263 1.0266 1.0269 1.0273 1.0276 1.0279 1.0283
Columns 169 through 176
1.0286 1.0290 1.0293 1.0297 1.0300 1.0304 1.0307 1.0311
Columns 177 through 184
1.0315 1.0318 1.0322 1.0326 1.0329 1.0333 1.0337 1.0341
Columns 185 through 192
1.0344 1.0348 1.0352 1.0356 1.0360 1.0364 1.0368 1.0372
Columns 193 through 200
1.0376 1.0380 1.0384 1.0388 1.0392 1.0396 1.0400 1.0404
Columns 201 through 208
1.0408 1.0412 1.0416 1.0421 1.0425 1.0429 1.0433 1.0438
Columns 209 through 216

1.0442 1.0446 1.0451 1.0455 1.0460 1.0464 1.0469 1.0473


Columns 217 through 224
1.0478 1.0482 1.0487 1.0491 1.0496 1.0501 1.0505 1.0510
Columns 225 through 232
1.0515 1.0519 1.0524 1.0529 1.0534 1.0538 1.0543 1.0548
Columns 233 through 240
1.0553 1.0558 1.0563 1.0568 1.0573 1.0578 1.0583 1.0588
Columns 241 through 248
1.0593 1.0598 1.0603 1.0608 1.0613 1.0619 1.0624 1.0629
Columns 249 through 256
1.0634 1.0640 1.0645 1.0650 1.0656 1.0661 1.0666 1.0672
Columns 257 through 264
1.0677 1.0683 1.0688 1.0694 1.0699 1.0705 1.0711 1.0716
Columns 265 through 272
1.0722 1.0727 1.0733 1.0739 1.0745 1.0750 1.0756 1.0762
Columns 273 through 280
1.0768 1.0774 1.0780 1.0786 1.0792 1.0797 1.0803 1.0810
Columns 281 through 288
1.0816 1.0822 1.0828 1.0834 1.0840 1.0846 1.0852 1.0859
Columns 289 through 296
1.0865 1.0871 1.0877 1.0884 1.0890 1.0896 1.0903 1.0909
Columns 297 through 304
1.0916 1.0922 1.0929 1.0935 1.0942 1.0948 1.0955 1.0962
Columns 305 through 312
1.0968 1.0975 1.0982 1.0988 1.0995 1.1002 1.1009 1.1016
Columns 313 through 320
1.1022 1.1029 1.1036 1.1043 1.1050 1.1057 1.1064 1.1071
Columns 321 through 328
1.1078 1.1085 1.1092 1.1100 1.1107 1.1114 1.1121 1.1129

Columns 329 through 336


1.1136 1.1143 1.1151 1.1158 1.1165 1.1173 1.1180 1.1188
Columns 337 through 344
1.1195 1.1203 1.1210 1.1218 1.1225 1.1233 1.1241 1.1248
Columns 345 through 352
1.1256 1.1264 1.1272 1.1280 1.1287 1.1295 1.1303 1.1311
Columns 353 through 360
1.1319 1.1327 1.1335 1.1343 1.1351 1.1359 1.1367 1.1376
Columns 361 through 368
1.1384 1.1392 1.1400 1.1408 1.1417 1.1425 1.1433 1.1442
Columns 369 through 376
1.1450 1.1459 1.1467 1.1476 1.1484 1.1493 1.1501 1.1510
Columns 377 through 384
1.1519 1.1527 1.1536 1.1545 1.1553 1.1562 1.1571 1.1580
Columns 385 through 392
1.1589 1.1598 1.1607 1.1616 1.1625 1.1634 1.1643 1.1652
Columns 393 through 400
1.1661 1.1670 1.1679 1.1689 1.1698 1.1707 1.1716 1.1726
Columns 401 through 408
1.1735 1.1745 1.1754 1.1763 1.1773 1.1782 1.1792 1.1802
Columns 409 through 416
1.1811 1.1821 1.1831 1.1840 1.1850 1.1860 1.1870 1.1879
Columns 417 through 424
1.1889 1.1899 1.1909 1.1919 1.1929 1.1939 1.1949 1.1959
Columns 425 through 432
1.1969 1.1980 1.1990 1.2000 1.2010 1.2021 1.2031 1.2041
Columns 433 through 440
1.2052 1.2062 1.2073 1.2083 1.2094 1.2104 1.2115 1.2125
Columns 441 through 448
1.2136 1.2147 1.2158 1.2168 1.2179 1.2190 1.2201 1.2212

Columns 449 through 456


1.2223 1.2234 1.2245 1.2256 1.2267 1.2278 1.2289 1.2300
Columns 457 through 464
1.2311 1.2323 1.2334 1.2345 1.2357 1.2368 1.2379 1.2391
Columns 465 through 472
1.2402 1.2414 1.2425 1.2437 1.2449 1.2460 1.2472 1.2484
Columns 473 through 480
1.2496 1.2507 1.2519 1.2531 1.2543 1.2555 1.2567 1.2579
Columns 481 through 488
1.2591 1.2603 1.2615 1.2627 1.2640 1.2652 1.2664 1.2677
Columns 489 through 496
1.2689 1.2701 1.2714 1.2726 1.2739 1.2751 1.2764 1.2777
Columns 497 through 504
1.2789 1.2802 1.2815 1.2827 1.2840 1.2853 1.2866 1.2879
Columns 505 through 512
1.2892 1.2905 1.2918 1.2931 1.2944 1.2957 1.2971 1.2984
Columns 513 through 520
1.2997 1.3010 1.3024 1.3037 1.3051 1.3064 1.3078 1.3091
Columns 521 through 528
1.3105 1.3119 1.3132 1.3146 1.3160 1.3174 1.3187 1.3201
Columns 529 through 536
1.3215 1.3229 1.3243 1.3257 1.3271 1.3286 1.3300 1.3314
Columns 537 through 544
1.3328 1.3342 1.3357 1.3371 1.3386 1.3400 1.3415 1.3429
Columns 545 through 552
1.3444 1.3458 1.3473 1.3488 1.3503 1.3518 1.3532 1.3547
Columns 553 through 560
1.3562 1.3577 1.3592 1.3607 1.3622 1.3638 1.3653 1.3668
Columns 561 through 568

1.3683 1.3699 1.3714 1.3730 1.3745 1.3761 1.3776 1.3792


Columns 569 through 576
1.3807 1.3823 1.3839 1.3855 1.3871 1.3886 1.3902 1.3918
Columns 577 through 584
1.3934 1.3950 1.3967 1.3983 1.3999 1.4015 1.4032 1.4048
Columns 585 through 592
1.4064 1.4081 1.4097 1.4114 1.4130 1.4147 1.4164 1.4180
Columns 593 through 600
1.4197 1.4214 1.4231 1.4248 1.4265 1.4282 1.4299 1.4316
Columns 601 through 608
1.4333 1.4351 1.4368 1.4385 1.4402 1.4420 1.4437 1.4455
Columns 609 through 616
1.4472 1.4490 1.4508 1.4526 1.4543 1.4561 1.4579 1.4597
Columns 617 through 624
1.4615 1.4633 1.4651 1.4669 1.4687 1.4706 1.4724 1.4742
Columns 625 through 632
1.4761 1.4779 1.4798 1.4816 1.4835 1.4853 1.4872 1.4891
Columns 633 through 640
1.4910 1.4929 1.4947 1.4966 1.4985 1.5005 1.5024 1.5043
Columns 641 through 648
1.5062 1.5081 1.5101 1.5120 1.5140 1.5159 1.5179 1.5198
Columns 649 through 656
1.5218 1.5238 1.5258 1.5278 1.5297 1.5317 1.5338 1.5358
Columns 657 through 664
1.5378 1.5398 1.5418 1.5439 1.5459 1.5479 1.5500 1.5520
Columns 665 through 672
1.5541 1.5562 1.5582 1.5603 1.5624 1.5645 1.5666 1.5687
Columns 673 through 680
1.5708 1.5729 1.5750 1.5772 1.5793 1.5814 1.5836 1.5857
Columns 681 through 688

1.5879 1.5900 1.5922 1.5944 1.5966 1.5988 1.6009 1.6031


Columns 689 through 696
1.6054 1.6076 1.6098 1.6120 1.6142 1.6165 1.6187 1.6210
Columns 697 through 704
1.6232 1.6255 1.6278 1.6300 1.6323 1.6346 1.6369 1.6392
Columns 705 through 712
1.6415 1.6438 1.6461 1.6485 1.6508 1.6531 1.6555 1.6578
Columns 713 through 720
1.6602 1.6626 1.6650 1.6673 1.6697 1.6721 1.6745 1.6769
Columns 721 through 728
1.6793 1.6818 1.6842 1.6866 1.6891 1.6915 1.6940 1.6964
Columns 729 through 736
1.6989 1.7014 1.7039 1.7064 1.7089 1.7114 1.7139 1.7164
Columns 737 through 744
1.7189 1.7215 1.7240 1.7265 1.7291 1.7317 1.7342 1.7368
Columns 745 through 752
1.7394 1.7420 1.7446 1.7472 1.7498 1.7524 1.7551 1.7577
Columns 753 through 760
1.7603 1.7630 1.7656 1.7683 1.7710 1.7737 1.7764 1.7791
Columns 761 through 768
1.7818 1.7845 1.7872 1.7899 1.7927 1.7954 1.7981 1.8009
Columns 769 through 776
1.8037 1.8064 1.8092 1.8120 1.8148 1.8176 1.8204 1.8233
Columns 777 through 784
1.8261 1.8289 1.8318 1.8346 1.8375 1.8404 1.8432 1.8461
Columns 785 through 792
1.8490 1.8519 1.8548 1.8578 1.8607 1.8636 1.8666 1.8695
Columns 793 through 800
1.8725 1.8755 1.8784 1.8814 1.8844 1.8874 1.8904 1.8935

Columns 801 through 808


1.8965 1.8995 1.9026 1.9056 1.9087 1.9118 1.9148 1.9179
Columns 809 through 816
1.9210 1.9241 1.9273 1.9304 1.9335 1.9367 1.9398 1.9430
Columns 817 through 824
1.9462 1.9493 1.9525 1.9557 1.9589 1.9622 1.9654 1.9686
Columns 825 through 832
1.9719 1.9751 1.9784 1.9816 1.9849 1.9882 1.9915 1.9948
Columns 833 through 840
1.9982 2.0015 2.0048 2.0082 2.0115 2.0149 2.0183 2.0217
Columns 841 through 848
2.0251 2.0285 2.0319 2.0353 2.0387 2.0422 2.0457 2.0491
Columns 849 through 856
2.0526 2.0561 2.0596 2.0631 2.0666 2.0701 2.0737 2.0772
Columns 857 through 864
2.0808 2.0843 2.0879 2.0915 2.0951 2.0987 2.1023 2.1060
Columns 865 through 872
2.1096 2.1132 2.1169 2.1206 2.1243 2.1280 2.1317 2.1354
Columns 873 through 880
2.1391 2.1428 2.1466 2.1503 2.1541 2.1579 2.1617 2.1655
Columns 881 through 888
2.1693 2.1731 2.1769 2.1808 2.1847 2.1885 2.1924 2.1963
Columns 889 through 896
2.2002 2.2041 2.2080 2.2120 2.2159 2.2199 2.2238 2.2278
Columns 897 through 904
2.2318 2.2358 2.2398 2.2439 2.2479 2.2520 2.2560 2.2601
Columns 905 through 912
2.2642 2.2683 2.2724 2.2765 2.2807 2.2848 2.2890 2.2931
Columns 913 through 920
2.2973 2.3015 2.3057 2.3099 2.3142 2.3184 2.3227 2.3270

Columns 921 through 928


2.3312 2.3355 2.3398 2.3442 2.3485 2.3528 2.3572 2.3616
Columns 929 through 936
2.3660 2.3704 2.3748 2.3792 2.3836 2.3881 2.3925 2.3970
Columns 937 through 944
2.4015 2.4060 2.4105 2.4151 2.4196 2.4242 2.4287 2.4333
Columns 945 through 952
2.4379 2.4425 2.4471 2.4518 2.4564 2.4611 2.4658 2.4705
Columns 953 through 960
2.4752 2.4799 2.4846 2.4894 2.4941 2.4989 2.5037 2.5085
Columns 961 through 968
2.5133 2.5181 2.5230 2.5278 2.5327 2.5376 2.5425 2.5474
Columns 969 through 976
2.5524 2.5573 2.5623 2.5673 2.5723 2.5773 2.5823 2.5873
Columns 977 through 984
2.5924 2.5974 2.6025 2.6076 2.6127 2.6179 2.6230 2.6282
Columns 985 through 992
2.6333 2.6385 2.6437 2.6490 2.6542 2.6595 2.6647 2.6700
Columns 993 through 1000
2.6753 2.6806 2.6860 2.6913 2.6967 2.7020 2.7074 2.7129
Column 1001
2.7183

y=
1.4627

ans =
1.4627