# Ejercicio 9.18

kill(all)$

## Apartado 1)

f1(x):=exp(x)$    
f2(x):=2/sqrt(x-1)$      
f3(x):=2 + 5*(x-2)^2 * exp(2-x)$

f(x):= if x<=1 then f1(x) else (if x<=2 then f2(x) else f3(x));

wxplot2d([f(x) ], [x,-10, 15], [y, 0, 8] , [ylabel , ""] , [legend, "" ] , [style, [lines, 2]] ,
[gnuplot_preamble, "set size ratio 1; set grid"], [nticks, 300] )$

## Apartado 2)

Area_1 = A1 : integrate (f1(x) , x, -inf, 1) ;

Area_2 = A2 : integrate (f2(x) , x, 1, 2) ;

Area = A1 + A2;

## Apartado 3)

Area_3 = integrate (f3(x) , x, 2, 10) ;

%, numer;