# Exercici 9.19

kill(all)$

## Apartat a)

f(x):= 1/(exp(x)+exp(-x));

wxplot2d([f(x)], [x,0,10], [y, 0, 0.6] , [legend, "f(x)"] , [ylabel, ""] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set size ratio 1; set grid; set zeroaxis;"])$

assume(u > 0)$
'integrate (f(x), x, 0, u)=integrate (f(x), x, 0, u);

F(u):=%pi/4-atan(%e^(-u));

'limit(F(u), u, inf)=limit(F(u), u, inf);

'integrate (f(x), x, 0, inf)=integrate (f(x), x, 0, inf);

La integral impròpia és convergent i val %pi/4

## Apartat b)

kill(all)$

f(x):= 1/(x-1)^2;

wxplot2d([f(x)], [x,1.01,4], [y, 0, 50] , [legend, "f(x)"] , [ylabel, ""] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set size ratio 1; set grid; set zeroaxis;"])$

assume(t>4)$

'(integrate(f(x), x, t, 4)) = integrate(f(x), x, t, 4);

F(t):= 1/(t-1)-1/3 ;

limit(F(t), t, 1, plus);

integrate(f(x), x, 1, 4);

La integral impròpia és divergent

## Apartat c)

kill(all)$

f(x):= 1/(1+x)^(1/3);

wxplot2d([f(x)], [x, -0.99,1],  [legend, "f(x)"] , [ylabel, ""] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set size ratio 1; set grid; set zeroaxis;"])$

assume(t-1 > 0)$

'(integrate(f(x), x, t, 1)) = integrate(f(x), x, t, 1);

F(t):= 3/2^(1/3)-(3*(t+1)^(2/3))/2 ;

limit(F(t), t, -1, plus);

'(integrate(f(x), x, -1, 1)) = integrate(f(x), x, -1, 1);

La integral impròpia és convergent

## Apartat d)

kill(all)$

f(x):= (1-cos(x))/x^2;

limit(f(x), x, 0, plus);

wxplot2d([f(x)], [x,0,20], [y, 0, 0.6], [legend, "f(x)"] , [ylabel, ""] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set size ratio 1; set grid; set zeroaxis;"])$

g(x):=2/x^2;

wxplot2d([f(x), g(x)], [x,0,20], [y, 0, 0.6], [legend, "f(x)", "g(x)"] , [ylabel, ""] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set size ratio 1; set grid; set zeroaxis;"])$

'(integrate(f(x), x, 0, 5)) = integrate(f(x), x, 0, 5);

'(integrate(g(x), x, 5, inf)) = integrate(g(x), x, 5, inf);

K1 = K1 : 0.5 * 5;
K2 = K2 : 2/5;
K = K1 + K2;

La integral impròpia és convergent i fitada per K