Está en la página 1de 2

2018.04.24 Pr08 Gr01.

wxmx 1 / 2

(%i1) f(x):=x^2/10+sin(cos(x));
x2
(%o1) f( x ):= + sin( cos( x ))
10

(%i2) g(x):=cos(sin(x-1))+3;
(%o2) g( x ):= cos( sin( x - 1 ))+ 3

(%i3) integrate(g(x),x,0,5);
5
(%o3) 
 0 cos( sin( x - 1 ))+ 3 d x

(%i4) quad_qag(g(x),x,0,5,1);
(%o4) [ 19.0428486724992 , 1.0951830531141186 10 -7 , 45 , 0 ]

(%i5) plot2d([f(x),g(x)],[x,-10,10]);
(%o5)

(%i6) load(newton1);
x0:newton(f(x)-g(x),x,-5,1e-6);
x1:newton(f(x)-g(x),x,5,1e-6);
(%o6)
C:/PROGRA~2/MAXIMA~1.0-2/share/maxima/5.28.0-2/share/numeric/newton1.mac
(%o7) - 5.662045925247615
(%o8) 5.437084159557429

(%i9) plot2d(f(x)-g(x),[x,x0,x1]);
(%o9)

Integrales numéricas

(%i10) f(x):=sin(x/5);
x
(%o10) f( x ):= sin 
5

(%i11) float(integrate(f(x),x,-3,5));
(%o11) 1.425166545207693

(%i12) plot2d(f(x),[x,-3,5]);
(%o12)

a: Extremo izquierdo del intervalo


b: Extremo derecho del intervalo
N: numero de subintervalos en los que divido la función
h: Tamaño de cada subintervalo
2018.04.24 Pr08 Gr01.wxmx 2 / 2

(%i13) a:-3; b:5; N:7; h:(b-a)/N;


(%o13) -3
(%o14) 5
(%o15) 7
8
(%o16)
7

(%i17) nodos:[a+h/2,a+h/2+h,a+h/2+2*h,a+h/2+3*h,a+h/2+4*h,a+h/2+5*h,
a+h/2+6*h];
pesos: [h,h,h,h,h,h,h];
17 9 1 15 23 31
(%o17) [ - ,- ,- ,1, , , ]
7 7 7 7 7 7
8 8 8 8 8 8 8
(%o18) [ , , , , , , ]
7 7 7 7 7 7 7

(%i19) func_nodos:f(nodos);
 17  9 1 1 3  23   31 
(%o19) [ - sin  , - sin  , - sin  , sin  , sin  , sin  , sin  ]
 35   35   35  5 7  35   35 

(%i20) float(pesos.func_nodos);
(%o20) 1.428273682562617

También podría gustarte